@@ -302,8 +302,8 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
302302 // this is the legacy config that most of our tooling uses
303303 OpenAPI openAPI = TestUtils .parseFlattenSpec ("src/test/resources/2_0/additional-properties-for-testing.yaml" );
304304 DefaultCodegen codegen = new DefaultCodegen ();
305- codegen .setOpenAPI (openAPI );
306305 codegen .setDisallowAdditionalPropertiesIfNotPresent (true );
306+ codegen .setOpenAPI (openAPI );
307307
308308 Schema schema = openAPI .getComponents ().getSchemas ().get ("AdditionalPropertiesClass" );
309309 Assertions .assertNull (schema .getAdditionalProperties ());
@@ -382,9 +382,9 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
382382 public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPresentFalse () {
383383 OpenAPI openAPI = TestUtils .parseFlattenSpec ("src/test/resources/2_0/additional-properties-for-testing.yaml" );
384384 DefaultCodegen codegen = new DefaultCodegen ();
385- codegen .setOpenAPI (openAPI );
386385 codegen .setDisallowAdditionalPropertiesIfNotPresent (false );
387386 codegen .supportsAdditionalPropertiesWithComposedSchema = true ;
387+ codegen .setOpenAPI (openAPI );
388388 /*
389389 When this DisallowAdditionalPropertiesIfNotPresent is false:
390390 for CodegenModel/CodegenParameter/CodegenProperty/CodegenResponse.getAdditionalProperties
@@ -402,7 +402,7 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
402402 Schema addProps = ModelUtils .getAdditionalProperties (schema );
403403 // The petstore-with-fake-endpoints-models-for-testing.yaml does not set the
404404 // 'additionalProperties' keyword for this model, hence assert the value to be null.
405- Assertions .assertNull (addProps );
405+ Assertions .assertNotNull (addProps );
406406 CodegenModel cm = codegen .fromModel ("AdditionalPropertiesClass" , schema );
407407 Assertions .assertNotNull (cm .getAdditionalProperties ());
408408 // When the 'additionalProperties' keyword is not present, the model
0 commit comments