File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' openapi-ts-request ' : patch
3+ ---
4+
5+ perf: perf empty tags behavior, related bug #300
Original file line number Diff line number Diff line change @@ -293,11 +293,19 @@ export function getDefaultFileTag(
293293 operationObject : OperationObject ,
294294 apiPath : string
295295) : string [ ] {
296- return operationObject [ 'x-swagger-router-controller' ]
297- ? [ operationObject [ 'x-swagger-router-controller' ] as string ]
298- : operationObject . tags || [ operationObject . operationId ] || [
299- apiPath . replace ( '/' , '' ) . split ( '/' ) [ 1 ] ,
300- ] ;
296+ let lastTags : string [ ] = [ ] ;
297+
298+ if ( operationObject [ 'x-swagger-router-controller' ] ) {
299+ lastTags = [ operationObject [ 'x-swagger-router-controller' ] as string ] ;
300+ } else if ( ! isEmpty ( operationObject . tags ) ) {
301+ lastTags = operationObject . tags ;
302+ } else if ( operationObject . operationId ) {
303+ lastTags = [ operationObject . operationId ] ;
304+ } else {
305+ lastTags = [ apiPath . replace ( '/' , '' ) . split ( '/' ) [ 1 ] ] ;
306+ }
307+
308+ return lastTags ;
301309}
302310
303311function findDuplicateTypeNames ( arr : string [ ] ) {
You can’t perform that action at this time.
0 commit comments