File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,6 @@ export function toOpenAPISchema(
205205 vendors ?: MapJsonSchema
206206) {
207207 const {
208- methods : excludeMethods = [ 'OPTIONS' ] ,
209208 staticFile : excludeStaticFile = true ,
210209 tags : excludeTags
211210 } = exclude ?? { }
@@ -216,6 +215,8 @@ export function toOpenAPISchema(
216215 ? [ exclude . paths ]
217216 : [ ]
218217
218+ const excludeMethods = exclude ?. methods ?. map ( ( method ) => method . toLowerCase ( ) ) ?? [ 'options' ]
219+
219220 const paths : OpenAPIV3 . PathsObject = Object . create ( null )
220221 // @ts -ignore
221222 const definitions = app . getGlobalDefinitions ?.( ) . type
@@ -240,7 +241,11 @@ export function toOpenAPISchema(
240241
241242 if (
242243 ( excludeStaticFile && route . path . includes ( '.' ) ) ||
243- excludePaths . includes ( route . path ) ||
244+ excludePaths . some ( ( excludedPath ) =>
245+ excludedPath instanceof RegExp
246+ ? excludedPath . test ( route . path )
247+ : excludedPath === route . path
248+ ) ||
244249 excludeMethods . includes ( method )
245250 )
246251 continue
You can’t perform that action at this time.
0 commit comments