File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,6 @@ An example of using `@fastify/swagger` with `static` mode enabled can be found [
234
234
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
235
235
| hiddenTag | X-HIDDEN | Tag to control hiding of routes. |
236
236
| hideUntagged | false | If ` true ` remove routes without tags from resulting Swagger/OpenAPI schema file. |
237
- | initOAuth | {} | Configuration options for [ Swagger UI initOAuth] ( https://swagger.io/docs/open-source-tools/swagger-ui/usage/oauth2/ ) . |
238
237
| openapi | {} | [ OpenAPI configuration] ( https://swagger.io/specification/#oasObject ) . |
239
238
| stripBasePath | true | Strips base path from routes in docs. |
240
239
| swagger | {} | [ Swagger configuration] ( https://swagger.io/specification/v2/#swaggerObject ) . |
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ declare namespace fastifySwagger {
112
112
openapi ?: Partial < OpenAPIV3 . Document | OpenAPIV3_1 . Document >
113
113
hiddenTag ?: string ;
114
114
hideUntagged ?: boolean ;
115
+
116
+ /** Include HEAD routes in the definitions */
117
+ exposeHeadRoutes ?: boolean ;
118
+
115
119
/**
116
120
* Strips matching base path from routes in documentation
117
121
* @default true
@@ -127,6 +131,9 @@ declare namespace fastifySwagger {
127
131
*/
128
132
transformObject ?: SwaggerTransformObject ;
129
133
134
+ /** Overrides the Fastify decorator. */
135
+ decorator ?: 'swagger' | ( string & Record < never , never > ) ;
136
+
130
137
refResolver ?: {
131
138
/** Clone the input schema without changing it. Default to `false`. */
132
139
clone ?: boolean ;
Original file line number Diff line number Diff line change @@ -241,3 +241,19 @@ expectType<string>(app.swagger({ yaml: true }))
241
241
expectType < OpenAPI . Document | string > ( app . swagger ( { yaml : Boolean ( process . env . YAML ) } ) )
242
242
243
243
expectType < ( arg : string ) => string > ( formatParamUrl )
244
+
245
+ app . register ( fastifySwagger , {
246
+ decorator : 'swagger'
247
+ } )
248
+
249
+ app . register ( fastifySwagger , {
250
+ decorator : 'customSwagger'
251
+ } )
252
+
253
+ app . register ( fastifySwagger , {
254
+ exposeHeadRoutes : true
255
+ } )
256
+
257
+ app . register ( fastifySwagger , {
258
+ exposeHeadRoutes : false
259
+ } )
You can’t perform that action at this time.
0 commit comments