@@ -431,6 +431,50 @@ public void testFailOnUnknownPropertiesAdditionalProperty() {
431431 configAssert .assertValue (KotlinClientCodegen .FAIL_ON_UNKNOWN_PROPERTIES , codegen ::isFailOnUnknownProperties , Boolean .FALSE );
432432 }
433433
434+ @ Test
435+ public void testBooleanAdditionalProperties () {
436+ final KotlinClientCodegen codegen = new KotlinClientCodegen ();
437+
438+ // Default to false
439+ codegen .additionalProperties ().put (KotlinClientCodegen .USE_COROUTINES , "false" );
440+ codegen .additionalProperties ().put (KotlinClientCodegen .USE_RX_JAVA3 , "false" );
441+ codegen .additionalProperties ().put (KotlinClientCodegen .OMIT_GRADLE_WRAPPER , "false" );
442+ codegen .additionalProperties ().put (KotlinClientCodegen .USE_SPRING_BOOT3 , "false" );
443+ codegen .additionalProperties ().put (KotlinClientCodegen .MAP_FILE_BINARY_TO_BYTE_ARRAY , "false" );
444+ codegen .additionalProperties ().put (KotlinClientCodegen .GENERATE_ONEOF_ANYOF_WRAPPERS , "false" );
445+ codegen .additionalProperties ().put (KotlinClientCodegen .FAIL_ON_UNKNOWN_PROPERTIES , "false" );
446+
447+ codegen .processOpts ();
448+
449+ // Should be false
450+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .USE_COROUTINES ));
451+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .USE_RX_JAVA3 ));
452+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .OMIT_GRADLE_WRAPPER ));
453+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .USE_SPRING_BOOT3 ));
454+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .MAP_FILE_BINARY_TO_BYTE_ARRAY ));
455+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .GENERATE_ONEOF_ANYOF_WRAPPERS ));
456+ Assert .assertFalse ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .FAIL_ON_UNKNOWN_PROPERTIES ));
457+
458+ // Default to true
459+ codegen .additionalProperties ().put (KotlinClientCodegen .USE_COROUTINES , "true" ); // these are exclusive
460+ codegen .additionalProperties ().remove (KotlinClientCodegen .USE_RX_JAVA3 ); // these are exclusive
461+ codegen .additionalProperties ().put (KotlinClientCodegen .OMIT_GRADLE_WRAPPER , "true" );
462+ codegen .additionalProperties ().put (KotlinClientCodegen .USE_SPRING_BOOT3 , "true" );
463+ codegen .additionalProperties ().put (KotlinClientCodegen .MAP_FILE_BINARY_TO_BYTE_ARRAY , "true" );
464+ codegen .additionalProperties ().put (KotlinClientCodegen .GENERATE_ONEOF_ANYOF_WRAPPERS , "true" );
465+ codegen .additionalProperties ().put (KotlinClientCodegen .FAIL_ON_UNKNOWN_PROPERTIES , "true" );
466+
467+ codegen .processOpts ();
468+
469+ // Should be true
470+ Assert .assertTrue ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .USE_COROUTINES ));
471+ Assert .assertTrue ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .OMIT_GRADLE_WRAPPER ));
472+ Assert .assertTrue ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .USE_SPRING_BOOT3 ));
473+ Assert .assertTrue ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .MAP_FILE_BINARY_TO_BYTE_ARRAY ));
474+ Assert .assertTrue ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .GENERATE_ONEOF_ANYOF_WRAPPERS ));
475+ Assert .assertTrue ((Boolean ) codegen .additionalProperties ().get (KotlinClientCodegen .FAIL_ON_UNKNOWN_PROPERTIES ));
476+ }
477+
434478 @ DataProvider (name = "gsonClientLibraries" )
435479 public Object [][] pathResponses () {
436480 return new Object [][]{
0 commit comments