From 6c385a2ad582c9bd1e7f3eb1a791264c6359a315 Mon Sep 17 00:00:00 2001 From: damien Date: Sat, 12 Oct 2024 23:56:48 +0200 Subject: [PATCH] #484 fix additionalProperties behavior : only Schema.False and Schema.True should be taken into account --- .../microprofile/openapi3/MicroProfileOpenApi3Module.java | 3 ++- .../microprofile/openapi3/integration-test-result-Foo.json | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jsonschema-module-microprofile-openapi-3/src/main/java/com/github/victools/jsonschema/module/microprofile/openapi3/MicroProfileOpenApi3Module.java b/jsonschema-module-microprofile-openapi-3/src/main/java/com/github/victools/jsonschema/module/microprofile/openapi3/MicroProfileOpenApi3Module.java index ca3dde11..8bcc8359 100644 --- a/jsonschema-module-microprofile-openapi-3/src/main/java/com/github/victools/jsonschema/module/microprofile/openapi3/MicroProfileOpenApi3Module.java +++ b/jsonschema-module-microprofile-openapi-3/src/main/java/com/github/victools/jsonschema/module/microprofile/openapi3/MicroProfileOpenApi3Module.java @@ -207,7 +207,8 @@ protected Type mapAdditionalPropertiesEnumValue(Schema annotation) { // block any additional properties return Void.class; } else { - return annotation.additionalProperties(); + // fall-back on other configuration, e.g., as per Option.FORBIDDEN_ADDITIONAL_PROPERTIES_BY_DEFAULT + return null; } } diff --git a/jsonschema-module-microprofile-openapi-3/src/test/resources/com/github/victools/jsonschema/module/microprofile/openapi3/integration-test-result-Foo.json b/jsonschema-module-microprofile-openapi-3/src/test/resources/com/github/victools/jsonschema/module/microprofile/openapi3/integration-test-result-Foo.json index cc2893cc..bd259c27 100644 --- a/jsonschema-module-microprofile-openapi-3/src/test/resources/com/github/victools/jsonschema/module/microprofile/openapi3/integration-test-result-Foo.json +++ b/jsonschema-module-microprofile-openapi-3/src/test/resources/com/github/victools/jsonschema/module/microprofile/openapi3/integration-test-result-Foo.json @@ -10,8 +10,7 @@ } }, "title": "reference title", - "description": "the foo's person", - "additionalProperties": false + "description": "the foo's person" } }, "type": "object",