File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/cli/src/metadataGeneration
tests/fixtures/controllers Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,8 @@ export class ParameterGenerator {
439
439
}
440
440
441
441
if ( parameterType . dataType === 'union' ) {
442
- return ! parameterType . types . map ( t => this . supportPathDataType ( t ) ) . some ( t => t === false ) ;
442
+ // skip undefined inside unions
443
+ return ! parameterType . types . map ( t => t . dataType === 'undefined' || this . supportPathDataType ( t ) ) . some ( t => t === false ) ;
443
444
}
444
445
445
446
return false ;
Original file line number Diff line number Diff line change @@ -327,6 +327,11 @@ export class GetTestController extends Controller {
327
327
public async getIndexedValueGeneric ( ) : Promise < IndexedValueGeneric < IndexedValueTypeReference > > {
328
328
return 'FOO' ;
329
329
}
330
+
331
+ @Get ( 'UnionTypeWithDefault' )
332
+ public async getUnionTypeWithDefault ( @Query ( ) unionType : 'a' | 'b' | undefined = 'a' ) : Promise < void > {
333
+ return ;
334
+ }
330
335
}
331
336
332
337
export interface ErrorResponse {
You can’t perform that action at this time.
0 commit comments