You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make it possible to passthrough functions to the swagger-initializer.js (#37)
* make it possible to passthrough functions to the swagger-initializer.js
* Apply suggestions from code review
Co-authored-by: Frazer Smith <[email protected]>
* add unit tests, add Map and Set support
* improve typings and fix readme.md
* Update README.md
* Update README.md
Co-authored-by: Frazer Smith <[email protected]>
* add comments ot initOAuth
* simplify swaggerInitializer
* Update lib/routes.js
Co-authored-by: Manuel Spigolon <[email protected]>
* unnamed symbols should also be serializable
* improve documentation regarding uiConfig
* add more tests
* rename file
---------
Co-authored-by: Frazer Smith <[email protected]>
Co-authored-by: Manuel Spigolon <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ await fastify.ready()
108
108
| transformStaticCSP | undefined | Synchronous function to transform CSP header for static resources if the header has been previously set. |
109
109
| transformSpecification | undefined | Synchronous function to transform the swagger document. |
110
110
| transformSpecificationClone| true | Provide a deepcloned swaggerObject to transformSpecification |
111
-
| uiConfig | {} | Configuration options for [Swagger UI](https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md). Must be literal values, see [#5710](https://github.com/swagger-api/swagger-ui/issues/5710). |
| uiHooks | {} | Additional hooks for the documentation's routes. You can provide the `onRequest` and `preHandler` hooks with the same [route's options](https://www.fastify.io/docs/latest/Routes/#options) interface.|
113
113
| logLevel | info | Allow to define route log level. |
114
114
@@ -121,6 +121,32 @@ The plugin will expose the documentation with the following APIs:
121
121
|`'/documentation/'`| The swagger UI |
122
122
|`'/documentation/*'`| External files that you may use in `$ref`|
123
123
124
+
#### uiConfig
125
+
126
+
To configure Swagger UI, you need to modify the `uiConfig` option.
127
+
It's important to ensure that functions are self-contained. Keep in mind that
128
+
you cannot modify the backend code within the `uiConfig` functions, as these
129
+
functions are processed only by the browser. You can reference the Swagger UI
130
+
element using `ui`, which is assigned to `window.ui`.
0 commit comments