Skip to content

Commit 8f24216

Browse files
Merge pull request #2616 from CodyTseng/docs-swagger-global-parameters
docs(openapi): add descriptions about adding global parameters
2 parents 4d3f066 + f232574 commit 8f24216

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/openapi/other-features.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ const document = SwaggerModule.createDocument(app, options, {
1212
});
1313
```
1414

15+
#### Global parameters
16+
17+
You can add parameter definitions to all routes using `DocumentBuilder`:
18+
19+
```typescript
20+
const options = new DocumentBuilder().addGlobalParameters({
21+
name: 'tenantId',
22+
in: 'header',
23+
});
24+
```
25+
1526
#### Multiple specifications
1627

1728
The `SwaggerModule` provides a way to support multiple specifications. In other words, you can serve different documentation, with different UIs, on different endpoints.

0 commit comments

Comments
 (0)