File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,24 @@ export const generateValidRootSchema = (input: Types.OpenApi.Document): Types.Op
6
6
}
7
7
/** update undefined operation id */
8
8
for ( const [ path , methods ] of Object . entries ( input . paths || { } ) ) {
9
- for ( const [ method , operation ] of Object . entries ( methods || { } ) ) {
9
+ const targets = {
10
+ get : methods . get ,
11
+ put : methods . put ,
12
+ post : methods . post ,
13
+ delete : methods . delete ,
14
+ options : methods . options ,
15
+ head : methods . head ,
16
+ patch : methods . patch ,
17
+ trace : methods . trace ,
18
+ } satisfies Record < string , Types . OpenApi . Operation | undefined > ;
19
+ for ( const [ method , operation ] of Object . entries ( targets ) ) {
20
+ if ( ! operation ) {
21
+ continue ;
22
+ }
23
+ // skip reference object
24
+ if ( "$ref" in operation ) {
25
+ continue ;
26
+ }
10
27
if ( ! operation . operationId ) {
11
28
operation . operationId = `${ method . toLowerCase ( ) } ${ path . charAt ( 0 ) . toUpperCase ( ) + path . slice ( 1 ) } ` ;
12
29
}
You can’t perform that action at this time.
0 commit comments