@@ -157,6 +157,16 @@ export class TestParamsService {
157
157
) : string {
158
158
return `limit:${ limit } |prefix:${ prefix } |expand:${ expand } ` ;
159
159
}
160
+ @GET
161
+ @Path ( 'boolean-casing' )
162
+ public testBooleanCasing (
163
+ @QueryParam ( 'True' ) True ?: boolean ,
164
+ @QueryParam ( 'TRUE' ) TRUE ?: boolean ,
165
+ @QueryParam ( 'False' ) False ?: boolean ,
166
+ @QueryParam ( 'FALSE' ) FALSE ?: boolean
167
+ ) : string {
168
+ return `True:${ True } |TRUE:${ TRUE } |False:${ False } |FALSE:${ FALSE } ` ;
169
+ }
160
170
161
171
@POST
162
172
@Path ( 'upload' )
@@ -478,6 +488,30 @@ describe('Data Types Tests', () => {
478
488
}
479
489
) ;
480
490
} ) ;
491
+
492
+ it ( 'should handle boolean parameters with different casings' , ( done ) => {
493
+ request (
494
+ {
495
+ url : 'http://localhost:5674/testparams/boolean-casing?True=True&TRUE=TRUE&False=False&FALSE=FALSE'
496
+ } ,
497
+ ( error , response , body ) => {
498
+ expect ( body ) . toEqual ( 'True:true|TRUE:true|False:false|FALSE:false' ) ;
499
+ done ( ) ;
500
+ }
501
+ ) ;
502
+ } ) ;
503
+
504
+ it ( 'should handle boolean parameters as undefined' , ( done ) => {
505
+ request (
506
+ {
507
+ url : 'http://localhost:5674/testparams/boolean-casing?True='
508
+ } ,
509
+ ( error , response , body ) => {
510
+ expect ( body ) . toEqual ( 'True:false|TRUE:undefined|False:undefined|FALSE:undefined' ) ;
511
+ done ( ) ;
512
+ }
513
+ ) ;
514
+ } ) ;
481
515
} ) ;
482
516
describe ( 'Download Service' , ( ) => {
483
517
it ( 'should return a file' , ( done ) => {
0 commit comments