From 6f548cbb5d8c8f6b60b54f537e8f881b311a904c Mon Sep 17 00:00:00 2001 From: Phellippe Lima Date: Tue, 23 Apr 2024 17:19:16 +0100 Subject: [PATCH 1/4] fix: ExampleGenerator for composed child schemas and array schemas correctly --- .../codegen/examples/ExampleGenerator.java | 16 ++++- .../codegen/ExampleGeneratorTest.java | 66 +++++++++++++++++++ .../resources/3_0/example_generator_test.yaml | 33 ++++++++++ .../net8/FormModels/api/openapi.yaml | 6 ++ .../net8/NullReferenceTypes/api/openapi.yaml | 6 ++ .../net8/Petstore/api/openapi.yaml | 6 ++ .../net8/SourceGeneration/api/openapi.yaml | 6 ++ .../standard2.0/Petstore/api/openapi.yaml | 6 ++ .../standard2.0/Petstore/api/openapi.yaml | 6 ++ .../net4.7/Petstore/api/openapi.yaml | 6 ++ .../net4.8/Petstore/api/openapi.yaml | 6 ++ .../net7/EnumMappings/api/openapi.yaml | 6 ++ .../restsharp/net7/Petstore/api/openapi.yaml | 6 ++ .../ConditionalSerialization/api/openapi.yaml | 6 ++ .../standard2.0/Petstore/api/openapi.yaml | 6 ++ .../standard2.0/Petstore/api/openapi.yaml | 6 ++ 16 files changed, 192 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java index 21560e2b69fb..7bae7495e6bc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java @@ -19,7 +19,6 @@ import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.utils.ModelUtils; @@ -388,6 +387,8 @@ private Object resolveModelToExample(String name, String mediaType, Schema schem return null; } return resolvePropertyToExample(name, mediaType, found.get(), processedModels); + } else if (ModelUtils.isArraySchema(schema)) { + return resolvePropertyToExample(schema.getName(), mediaType, schema, processedModels); } else { // TODO log an error message as the model does not have any properties return null; @@ -401,6 +402,19 @@ private void traverseSchemaProperties(String mediaType, Schema schema, Set interfaces = schema.getAllOf(); + for (Schema composed : interfaces) { + traverseSchemaProperties(mediaType, composed, processedModels, values); + if (composed.get$ref() != null) { + String ref = ModelUtils.getSimpleRef(composed.get$ref()); + Schema resolved = ModelUtils.getSchema(openAPI, ref); + if (resolved != null) { + traverseSchemaProperties(mediaType, resolved, processedModels, values); + } + } + } + } } private boolean hasValidRef(Schema schema) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java index 844756e9a06d..324595e6bcd1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java @@ -152,6 +152,39 @@ public void generateFromResponseSchemaWithArrayOfPrimitiveTypes() { assertEquals("200", examples.get(0).get("statusCode")); } + @Test + public void generateFromResponseSchemaWithArraySchema() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); + + new InlineModelResolver().flatten(openAPI); + + ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); + Set mediaTypeKeys = new TreeSet<>(); + mediaTypeKeys.add("application/json"); + List> examples = exampleGenerator.generateFromResponseSchema( + "200", + openAPI + .getPaths() + .get("/generate_from_response_schema_array_reference") + .getGet() + .getResponses() + .get("200") + .getContent() + .get("application/json") + .getSchema(), + mediaTypeKeys + ); + + assertEquals(1, examples.size()); + assertEquals("application/json", examples.get(0).get("contentType")); + assertEquals("[ {\n" + + " \"example_schema_property\" : \"example schema property value\"\n" + + "}, {\n" + + " \"example_schema_property\" : \"example schema property value\"\n" + + "} ]", examples.get(0).get("example")); + assertEquals("200", examples.get(0).get("statusCode")); + } + @Test public void generateFromResponseSchemaWithModel() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); @@ -210,6 +243,39 @@ public void generateFromResponseSchemaWithAllOfComposedModel() { assertEquals("200", examples.get(0).get("statusCode")); } + @Test + public void generateFromResponseSchemaWithAllOfChildComposedModel() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); + + new InlineModelResolver().flatten(openAPI); + + ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); + Set mediaTypeKeys = new TreeSet<>(); + mediaTypeKeys.add("application/json"); + List> examples = exampleGenerator.generateFromResponseSchema( + "200", + openAPI + .getPaths() + .get("/generate_from_response_schema_with_allOf_child_composed_model") + .getGet() + .getResponses() + .get("200") + .getContent() + .get("application/json") + .getSchema(), + mediaTypeKeys + ); + + assertEquals(1, examples.size()); + assertEquals("application/json", examples.get(0).get("contentType")); + assertEquals(String.format(Locale.ROOT, "{\n" + + " \"example_schema_property_composed\" : \"example schema property value composed\",\n" + + " \"example_schema_property_composed_parent\" : \"example schema property value composed parent\",\n" + + " \"example_schema_property\" : \"example schema property value\"\n" + + "}"), examples.get(0).get("example")); + assertEquals("200", examples.get(0).get("statusCode")); + } + @Test public void generateFromResponseSchemaWithOneOfComposedModel() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); diff --git a/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml b/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml index d101a638c3eb..020edb73b406 100644 --- a/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml @@ -61,6 +61,16 @@ paths: items: type: string example: primitive types example value + /generate_from_response_schema_array_reference: + get: + operationId: generateFromResponseSchemaArrayReference + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ExampleArraySchema' /generate_from_response_schema_with_model: get: operationId: generateFromResponseSchemaWithModel @@ -81,6 +91,16 @@ paths: application/json: schema: $ref: '#/components/schemas/ExampleAllOfSchema' + /generate_from_response_schema_with_allOf_child_composed_model: + get: + operationId: generateFromResponseSchemaWithAllOfModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ExampleAllOfParentSchema' /generate_from_response_schema_with_anyOf_composed_model: get: operationId: generateFromResponseSchemaWithAnyOfModel @@ -131,6 +151,15 @@ components: example_schema_property_composed: type: string example: example schema property value composed + ExampleAllOfParentSchema: + type: object + allOf: + - $ref: '#/components/schemas/ExampleAllOfSchema' + - type: object + properties: + example_schema_property_composed_parent: + type: string + example: example schema property value composed parent ExampleAnyOfSchema: type: object anyOf: @@ -149,3 +178,7 @@ components: example_schema_property_composed: type: string example: example schema property value composed + ExampleArraySchema: + type: array + items: + $ref: '#/components/schemas/ExampleSchema' diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml index e0dd3b46457a..1d1ef5d670a6 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml @@ -1247,6 +1247,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2714,6 +2718,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml index 673de491c712..6cfc875b0745 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml index 673de491c712..6cfc875b0745 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml index 673de491c712..6cfc875b0745 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml index 673de491c712..6cfc875b0745 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml index a7e5643fd01c..0003c1c75269 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2862,6 +2866,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string From 43e037faea7a9dca3abcd2c4dacd0f54ea2d27f6 Mon Sep 17 00:00:00 2001 From: Phellippe Lima Date: Wed, 24 Apr 2024 11:55:10 +0100 Subject: [PATCH 2/4] fix: refactor to remove code duplication --- .../codegen/examples/ExampleGenerator.java | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java index 7bae7495e6bc..b7c4c1ccad15 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java @@ -363,17 +363,7 @@ private Object resolveModelToExample(String name, String mediaType, Schema schem return schema.getExample(); } else if (ModelUtils.isAllOf(schema) || ModelUtils.isAllOfWithProperties(schema)) { LOGGER.debug("Resolving allOf model '{}' to example", name); - List interfaces = schema.getAllOf(); - for (Schema composed : interfaces) { - traverseSchemaProperties(mediaType, composed, processedModels, values); - if (composed.get$ref() != null) { - String ref = ModelUtils.getSimpleRef(composed.get$ref()); - Schema resolved = ModelUtils.getSchema(openAPI, ref); - if (resolved != null) { - traverseSchemaProperties(mediaType, resolved, processedModels, values); - } - } - } + resolveAllOfSchemaProperties(mediaType, schema, processedModels, values); schema.setExample(values); return schema.getExample(); } else if (ModelUtils.isAnyOf(schema) || ModelUtils.isOneOf(schema)) { @@ -401,17 +391,20 @@ private void traverseSchemaProperties(String mediaType, Schema schema, Set interfaces = schema.getAllOf(); - for (Schema composed : interfaces) { - traverseSchemaProperties(mediaType, composed, processedModels, values); - if (composed.get$ref() != null) { - String ref = ModelUtils.getSimpleRef(composed.get$ref()); - Schema resolved = ModelUtils.getSchema(openAPI, ref); - if (resolved != null) { - traverseSchemaProperties(mediaType, resolved, processedModels, values); - } + } + + private void resolveAllOfSchemaProperties(String mediaType, Schema schema, Set processedModels, Map values) { + List interfaces = schema.getAllOf(); + for (Schema composed : interfaces) { + traverseSchemaProperties(mediaType, composed, processedModels, values); + if (composed.get$ref() != null) { + String ref = ModelUtils.getSimpleRef(composed.get$ref()); + Schema resolved = ModelUtils.getSchema(openAPI, ref); + if (resolved != null) { + traverseSchemaProperties(mediaType, resolved, processedModels, values); } } } From 0c96d493bc636bf050de9c59f2bf5ba42f0fe013 Mon Sep 17 00:00:00 2001 From: Phellippe Lima Date: Wed, 24 Apr 2024 13:20:13 +0100 Subject: [PATCH 3/4] fix: fixes test assertion encoding --- .../openapitools/codegen/ExampleGeneratorTest.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java index 324595e6bcd1..13b401ce2d4e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java @@ -177,11 +177,7 @@ public void generateFromResponseSchemaWithArraySchema() { assertEquals(1, examples.size()); assertEquals("application/json", examples.get(0).get("contentType")); - assertEquals("[ {\n" + - " \"example_schema_property\" : \"example schema property value\"\n" + - "}, {\n" + - " \"example_schema_property\" : \"example schema property value\"\n" + - "} ]", examples.get(0).get("example")); + assertEquals(String.format(Locale.ROOT, "[ {%n \"example_schema_property\" : \"example schema property value\"%n}, {%n \"example_schema_property\" : \"example schema property value\"%n} ]"), examples.get(0).get("example")); assertEquals("200", examples.get(0).get("statusCode")); } @@ -268,11 +264,7 @@ public void generateFromResponseSchemaWithAllOfChildComposedModel() { assertEquals(1, examples.size()); assertEquals("application/json", examples.get(0).get("contentType")); - assertEquals(String.format(Locale.ROOT, "{\n" + - " \"example_schema_property_composed\" : \"example schema property value composed\",\n" + - " \"example_schema_property_composed_parent\" : \"example schema property value composed parent\",\n" + - " \"example_schema_property\" : \"example schema property value\"\n" + - "}"), examples.get(0).get("example")); + assertEquals(String.format(Locale.ROOT, "{%n \"example_schema_property_composed\" : \"example schema property value composed\",%n \"example_schema_property_composed_parent\" : \"example schema property value composed parent\",%n \"example_schema_property\" : \"example schema property value\"%n}"), examples.get(0).get("example")); assertEquals("200", examples.get(0).get("statusCode")); } From 17c034cfd08c938746707e4aead2ba3bf208986d Mon Sep 17 00:00:00 2001 From: Phellippe Lima Date: Mon, 29 Apr 2024 08:17:49 +0100 Subject: [PATCH 4/4] fix: adds doc to new method --- .../openapitools/codegen/examples/ExampleGenerator.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java index b7c4c1ccad15..e5a041c2010a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java @@ -396,6 +396,13 @@ private void traverseSchemaProperties(String mediaType, Schema schema, Set processedModels, Map values) { List interfaces = schema.getAllOf(); for (Schema composed : interfaces) {