File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,7 @@ exports[`basic > hide with a boolean value 1`] = `
6868 " version" : " 0.0.0" ,
6969 },
7070 " openapi" : " 3.1.0" ,
71- " paths" : {
72- " /" : {
73- " get" : undefined ,
74- },
75- },
71+ " paths" : {},
7672 " tags" : undefined ,
7773}
7874` ;
@@ -86,11 +82,7 @@ exports[`basic > hide with a function 1`] = `
8682 " version" : " 0.0.0" ,
8783 },
8884 " openapi" : " 3.1.0" ,
89- " paths" : {
90- " /" : {
91- " get" : undefined ,
92- },
93- },
85+ " paths" : {},
9486 " tags" : undefined ,
9587}
9688` ;
Original file line number Diff line number Diff line change @@ -298,7 +298,18 @@ export function removeExcludedPaths(
298298 }
299299 }
300300
301- newPaths [ key ] = value ;
301+ // Build filtered value with only non-null methods
302+ const filteredValue : OpenAPIV3_1 . PathItemObject = { } ;
303+ for ( const method of Object . keys ( value ) ) {
304+ if ( value [ method ] != null ) {
305+ filteredValue [ method ] = value [ method ] ;
306+ }
307+ }
308+
309+ // Only add path if it has at least one valid method
310+ if ( Object . keys ( filteredValue ) . length > 0 ) {
311+ newPaths [ key ] = filteredValue ;
312+ }
302313 }
303314
304315 return newPaths ;
You can’t perform that action at this time.
0 commit comments