Skip to content

Commit 015f1a1

Browse files
committed
Merge pull request #1417 from watchwithmike/master
Updating documentation based on issue swagger-ui issue #1414
2 parents d75505f + a1ac2b7 commit 015f1a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorizat
131131

132132
Note! You can pass multiple header params on a single request, just use unique names for them (`key` is used in the above example).
133133

134+
If the header parameters are required when loading the `swagger.json`, you will need to pass the authorizations as part of the `SwaggerUi` constructor so they are available when swagger-ui retrieves those documents.
135+
```js
136+
new SwaggerUi({
137+
// ...
138+
authorizations {
139+
"apiKey": new SwaggerClient.ApiKeyAuthorization("X-YOUR-API-KEY-HEADER", "YOUR-API-KEY-VALUE", "header")
140+
},
141+
// ...
142+
});
143+
```
144+
134145
### Localization and translation
135146
The localization files are in the [lang](/lang) directory. Note that language files and translator is not included in SwaggerUI by default. You need to add them manually.
136147

0 commit comments

Comments
 (0)