@@ -302,8 +302,8 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
302
302
// this is the legacy config that most of our tooling uses
303
303
OpenAPI openAPI = TestUtils .parseFlattenSpec ("src/test/resources/2_0/additional-properties-for-testing.yaml" );
304
304
DefaultCodegen codegen = new DefaultCodegen ();
305
- codegen .setOpenAPI (openAPI );
306
305
codegen .setDisallowAdditionalPropertiesIfNotPresent (true );
306
+ codegen .setOpenAPI (openAPI );
307
307
308
308
Schema schema = openAPI .getComponents ().getSchemas ().get ("AdditionalPropertiesClass" );
309
309
Assertions .assertNull (schema .getAdditionalProperties ());
@@ -382,9 +382,9 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
382
382
public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPresentFalse () {
383
383
OpenAPI openAPI = TestUtils .parseFlattenSpec ("src/test/resources/2_0/additional-properties-for-testing.yaml" );
384
384
DefaultCodegen codegen = new DefaultCodegen ();
385
- codegen .setOpenAPI (openAPI );
386
385
codegen .setDisallowAdditionalPropertiesIfNotPresent (false );
387
386
codegen .supportsAdditionalPropertiesWithComposedSchema = true ;
387
+ codegen .setOpenAPI (openAPI );
388
388
/*
389
389
When this DisallowAdditionalPropertiesIfNotPresent is false:
390
390
for CodegenModel/CodegenParameter/CodegenProperty/CodegenResponse.getAdditionalProperties
@@ -402,7 +402,7 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
402
402
Schema addProps = ModelUtils .getAdditionalProperties (schema );
403
403
// The petstore-with-fake-endpoints-models-for-testing.yaml does not set the
404
404
// 'additionalProperties' keyword for this model, hence assert the value to be null.
405
- Assertions .assertNull (addProps );
405
+ Assertions .assertNotNull (addProps );
406
406
CodegenModel cm = codegen .fromModel ("AdditionalPropertiesClass" , schema );
407
407
Assertions .assertNotNull (cm .getAdditionalProperties ());
408
408
// When the 'additionalProperties' keyword is not present, the model
0 commit comments