Skip to content

Commit 71632cd

Browse files
Merge pull request #1983 from Tony133/docs/openapi-update
docs(openapi): update setup options for fastify
2 parents 4c8c782 + 3662e9a commit 71632cd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

content/openapi/introduction.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ const document = SwaggerModule.createDocument(app, config, options);
137137

138138
#### Setup options
139139

140-
You can configure Swagger UI by passing the options object which fulfills the `SwaggerCustomOptions` interface as a fourth argument of the `SwaggerModule#setup` method.
140+
You can configure Swagger UI by passing the options object which fulfills the `ExpressSwaggerCustomOptions` (if you use express) interface as a fourth argument of the `SwaggerModule#setup` method.
141141

142142
```TypeScript
143-
export interface SwaggerCustomOptions {
143+
export interface ExpressSwaggerCustomOptions {
144144
explorer?: boolean;
145145
swaggerOptions?: Record<string, any>;
146146
customCss?: string;
@@ -155,6 +155,14 @@ export interface SwaggerCustomOptions {
155155
}
156156
```
157157

158+
If you use fastify, you can configure the user interface by passing the `FastifySwaggerCustomOptions` object.
159+
160+
```Typescript
161+
export interface FastifySwaggerCustomOptions {
162+
uiConfig?: Record<string, any>;
163+
}
164+
```
165+
158166
For example, if you want to make sure that the authentication token persists after refreshing the page, or change the page title (that shows up in the browser), you can use the following settings:
159167

160168
```TypeScript

0 commit comments

Comments
 (0)