From 452e95b4939a6d0cd4fe203f6c9180e733a9919f Mon Sep 17 00:00:00 2001 From: David Riddervold Marconis Date: Fri, 20 Sep 2024 16:04:20 +0200 Subject: [PATCH] Add missing test for Sedan --- .../codegen/csharpnetcore/CSharpClientCodegenTest.java | 3 ++- .../org/openapitools/codegen/java/JavaClientCodegenTest.java | 3 ++- .../src/test/resources/3_0/enum_discriminator_inheritance.yaml | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java index fb2b89d63bab..2fe1bdb5e641 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java @@ -167,7 +167,8 @@ public void testEnumDiscriminatorDefaultValueIsNotString() throws IOException { "MiniVan", "CarType carType = CarType.MiniVan", "CargoVan", "CarType carType = CarType.CargoVan", "SUV", "CarType carType = CarType.SUV", - "Truck", "CarType carType = CarType.Truck" + "Truck", "CarType carType = CarType.Truck", + "Sedan", "CarType carType = CarType.Sedan" ); for (Map.Entry e : expectedContents.entrySet()) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 4538414f9bdf..13f94f89c828 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -2305,7 +2305,8 @@ public void testAllOfWithSinglePrimitiveTypeRef() { "MiniVan", "CargoVan", "SUV", - "Truck"); + "Truck", + "Sedan"); for (String entity : entities) { File entityFile = files.get(entity + ".java"); assertNotNull(entityFile); diff --git a/modules/openapi-generator/src/test/resources/3_0/enum_discriminator_inheritance.yaml b/modules/openapi-generator/src/test/resources/3_0/enum_discriminator_inheritance.yaml index e2a05d326869..e211a96edcac 100644 --- a/modules/openapi-generator/src/test/resources/3_0/enum_discriminator_inheritance.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/enum_discriminator_inheritance.yaml @@ -68,6 +68,7 @@ components: # Car inheritance tree: Car -> Truck -> SUV # Car -> Van -> MiniVan # Car -> Van -> CargoVan + # Car -> Sedan Car: type: object required: @@ -101,6 +102,8 @@ components: type: object allOf: - $ref: '#/components/schemas/Car' + required: + - carType properties: carType: $ref: '#/components/schemas/CarType'