From 7ef8f33c5b82b173f8542a655a7b3d1b15c3a0c3 Mon Sep 17 00:00:00 2001 From: Bernie Schelberg Date: Wed, 1 Mar 2023 13:24:02 +1000 Subject: [PATCH 1/4] Remove @JsonTypeName from Java POJOs --- .../src/main/resources/Java/pojo.mustache | 5 -- .../codegen/java/JavaClientCodegenTest.java | 81 ------------------- .../client/model/DataQueryAllOf.java | 1 - ...deTrueObjectAllOfQueryObjectParameter.java | 1 - ...deTrueArrayStringQueryObjectParameter.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../client/model/FooGetDefaultResponse.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../client/model/FooGetDefaultResponse.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../client/model/BigCatAllOf.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../client/model/FooGetDefaultResponse.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - .../openapitools/client/model/CatAllOf.java | 1 - .../openapitools/client/model/DogAllOf.java | 1 - .../openapitools/client/model/EnumTest.java | 1 - .../client/model/FooGetDefaultResponse.java | 1 - .../openapitools/client/model/FormatTest.java | 1 - .../client/model/HasOnlyReadOnly.java | 1 - .../client/model/Model200Response.java | 1 - .../client/model/ModelApiResponse.java | 1 - .../openapitools/client/model/ModelFile.java | 1 - .../openapitools/client/model/ModelList.java | 1 - .../client/model/ModelReturn.java | 1 - .../client/model/SpecialModelName.java | 1 - 173 files changed, 257 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index e8d4dc8ee21c..9bc065ee8f72 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -14,11 +14,6 @@ {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) -{{#isClassnameSanitized}} -{{^hasDiscriminatorWithNonEmptyMapping}} -@JsonTypeName("{{name}}") -{{/hasDiscriminatorWithNonEmptyMapping}} -{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} {{#vendorExtensions.x-class-extra-annotation}} 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 847eb43b2635..85fc75b64868 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 @@ -18,7 +18,6 @@ package org.openapitools.codegen.java; import com.google.common.collect.ImmutableMap; -import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.ArraySchema; @@ -31,7 +30,6 @@ import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConstants; @@ -77,8 +75,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.openapitools.codegen.TestUtils.assertFileContains; -import static org.openapitools.codegen.TestUtils.assertFileNotContains; import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; @@ -1757,81 +1753,4 @@ public void testJdkHttpClientWithAndWithoutParentExtension() throws Exception { "public class AnotherChild {"); } - @Test - public void testDiscriminatorWithMappingIssue14731() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()).getOpenAPI(); - - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); - codegen.setUseOneOfInterfaces(true); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - - - codegen.setUseOneOfInterfaces(true); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setUseJakartaEe(true); - codegen.setModelNameSuffix("DTO"); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - - generator.opts(input).generate(); - - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/ChildWithMappingADTO.java"), "@JsonTypeName"); - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/ChildWithMappingBDTO.java"), "@JsonTypeName"); - } - - @Test - public void testDiscriminatorWithoutMappingIssue14731() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_14731.yaml", null, new ParseOptions()).getOpenAPI(); - - JavaClientCodegen codegen = new JavaClientCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); - codegen.setUseOneOfInterfaces(true); - - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - - - codegen.setUseOneOfInterfaces(true); - codegen.setLegacyDiscriminatorBehavior(false); - codegen.setUseJakartaEe(true); - codegen.setModelNameSuffix("DTO"); - codegen.setLibrary(JavaClientCodegen.RESTTEMPLATE); - - - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - - generator.opts(input).generate(); - - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/ChildWithoutMappingADTO.java"), "@JsonTypeName"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/model/ChildWithoutMappingBDTO.java"), "@JsonTypeName"); - } } diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java index 971198bc3559..6c805a6b7555 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQueryAllOf.java @@ -35,7 +35,6 @@ DataQueryAllOf.JSON_PROPERTY_TEXT, DataQueryAllOf.JSON_PROPERTY_DATE }) -@JsonTypeName("DataQuery_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DataQueryAllOf { public static final String JSON_PROPERTY_SUFFIX = "suffix"; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index 73f67121d01a..072e69bbf766 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -35,7 +35,6 @@ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_ID, TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_NAME }) -@JsonTypeName("test_query_style_deepObject_explode_true_object_allOf_query_object_parameter") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter { public static final String JSON_PROPERTY_SIZE = "size"; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index 0e5bfd5253aa..d6160eefa5be 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -34,7 +34,6 @@ @JsonPropertyOrder({ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.JSON_PROPERTY_VALUES }) -@JsonTypeName("test_query_style_form_explode_true_array_string_query_object_parameter") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { public static final String JSON_PROPERTY_VALUES = "values"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java index 0c3637fdb678..006abecd100d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 8400a2ffeee9..4bcb3a55c88e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java index a1ec634cb069..7b7b21490147 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -47,7 +47,6 @@ EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 24955a1b750f..7cb16e20866b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ FooGetDefaultResponse.JSON_PROPERTY_STRING }) -@JsonTypeName("_foo_get_default_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java index ccfa16f1dd31..e02f29f3d1a5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -52,7 +52,6 @@ FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index dbfe98898fe1..6cd536eda041 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -33,7 +33,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java index b5bc68d4e190..340874530881 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -33,7 +33,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 0d7a12780e35..e29912df529f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -34,7 +34,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java index e14130a295bc..d9bdb0c943f2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java index b58f2e168c50..3d146aa85279 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 1dfb8ee7cf65..6d8deef6ee37 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 8783277244d7..f70a99bc3349 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 144b1a5aae51..65f754406986 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index fcf57d08fb02..91d092b404ac 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index 96422b899820..f37013e374ab 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 70b56e0182b6..bcf7dd13665a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 54561ed8bc30..3f6f772d1e57 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 73f14f16bbda..96dec23b0b1e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 752885d83029..f6de7fbb814a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f5e9cccddfef..3924f19c4304 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index ac2ffbceb825..e97c2edd465b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 94b13ecf8a14..ef0bc27246ea 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 24b32fb20ec7..b849e015bf01 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.concurrent.Immutable @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index 3bb502a7b29a..b761424dbb34 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index 17fd4e085495..97ba52601dc8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -44,7 +44,6 @@ EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 64290b3fa02f..f651ccd2657c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -30,7 +30,6 @@ @JsonPropertyOrder({ FooGetDefaultResponse.JSON_PROPERTY_STRING }) -@JsonTypeName("_foo_get_default_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 0be153739ce6..28b971ef4cb1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -49,7 +49,6 @@ FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index e4ab9de6df53..b64cc780b90f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b9..1bde53c89eee 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8e..8ecd1a3401e8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index ed2ed5656014..f68ed3c1d866 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4c..c47599eec786 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b9..1bde53c89eee 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8e..8ecd1a3401e8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index ed2ed5656014..f68ed3c1d866 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4c..c47599eec786 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 746f1a22dce5..f68338ebc345 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java index 447c610d9d8b..91e5c6730e07 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java index a70f35ab4023..ab7edb92ec4a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 81667453098b..af175660e880 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -37,7 +37,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index e746724a9ff5..ad3af4b54ff5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -50,7 +50,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index c775849bcdac..1269449f1b1f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -33,7 +33,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index 29fef6543739..ec7797ae7741 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -33,7 +33,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2a26389a36f8..437c0c9a2574 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -34,7 +34,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java index f0097d3de33b..4fefdc8cb8b6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java index 97a028a2c7ec..f28812f88186 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 6fc184774d0e..d0bba6a242b4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index e4491c583581..9247ce276165 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -32,7 +32,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b9..1bde53c89eee 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8e..8ecd1a3401e8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index ed2ed5656014..f68ed3c1d866 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4c..c47599eec786 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 15f94f82a40d..a75186023a96 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fdc794743a57..215ce3475c80 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -34,7 +34,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java index bf1526857ae3..da688aa54a55 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "BigCatAllOf") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index 7eafd8fa288b..32a5f2874cea 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "CatAllOf") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index c0cd8c02386d..6d6a092ad38f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "DogAllOf") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index a9eb0adf4d72..6f48c252406a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -38,7 +38,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "EnumTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index 6fd0fc74d617..80f42c5f6586 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -51,7 +51,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "FormatTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 8d17a0b8a73a..ef78b6570b8c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -34,7 +34,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "HasOnlyReadOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index e924373ead07..0bc520bf149d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -34,7 +34,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9de4150675f6..a93d89e3db5a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -35,7 +35,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java index 5ea992eb114a..2d8df8b4663e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ModelFile") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java index 2a312ed9331d..3a4f9f880959 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ModelList") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index 8d1b414b0b7f..4bbb0bfc3ac0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Return") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index 446af7f5e0ea..cd8fa6a47d8a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,7 +33,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "$special[model.name]") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b9..1bde53c89eee 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8e..8ecd1a3401e8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index ed2ed5656014..f68ed3c1d866 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4c..c47599eec786 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 6c0bb23d8c3c..cfa62abec300 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index f678a8e68e13..944aa027666d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 1139310f5354..5a3cc01b167c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index d2017a8d86f4..26921fda45de 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -36,7 +36,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index 6d205cb03f80..1676c46972c6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -49,7 +49,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 1cce647184ee..c6802e9d7b85 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -32,7 +32,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index 8c1f8d3019af..c051d85020fd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,7 +32,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index a50478222f70..0303a085d691 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -33,7 +33,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java index 7ef37c8d48d3..b831c9e86740 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java index d4e547b9ebe5..3adb8bdfd3a4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index ef6ba491632f..e731109e874c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index bf5d28f4ce49..a53a108df32f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -31,7 +31,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b9..1bde53c89eee 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8e..8ecd1a3401e8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index fd10bc46a585..6b6d06c6aab7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4c..c47599eec786 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 33d8deb1c1b9..1bde53c89eee 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index 7ef8de6dfc8e..8ecd1a3401e8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,7 +34,6 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index fd10bc46a585..6b6d06c6aab7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -47,7 +47,6 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0de3b216df4c..c47599eec786 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java index 1698aee53320..55792a69f921 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java index caeaf3af0610..fefb37e18d28 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java index dd09eef4554c..2a1b05ef7575 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java @@ -44,7 +44,6 @@ EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) -@JsonTypeName("Enum_Test") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 2b593f7aedd7..a0db01275c3a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -30,7 +30,6 @@ @JsonPropertyOrder({ FooGetDefaultResponse.JSON_PROPERTY_STRING }) -@JsonTypeName("_foo_get_default_response") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java index f0dbe4310338..0730ef49d4bd 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java @@ -49,7 +49,6 @@ FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) -@JsonTypeName("format_test") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e65f75da9393..d4443f61886d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java index da6e0dc65898..896361984b88 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index a8ff696e9ce8..2c48d0598c9e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java index 7d79db6626a4..6f3666baa088 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java index 6e59aee06de8..45fc27d8ae78 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java index 0f151557e3c9..3fa4fb50b613 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java index f7636280e610..e3266234d037 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("_special_model.name_") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index 89e6e65c05e5..e65c470e3d55 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) -@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 55d3afa81677..1f050f0c615a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) -@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index 17fd4e085495..97ba52601dc8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -44,7 +44,6 @@ EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) -@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 64290b3fa02f..f651ccd2657c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -30,7 +30,6 @@ @JsonPropertyOrder({ FooGetDefaultResponse.JSON_PROPERTY_STRING }) -@JsonTypeName("_foo_get_default_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index 0be153739ce6..28b971ef4cb1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -49,7 +49,6 @@ FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) -@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b2c88b91563..80b1a454cca2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -30,7 +30,6 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index e376774a1618..dacbb6962228 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -30,7 +30,6 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index e4082ed0adad..e5657d4a6377 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,7 +31,6 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java index 98f208168d28..41ba4f22e767 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java index bf32891f71ea..4dd709e83390 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index b1cc1b13819f..3b8954d4bd94 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index e4ab9de6df53..b64cc780b90f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -29,7 +29,6 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) -@JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; From 509bc370b88168b4bbc383d45d669fd31416ab62 Mon Sep 17 00:00:00 2001 From: Bernie Schelberg Date: Fri, 3 Mar 2023 12:40:34 +1000 Subject: [PATCH 2/4] Add sample scenario and test for jackson serialization and deserialization --- ...ith-fake-endpoints-models-for-testing.yaml | 8 + .../OpenAPIClient/.openapi-generator/FILES | 4 + .../petstore/csharp/OpenAPIClient/README.md | 2 + .../csharp/OpenAPIClient/docs/SpecialCat.md | 14 + .../OpenAPIClient/docs/SpecialCatAllOf.md | 13 + .../Model/SpecialCatAllOfTests.cs | 79 ++++ .../Model/SpecialCatTests.cs | 79 ++++ .../src/Org.OpenAPITools/Model/Animal.cs | 1 + .../src/Org.OpenAPITools/Model/Cat.cs | 10 + .../src/Org.OpenAPITools/Model/SpecialCat.cs | 163 +++++++ .../Org.OpenAPITools/Model/SpecialCatAllOf.cs | 156 ++++++ .../petstore/elixir/.openapi-generator/FILES | 2 + .../lib/openapi_petstore/model/special_cat.ex | 30 ++ .../model/special_cat_all_of.ex | 24 + .../mp/.openapi-generator/FILES | 4 + .../java-helidon-client/mp/docs/SpecialCat.md | 24 + .../mp/docs/SpecialCatAllOf.md | 24 + .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/Cat.java | 1 + .../openapitools/client/model/SpecialCat.java | 98 ++++ .../client/model/SpecialCatAllOf.java | 94 ++++ .../client/model/SpecialCatAllOfTest.java | 47 ++ .../client/model/SpecialCatTest.java | 75 +++ .../se/.openapi-generator/FILES | 4 + .../java-helidon-client/se/docs/SpecialCat.md | 24 + .../se/docs/SpecialCatAllOf.md | 24 + .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/Cat.java | 1 + .../openapitools/client/model/SpecialCat.java | 98 ++++ .../client/model/SpecialCatAllOf.java | 94 ++++ .../client/model/SpecialCatAllOfTest.java | 47 ++ .../client/model/SpecialCatTest.java | 75 +++ .../.openapi-generator/FILES | 4 + .../petstore/java/apache-httpclient/README.md | 2 + .../java/apache-httpclient/api/openapi.yaml | 15 + .../java/apache-httpclient/docs/SpecialCat.md | 24 + .../apache-httpclient/docs/SpecialCatAllOf.md | 24 + .../org/openapitools/client/model/Animal.java | 2 + .../org/openapitools/client/model/Cat.java | 4 + .../openapitools/client/model/SpecialCat.java | 234 +++++++++ .../client/model/SpecialCatAllOf.java | 191 ++++++++ .../client/model/SpecialCatAllOfTest.java | 48 ++ .../client/model/SpecialCatJacksonTest.java | 35 ++ .../client/model/SpecialCatTest.java | 76 +++ .../java/feign/.openapi-generator/FILES | 2 + .../petstore/java/feign/api/openapi.yaml | 15 + .../org/openapitools/client/model/Animal.java | 2 + .../org/openapitools/client/model/Cat.java | 4 + .../openapitools/client/model/SpecialCat.java | 156 ++++++ .../client/model/SpecialCatAllOf.java | 143 ++++++ .../client/model/SpecialCatAllOfTest.java | 46 ++ .../client/model/SpecialCatTest.java | 74 +++ .../.openapi-generator/FILES | 4 + .../petstore/java/webclient-jakarta/README.md | 2 + .../java/webclient-jakarta/api/openapi.yaml | 15 + .../java/webclient-jakarta/docs/SpecialCat.md | 24 + .../webclient-jakarta/docs/SpecialCatAllOf.md | 24 + .../org/openapitools/client/model/Animal.java | 2 + .../org/openapitools/client/model/Cat.java | 4 + .../openapitools/client/model/SpecialCat.java | 156 ++++++ .../client/model/SpecialCatAllOf.java | 143 ++++++ .../client/model/SpecialCatAllOfTest.java | 48 ++ .../client/model/SpecialCatTest.java | 76 +++ .../java/webclient/.openapi-generator/FILES | 4 + .../client/petstore/java/webclient/README.md | 2 + .../petstore/java/webclient/api/openapi.yaml | 15 + .../java/webclient/docs/SpecialCat.md | 24 + .../java/webclient/docs/SpecialCatAllOf.md | 24 + .../org/openapitools/client/model/Animal.java | 2 + .../org/openapitools/client/model/Cat.java | 4 + .../openapitools/client/model/SpecialCat.java | 156 ++++++ .../client/model/SpecialCatAllOf.java | 143 ++++++ .../client/model/SpecialCatAllOfTest.java | 48 ++ .../client/model/SpecialCatTest.java | 76 +++ .../petstore/perl/.openapi-generator/FILES | 4 + samples/client/petstore/perl/README.md | 6 + .../client/petstore/perl/docs/SpecialCat.md | 15 + .../petstore/perl/docs/SpecialCatAllOf.md | 15 + .../WWW/OpenAPIClient/Object/SpecialCat.pm | 255 ++++++++++ .../OpenAPIClient/Object/SpecialCatAllOf.pm | 242 ++++++++++ .../petstore/perl/t/SpecialCatAllOfTest.t | 34 ++ .../client/petstore/perl/t/SpecialCatTest.t | 34 ++ .../.openapi-generator/FILES | 4 + .../petstore/php/OpenAPIClient-php/README.md | 2 + .../docs/Model/SpecialCat.md | 9 + .../docs/Model/SpecialCatAllOf.md | 9 + .../lib/Model/SpecialCat.php | 441 +++++++++++++++++ .../lib/Model/SpecialCatAllOf.php | 447 ++++++++++++++++++ .../test/Model/SpecialCatAllOfTest.php | 90 ++++ .../test/Model/SpecialCatTest.php | 90 ++++ .../ruby-autoload/.openapi-generator/FILES | 4 + .../client/petstore/ruby-autoload/README.md | 2 + .../petstore/ruby-autoload/docs/SpecialCat.md | 18 + .../ruby-autoload/docs/SpecialCatAllOf.md | 18 + .../petstore/ruby-autoload/lib/petstore.rb | 2 + .../lib/petstore/models/special_cat.rb | 265 +++++++++++ .../lib/petstore/models/special_cat_all_of.rb | 253 ++++++++++ .../spec/models/special_cat_all_of_spec.rb | 38 ++ .../spec/models/special_cat_spec.rb | 38 ++ .../ruby-faraday/.openapi-generator/FILES | 4 + .../client/petstore/ruby-faraday/README.md | 2 + .../petstore/ruby-faraday/docs/SpecialCat.md | 18 + .../ruby-faraday/docs/SpecialCatAllOf.md | 18 + .../petstore/ruby-faraday/lib/petstore.rb | 2 + .../lib/petstore/models/special_cat.rb | 265 +++++++++++ .../lib/petstore/models/special_cat_all_of.rb | 253 ++++++++++ .../spec/models/special_cat_all_of_spec.rb | 38 ++ .../spec/models/special_cat_spec.rb | 38 ++ .../petstore/ruby/.openapi-generator/FILES | 4 + samples/client/petstore/ruby/README.md | 2 + .../client/petstore/ruby/docs/SpecialCat.md | 18 + .../petstore/ruby/docs/SpecialCatAllOf.md | 18 + samples/client/petstore/ruby/lib/petstore.rb | 2 + .../ruby/lib/petstore/models/special_cat.rb | 265 +++++++++++ .../lib/petstore/models/special_cat_all_of.rb | 253 ++++++++++ .../spec/models/special_cat_all_of_spec.rb | 38 ++ .../ruby/spec/models/special_cat_spec.rb | 38 ++ .../default-v3.0/.openapi-generator/FILES | 2 + .../builds/default-v3.0/models/Animal.ts | 6 +- .../builds/default-v3.0/models/SpecialCat.ts | 85 ++++ .../default-v3.0/models/SpecialCatAllOf.ts | 78 +++ .../builds/default-v3.0/models/index.ts | 2 + .../.openapi-generator/FILES | 4 + .../README.md | 2 + .../doc/SpecialCat.md | 18 + .../doc/SpecialCatAllOf.md | 15 + .../lib/openapi.dart | 2 + .../lib/src/deserialize.dart | 6 + .../lib/src/model/special_cat.dart | 120 +++++ .../lib/src/model/special_cat_all_of.dart | 69 +++ .../test/special_cat_all_of_test.dart | 16 + .../test/special_cat_test.dart | 31 ++ .../.openapi-generator/FILES | 4 + .../petstore_client_lib_fake/README.md | 2 + .../doc/SpecialCat.md | 18 + .../doc/SpecialCatAllOf.md | 15 + .../petstore_client_lib_fake/lib/openapi.dart | 2 + .../lib/src/model/animal.dart | 13 + .../lib/src/model/cat.dart | 89 +++- .../lib/src/model/special_cat.dart | 173 +++++++ .../lib/src/model/special_cat_all_of.dart | 164 +++++++ .../lib/src/serializers.dart | 8 +- .../test/special_cat_all_of_test.dart | 16 + .../test/special_cat_test.dart | 31 ++ .../.openapi-generator/FILES | 4 + .../dart2/petstore_client_lib_fake/README.md | 2 + .../doc/SpecialCat.md | 18 + .../doc/SpecialCatAllOf.md | 15 + .../petstore_client_lib_fake/lib/api.dart | 2 + .../lib/api_client.dart | 4 + .../lib/model/special_cat.dart | 226 +++++++++ .../lib/model/special_cat_all_of.dart | 194 ++++++++ .../test/special_cat_all_of_test.dart | 27 ++ .../test/special_cat_test.dart | 42 ++ .../python-legacy/.openapi-generator/FILES | 4 + .../client/petstore/python-legacy/README.md | 2 + .../petstore/python-legacy/docs/SpecialCat.md | 11 + .../python-legacy/docs/SpecialCatAllOf.md | 11 + .../python-legacy/petstore_api/__init__.py | 2 + .../petstore_api/models/__init__.py | 2 + .../petstore_api/models/animal.py | 3 +- .../petstore_api/models/special_cat.py | 137 ++++++ .../petstore_api/models/special_cat_all_of.py | 137 ++++++ .../python-legacy/test/test_special_cat.py | 37 ++ .../test/test_special_cat_all_of.py | 51 ++ .../petstore/mysql/.openapi-generator/FILES | 2 + .../petstore/mysql/Model/SpecialCat.sql | 26 + .../petstore/mysql/Model/SpecialCatAllOf.sql | 26 + .../schema/petstore/mysql/mysql_schema.sql | 19 + .../generated/3_0/.openapi-generator/FILES | 4 + .../generated/3_0/model/Special_Cat.cpp | 153 ++++++ .../generated/3_0/model/Special_Cat.h | 114 +++++ .../generated/3_0/model/Special_Cat_allOf.cpp | 114 +++++ .../generated/3_0/model/Special_Cat_allOf.h | 90 ++++ .../mp/.openapi-generator/FILES | 2 + .../org/openapitools/server/model/Animal.java | 1 + .../org/openapitools/server/model/Cat.java | 1 + .../openapitools/server/model/SpecialCat.java | 127 +++++ .../server/model/SpecialCatAllOf.java | 123 +++++ .../src/main/resources/META-INF/openapi.yml | 15 + .../server/model/SpecialCatAllOfTest.java | 43 ++ .../server/model/SpecialCatTest.java | 71 +++ .../se/.openapi-generator/FILES | 2 + .../org/openapitools/server/model/Animal.java | 1 + .../org/openapitools/server/model/Cat.java | 1 + .../openapitools/server/model/SpecialCat.java | 112 +++++ .../server/model/SpecialCatAllOf.java | 108 +++++ .../src/main/resources/META-INF/openapi.yml | 15 + .../server/model/SpecialCatAllOfTest.java | 43 ++ .../server/model/SpecialCatTest.java | 71 +++ .../jaxrs-jersey/.openapi-generator/FILES | 2 + .../java/org/openapitools/model/Animal.java | 1 + .../org/openapitools/model/SpecialCat.java | 135 ++++++ .../openapitools/model/SpecialCatAllOf.java | 133 ++++++ .../php-laravel/.openapi-generator/FILES | 2 + .../php-laravel/lib/app/Models/SpecialCat.php | 24 + .../lib/app/Models/SpecialCatAllOf.php | 15 + 197 files changed, 10533 insertions(+), 14 deletions(-) create mode 100644 samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md create mode 100644 samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md create mode 100644 samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md create mode 100644 samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/java/webclient/docs/SpecialCat.md create mode 100644 samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/perl/docs/SpecialCat.md create mode 100644 samples/client/petstore/perl/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm create mode 100644 samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm create mode 100644 samples/client/petstore/perl/t/SpecialCatAllOfTest.t create mode 100644 samples/client/petstore/perl/t/SpecialCatTest.t create mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md create mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md create mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php create mode 100644 samples/client/petstore/ruby-autoload/docs/SpecialCat.md create mode 100644 samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb create mode 100644 samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb create mode 100644 samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb create mode 100644 samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/docs/SpecialCat.md create mode 100644 samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb create mode 100644 samples/client/petstore/ruby/docs/SpecialCat.md create mode 100644 samples/client/petstore/ruby/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/ruby/lib/petstore/models/special_cat.rb create mode 100644 samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb create mode 100644 samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb create mode 100644 samples/client/petstore/ruby/spec/models/special_cat_spec.rb create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts create mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart create mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md create mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md create mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart create mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart create mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart create mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart create mode 100644 samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md create mode 100644 samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py create mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py create mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py create mode 100644 samples/schema/petstore/mysql/Model/SpecialCat.sql create mode 100644 samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql create mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp create mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h create mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp create mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java create mode 100644 samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java create mode 100644 samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php create mode 100644 samples/server/petstore/php-laravel/lib/app/Models/SpecialCatAllOf.php diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 6ec5b66e0e65..782399c3bae5 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1480,6 +1480,14 @@ components: properties: declawed: type: boolean + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - type: object + properties: + kind: + type: string + enum: [lions, tigers, leopards, jaguars] Animal: type: object discriminator: diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES index f55c7b183ce7..c5cd18f81627 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES @@ -54,6 +54,8 @@ docs/PetApi.md docs/ReadOnlyFirst.md docs/Return.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -123,6 +125,8 @@ src/Org.OpenAPITools/Model/Pet.cs src/Org.OpenAPITools/Model/ReadOnlyFirst.cs src/Org.OpenAPITools/Model/Return.cs src/Org.OpenAPITools/Model/SingleRefType.cs +src/Org.OpenAPITools/Model/SpecialCat.cs +src/Org.OpenAPITools/Model/SpecialCatAllOf.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index f7defb79030c..fec153d5e228 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -195,6 +195,8 @@ Class | Method | HTTP request | Description - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SingleRefType](docs/SingleRefType.md) + - [Model.SpecialCat](docs/SpecialCat.md) + - [Model.SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md new file mode 100644 index 000000000000..4c6e2432ac5f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.SpecialCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..bbe07b624f25 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.SpecialCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs new file mode 100644 index 000000000000..0588cb603d07 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing SpecialCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialCatAllOfTests + { + // TODO uncomment below to declare an instance variable for SpecialCatAllOf + //private SpecialCatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of SpecialCatAllOf + //instance = new SpecialCatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of SpecialCatAllOf + /// + [Test] + public void SpecialCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" SpecialCatAllOf + //Assert.IsInstanceOf(typeof(SpecialCatAllOf), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs new file mode 100644 index 000000000000..53cc1b9a968c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing SpecialCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class SpecialCatTests + { + // TODO uncomment below to declare an instance variable for SpecialCat + //private SpecialCat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of SpecialCat + //instance = new SpecialCat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of SpecialCat + /// + [Test] + public void SpecialCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" SpecialCat + //Assert.IsInstanceOf(typeof(SpecialCat), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index d06c695fa6ab..bf6cdd0abed9 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -32,6 +32,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "className")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] + [JsonSubtypes.KnownSubType(typeof(SpecialCat), "Special-Cat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 3110e4e5fe01..e9926951dc6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -122,6 +122,16 @@ public override int GetHashCode() /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach(var x in base.BaseValidate(validationContext)) yield return x; yield break; diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs new file mode 100644 index 000000000000..466db02bccb5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// SpecialCat + /// + [DataContract] + public partial class SpecialCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SpecialCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public SpecialCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SpecialCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SpecialCat); + } + + /// + /// Returns true if SpecialCat instances are equal + /// + /// Instance of SpecialCat to be compared + /// Boolean + public bool Equals(SpecialCat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in base.BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs new file mode 100644 index 000000000000..63d999a11029 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// SpecialCatAllOf + /// + [DataContract] + public partial class SpecialCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public SpecialCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class SpecialCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SpecialCatAllOf); + } + + /// + /// Returns true if SpecialCatAllOf instances are equal + /// + /// Instance of SpecialCatAllOf to be compared + /// Boolean + public bool Equals(SpecialCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/elixir/.openapi-generator/FILES b/samples/client/petstore/elixir/.openapi-generator/FILES index d3fc35881099..036e88c7bee6 100644 --- a/samples/client/petstore/elixir/.openapi-generator/FILES +++ b/samples/client/petstore/elixir/.openapi-generator/FILES @@ -58,6 +58,8 @@ lib/openapi_petstore/model/pet.ex lib/openapi_petstore/model/read_only_first.ex lib/openapi_petstore/model/return.ex lib/openapi_petstore/model/single_ref_type.ex +lib/openapi_petstore/model/special_cat.ex +lib/openapi_petstore/model/special_cat_all_of.ex lib/openapi_petstore/model/tag.ex lib/openapi_petstore/model/user.ex lib/openapi_petstore/request_builder.ex diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex new file mode 100644 index 000000000000..c63aaadb8c17 --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex @@ -0,0 +1,30 @@ +# NOTE: This file is auto generated by OpenAPI Generator 6.5.0-SNAPSHOT (https://openapi-generator.tech). +# Do not edit this file manually. + +defmodule OpenapiPetstore.Model.SpecialCat do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :className, + :color, + :declawed, + :kind + ] + + @type t :: %__MODULE__{ + :className => String.t, + :color => String.t | nil, + :declawed => boolean() | nil, + :kind => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenapiPetstore.Model.SpecialCat do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex new file mode 100644 index 000000000000..2ae145f9cfaf --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex @@ -0,0 +1,24 @@ +# NOTE: This file is auto generated by OpenAPI Generator 6.5.0-SNAPSHOT (https://openapi-generator.tech). +# Do not edit this file manually. + +defmodule OpenapiPetstore.Model.SpecialCatAllOf do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :kind + ] + + @type t :: %__MODULE__{ + :kind => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenapiPetstore.Model.SpecialCatAllOf do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES index 1b046cca4abd..caa93daccd2e 100644 --- a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES @@ -49,6 +49,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -111,6 +113,8 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md b/samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md b/samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java index 36ecf9c54f65..956366a31574 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java index be9c69545616..9d42a1c1a79d 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..b2c8943fc397 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; + + + + +public class SpecialCat extends Cat { + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private KindEnum kind; + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + /** + * Set kind + **/ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public SpecialCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..9b13f629228d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,94 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class SpecialCatAllOf { + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private KindEnum kind; + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + /** + * Set kind + **/ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public SpecialCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..9a86505a4451 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..27c2b55fef48 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES index 16af74d61d2a..40a8340cc2a5 100644 --- a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES @@ -49,6 +49,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -120,6 +122,8 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md b/samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md b/samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java index 36ecf9c54f65..956366a31574 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java index be9c69545616..9d42a1c1a79d 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..b2c8943fc397 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,98 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; + + + + +public class SpecialCat extends Cat { + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private KindEnum kind; + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + /** + * Set kind + **/ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public SpecialCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..9b13f629228d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,94 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class SpecialCatAllOf { + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private KindEnum kind; + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + /** + * Set kind + **/ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public SpecialCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..9a86505a4451 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..27c2b55fef48 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES index 46568169f68b..c49bbdffa3c1 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES @@ -55,6 +55,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -136,6 +138,8 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index 45ace68ceee4..c34e26b2003b 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -196,6 +196,8 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) + - [SpecialCat](docs/SpecialCat.md) + - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 2828944e5542..dab05f6ac452 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1505,6 +1505,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2140,6 +2144,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md b/samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md b/samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java index 1d37baf0f8c4..a47b43df4743 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.UnsupportedEncodingException; @@ -47,6 +48,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java index b3ab6517bc0e..07eea3f8dcd7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.UnsupportedEncodingException; @@ -42,6 +43,9 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..2c1f3d58f63e --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,234 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCat() { + + } + + public SpecialCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + try { + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `color` to the URL query string + if (getColor() != null) { + try { + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `declawed` to the URL query string + if (getDeclawed() != null) { + try { + joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `kind` to the URL query string + if (getKind() != null) { + try { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..04e9df8cac72 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,191 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCatAllOf() { + } + + public SpecialCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `kind` to the URL query string + if (getKind() != null) { + try { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + return joiner.toString(); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..947c778e233f --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java new file mode 100644 index 000000000000..4154350c3dca --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java @@ -0,0 +1,35 @@ +package org.openapitools.client.model; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +public class SpecialCatJacksonTest { + + private final ObjectMapper objectMapper = new ObjectMapper(); + + @Test + public void shouldSerializeAndDeserializeModel() throws JsonProcessingException { + String color = "yellow-gold"; + Animal model = new SpecialCat().kind(SpecialCat.KindEnum.LIONS).declawed(false).color(color); + + String json = objectMapper.writeValueAsString(model); + + assertThat(json, containsString("\"className\":\"Special-Cat\"")); + + Animal result = objectMapper.readValue(json, Animal.class); + + assertThat(result, instanceOf(SpecialCat.class)); + + SpecialCat specialCat = (SpecialCat) result; + assertThat(specialCat.getColor(), is(color)); + assertThat(specialCat.getDeclawed(), is(false)); + assertThat(specialCat.getKind(), is(SpecialCat.KindEnum.LIONS)); + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..8252e2d02f8a --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES index 1e8d11e21e95..7e6d9a770aa2 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -84,6 +84,8 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 2828944e5542..dab05f6ac452 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1505,6 +1505,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2140,6 +2144,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index 31932c6e6815..f974fa6fd171 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -44,6 +45,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 98b53f1e4fd5..3ead0c5620ec 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -39,6 +40,9 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..ac08ab645c40 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCat() { + + } + + public SpecialCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..7197872c0b5e --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCatAllOf() { + } + + public SpecialCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..5bf432c8e11c --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,46 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..75f29e155154 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCat + */ +class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES b/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES index bc9e24cb1f99..8f4bf157bb6c 100644 --- a/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES @@ -55,6 +55,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -133,6 +135,8 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index 75a5fba59e2d..e986feee76ee 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -203,6 +203,8 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) + - [SpecialCat](docs/SpecialCat.md) + - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index 2828944e5542..dab05f6ac452 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1505,6 +1505,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2140,6 +2144,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md b/samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md b/samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java index 217f89650372..7cfd4c54be1b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -44,6 +45,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java index 762c68f3b8b4..b2c359b77b68 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -39,6 +40,9 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..7ff89083bf8f --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCat() { + + } + + public SpecialCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..bb50d17fcfa6 --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCatAllOf() { + } + + public SpecialCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..947c778e233f --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..8252e2d02f8a --- /dev/null +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient/.openapi-generator/FILES b/samples/client/petstore/java/webclient/.openapi-generator/FILES index bc9e24cb1f99..8f4bf157bb6c 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient/.openapi-generator/FILES @@ -55,6 +55,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -133,6 +135,8 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md index 75a5fba59e2d..e986feee76ee 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -203,6 +203,8 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) + - [SpecialCat](docs/SpecialCat.md) + - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 2828944e5542..dab05f6ac452 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1505,6 +1505,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2140,6 +2144,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/webclient/docs/SpecialCat.md b/samples/client/petstore/java/webclient/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md b/samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index 31932c6e6815..f974fa6fd171 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -44,6 +45,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index e14f5458acbf..3ba0df2c1e54 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -39,6 +40,9 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..ac08ab645c40 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCat() { + + } + + public SpecialCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..7197872c0b5e --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCatAllOf() { + } + + public SpecialCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..947c778e233f --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..8252e2d02f8a --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/perl/.openapi-generator/FILES b/samples/client/petstore/perl/.openapi-generator/FILES index 73f05fa4007a..534718bf55d7 100644 --- a/samples/client/petstore/perl/.openapi-generator/FILES +++ b/samples/client/petstore/perl/.openapi-generator/FILES @@ -52,6 +52,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -110,6 +112,8 @@ lib/WWW/OpenAPIClient/Object/OuterObjectWithEnumProperty.pm lib/WWW/OpenAPIClient/Object/Pet.pm lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm lib/WWW/OpenAPIClient/Object/SingleRefType.pm +lib/WWW/OpenAPIClient/Object/SpecialCat.pm +lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm lib/WWW/OpenAPIClient/Object/SpecialModelName.pm lib/WWW/OpenAPIClient/Object/Tag.pm lib/WWW/OpenAPIClient/Object/User.pm diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 17380420a74b..34d2172f016c 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -287,6 +287,8 @@ use WWW::OpenAPIClient::Object::OuterObjectWithEnumProperty; use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SingleRefType; +use WWW::OpenAPIClient::Object::SpecialCat; +use WWW::OpenAPIClient::Object::SpecialCatAllOf; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; use WWW::OpenAPIClient::Object::User; @@ -355,6 +357,8 @@ use WWW::OpenAPIClient::Object::OuterObjectWithEnumProperty; use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SingleRefType; +use WWW::OpenAPIClient::Object::SpecialCat; +use WWW::OpenAPIClient::Object::SpecialCatAllOf; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; use WWW::OpenAPIClient::Object::User; @@ -473,6 +477,8 @@ Class | Method | HTTP request | Description - [WWW::OpenAPIClient::Object::Pet](docs/Pet.md) - [WWW::OpenAPIClient::Object::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [WWW::OpenAPIClient::Object::SingleRefType](docs/SingleRefType.md) + - [WWW::OpenAPIClient::Object::SpecialCat](docs/SpecialCat.md) + - [WWW::OpenAPIClient::Object::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [WWW::OpenAPIClient::Object::SpecialModelName](docs/SpecialModelName.md) - [WWW::OpenAPIClient::Object::Tag](docs/Tag.md) - [WWW::OpenAPIClient::Object::User](docs/User.md) diff --git a/samples/client/petstore/perl/docs/SpecialCat.md b/samples/client/petstore/perl/docs/SpecialCat.md new file mode 100644 index 000000000000..1b078f0e7395 --- /dev/null +++ b/samples/client/petstore/perl/docs/SpecialCat.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::SpecialCat + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::SpecialCat; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/perl/docs/SpecialCatAllOf.md b/samples/client/petstore/perl/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..abd91c13ed0a --- /dev/null +++ b/samples/client/petstore/perl/docs/SpecialCatAllOf.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::SpecialCatAllOf + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::SpecialCatAllOf; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm new file mode 100644 index 000000000000..eddba082ca15 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm @@ -0,0 +1,255 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::SpecialCat; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use WWW::OpenAPIClient::Object::Cat; + +use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Cat"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + # initialize parent object Cat + $self->WWW::OpenAPIClient::Object::Cat::init(%args); +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + # call Cat to_hash and then combine hash + $_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Cat::to_hash }; + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + my $_json_attribute = $self->attribute_map->{$_key}; + my $_type = $self->openapi_types->{$_key}; + my $_value = $self->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + $_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ]; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$_value}) { + $_hash{$_key} = $self->_to_json_primitives($_subclass, $_element); + } + $_data->{$_json_attribute} = \%_hash; + } elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) { + $_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value); + } else { + $_data->{$_json_attribute} = $_value; + } + } + } + + # combine parent (Cat) TO_JSON + $_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Cat::TO_JSON }; + + return $_data; +} + +# to_json non-array data +sub _to_json_primitives { + my ($self, $type, $data) = @_; + if ( grep( /^$type$/, ('int', 'double'))) { + # https://metacpan.org/pod/JSON#simple-scalars + # numify it, ensuring it will be dumped as a number + return undef unless defined $data; + return $data + 0; + } elsif ($type eq 'string') { + # https://metacpan.org/pod/JSON#simple-scalars + # stringified + return undef unless defined $data; + return $data . q(); + } elsif ($type eq 'boolean') { + # https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null + return $data ? \1 : \0; + } elsif ($type eq 'DATE') { + return undef unless defined $data; + if (ref($data) eq 'DateTime') { + # https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...) + return $data->ymd; + } + return $data .q(); + } elsif ($type eq 'DATE_TIME') { + return undef unless defined $data; + # the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z + if (ref($data) eq 'DateTime') { + # https://metacpan.org/pod/DateTime#$dt-%3Erfc3339 + return $data->rfc3339; + } + return $data .q(); + } else { # hash (model), In this case, the TO_JSON of the $data object is executed + return $data; + } +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + # call parent (Cat) from_hash + $self->WWW::OpenAPIClient::Object::Cat::from_hash($hash); + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double'))) { + return undef unless defined $data; + return $data + 0; + } elsif ($type eq 'string') { + return undef unless defined $data; + return $data . q(); + } elsif ($type eq 'boolean') { + return !!$data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + +__PACKAGE__->class_documentation({description => '', + class => 'SpecialCat', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'kind' => { + datatype => 'string', + base_name => 'kind', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'kind' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'kind' => 'kind' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm new file mode 100644 index 000000000000..9293307aa73a --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm @@ -0,0 +1,242 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::SpecialCatAllOf; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + + +use base ("Class::Accessor", "Class::Data::Inheritable"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + my $_json_attribute = $self->attribute_map->{$_key}; + my $_type = $self->openapi_types->{$_key}; + my $_value = $self->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + $_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ]; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$_value}) { + $_hash{$_key} = $self->_to_json_primitives($_subclass, $_element); + } + $_data->{$_json_attribute} = \%_hash; + } elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) { + $_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value); + } else { + $_data->{$_json_attribute} = $_value; + } + } + } + + return $_data; +} + +# to_json non-array data +sub _to_json_primitives { + my ($self, $type, $data) = @_; + if ( grep( /^$type$/, ('int', 'double'))) { + # https://metacpan.org/pod/JSON#simple-scalars + # numify it, ensuring it will be dumped as a number + return undef unless defined $data; + return $data + 0; + } elsif ($type eq 'string') { + # https://metacpan.org/pod/JSON#simple-scalars + # stringified + return undef unless defined $data; + return $data . q(); + } elsif ($type eq 'boolean') { + # https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null + return $data ? \1 : \0; + } elsif ($type eq 'DATE') { + return undef unless defined $data; + if (ref($data) eq 'DateTime') { + # https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...) + return $data->ymd; + } + return $data .q(); + } elsif ($type eq 'DATE_TIME') { + return undef unless defined $data; + # the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z + if (ref($data) eq 'DateTime') { + # https://metacpan.org/pod/DateTime#$dt-%3Erfc3339 + return $data->rfc3339; + } + return $data .q(); + } else { # hash (model), In this case, the TO_JSON of the $data object is executed + return $data; + } +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double'))) { + return undef unless defined $data; + return $data + 0; + } elsif ($type eq 'string') { + return undef unless defined $data; + return $data . q(); + } elsif ($type eq 'boolean') { + return !!$data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + +__PACKAGE__->class_documentation({description => '', + class => 'SpecialCatAllOf', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'kind' => { + datatype => 'string', + base_name => 'kind', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'kind' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'kind' => 'kind' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/t/SpecialCatAllOfTest.t b/samples/client/petstore/perl/t/SpecialCatAllOfTest.t new file mode 100644 index 000000000000..23fce0718d3c --- /dev/null +++ b/samples/client/petstore/perl/t/SpecialCatAllOfTest.t @@ -0,0 +1,34 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::SpecialCatAllOf'); + +# uncomment below and update the test +#my $instance = WWW::OpenAPIClient::Object::SpecialCatAllOf->new(); +# +#isa_ok($instance, 'WWW::OpenAPIClient::Object::SpecialCatAllOf'); + diff --git a/samples/client/petstore/perl/t/SpecialCatTest.t b/samples/client/petstore/perl/t/SpecialCatTest.t new file mode 100644 index 000000000000..87878cbad00e --- /dev/null +++ b/samples/client/petstore/perl/t/SpecialCatTest.t @@ -0,0 +1,34 @@ +=begin comment + +OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::SpecialCat'); + +# uncomment below and update the test +#my $instance = WWW::OpenAPIClient::Object::SpecialCat->new(); +# +#isa_ok($instance, 'WWW::OpenAPIClient::Object::SpecialCat'); + diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES index da556bb1e431..5fa1b282dd9b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -55,6 +55,8 @@ docs/Model/OuterObjectWithEnumProperty.md docs/Model/Pet.md docs/Model/ReadOnlyFirst.md docs/Model/SingleRefType.md +docs/Model/SpecialCat.md +docs/Model/SpecialCatAllOf.md docs/Model/SpecialModelName.md docs/Model/Tag.md docs/Model/User.md @@ -115,6 +117,8 @@ lib/Model/OuterObjectWithEnumProperty.php lib/Model/Pet.php lib/Model/ReadOnlyFirst.php lib/Model/SingleRefType.php +lib/Model/SpecialCat.php +lib/Model/SpecialCatAllOf.php lib/Model/SpecialModelName.php lib/Model/Tag.php lib/Model/User.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index b68c5316fdc3..1d9fb68381e2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -161,6 +161,8 @@ Class | Method | HTTP request | Description - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SingleRefType](docs/Model/SingleRefType.md) +- [SpecialCat](docs/Model/SpecialCat.md) +- [SpecialCatAllOf](docs/Model/SpecialCatAllOf.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md new file mode 100644 index 000000000000..6cf707ecfb6a --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md @@ -0,0 +1,9 @@ +# # SpecialCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md new file mode 100644 index 000000000000..820bf5912992 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md @@ -0,0 +1,9 @@ +# # SpecialCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php new file mode 100644 index 000000000000..f6c1c85067e6 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php @@ -0,0 +1,441 @@ + + */ +class SpecialCat extends Cat +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Special-Cat'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'kind' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'kind' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'kind' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kind' => 'getKind' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const KIND_LIONS = 'lions'; + public const KIND_TIGERS = 'tigers'; + public const KIND_LEOPARDS = 'leopards'; + public const KIND_JAGUARS = 'jaguars'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_LIONS, + self::KIND_TIGERS, + self::KIND_LEOPARDS, + self::KIND_JAGUARS, + ]; + } + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + $this->setIfExists('kind', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'kind', must be one of '%s'", + $this->container['kind'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets kind + * + * @return string|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string|null $kind kind + * + * @return self + */ + public function setKind($kind) + { + if (is_null($kind)) { + throw new \InvalidArgumentException('non-nullable kind cannot be null'); + } + $allowedValues = $this->getKindAllowableValues(); + if (!in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'kind', must be one of '%s'", + $kind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php new file mode 100644 index 000000000000..0ba9315393b9 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php @@ -0,0 +1,447 @@ + + */ +class SpecialCatAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Special_Cat_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'kind' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'kind' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'kind' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kind' => 'getKind' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const KIND_LIONS = 'lions'; + public const KIND_TIGERS = 'tigers'; + public const KIND_LEOPARDS = 'leopards'; + public const KIND_JAGUARS = 'jaguars'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_LIONS, + self::KIND_TIGERS, + self::KIND_LEOPARDS, + self::KIND_JAGUARS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('kind', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'kind', must be one of '%s'", + $this->container['kind'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets kind + * + * @return string|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string|null $kind kind + * + * @return self + */ + public function setKind($kind) + { + if (is_null($kind)) { + throw new \InvalidArgumentException('non-nullable kind cannot be null'); + } + $allowedValues = $this->getKindAllowableValues(); + if (!in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'kind', must be one of '%s'", + $kind, + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php new file mode 100644 index 000000000000..6acf86b0a45d --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "kind" + */ + public function testPropertyKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php new file mode 100644 index 000000000000..890d9fe8f6c6 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "kind" + */ + public function testPropertyKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/samples/client/petstore/ruby-autoload/.openapi-generator/FILES b/samples/client/petstore/ruby-autoload/.openapi-generator/FILES index 9335129107c6..1da72d15e9ef 100644 --- a/samples/client/petstore/ruby-autoload/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-autoload/.openapi-generator/FILES @@ -56,6 +56,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -118,6 +120,8 @@ lib/petstore/models/outer_object_with_enum_property.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb +lib/petstore/models/special_cat.rb +lib/petstore/models/special_cat_all_of.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/user.rb diff --git a/samples/client/petstore/ruby-autoload/README.md b/samples/client/petstore/ruby-autoload/README.md index b0f3201a1849..f16361b3af37 100644 --- a/samples/client/petstore/ruby-autoload/README.md +++ b/samples/client/petstore/ruby-autoload/README.md @@ -165,6 +165,8 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) + - [Petstore::SpecialCat](docs/SpecialCat.md) + - [Petstore::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby-autoload/docs/SpecialCat.md b/samples/client/petstore/ruby-autoload/docs/SpecialCat.md new file mode 100644 index 000000000000..02d7c24617e4 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/docs/SpecialCat.md @@ -0,0 +1,18 @@ +# Petstore::SpecialCat + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **kind** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::SpecialCat.new( + kind: null +) +``` + diff --git a/samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md b/samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..45a7adfa46c6 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md @@ -0,0 +1,18 @@ +# Petstore::SpecialCatAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **kind** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::SpecialCatAllOf.new( + kind: null +) +``` + diff --git a/samples/client/petstore/ruby-autoload/lib/petstore.rb b/samples/client/petstore/ruby-autoload/lib/petstore.rb index c23884f2ae09..75c931329850 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore.rb @@ -62,6 +62,8 @@ Petstore.autoload :Pet, 'petstore/models/pet' Petstore.autoload :ReadOnlyFirst, 'petstore/models/read_only_first' Petstore.autoload :SingleRefType, 'petstore/models/single_ref_type' +Petstore.autoload :SpecialCat, 'petstore/models/special_cat' +Petstore.autoload :SpecialCatAllOf, 'petstore/models/special_cat_all_of' Petstore.autoload :SpecialModelName, 'petstore/models/special_model_name' Petstore.autoload :Tag, 'petstore/models/tag' Petstore.autoload :User, 'petstore/models/user' diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb b/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb new file mode 100644 index 000000000000..30f7e87422a4 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb @@ -0,0 +1,265 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class SpecialCat < Cat + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Cat', + :'SpecialCatAllOf' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb b/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb new file mode 100644 index 000000000000..aaa98f36b623 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb @@ -0,0 +1,253 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class SpecialCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb new file mode 100644 index 000000000000..7dcbe3a078c8 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb @@ -0,0 +1,38 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::SpecialCatAllOf do + let(:instance) { Petstore::SpecialCatAllOf.new } + + describe 'test an instance of SpecialCatAllOf' do + it 'should create an instance of SpecialCatAllOf' do + expect(instance).to be_instance_of(Petstore::SpecialCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb new file mode 100644 index 000000000000..ddaee4891c36 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb @@ -0,0 +1,38 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::SpecialCat do + let(:instance) { Petstore::SpecialCat.new } + + describe 'test an instance of SpecialCat' do + it 'should create an instance of SpecialCat' do + expect(instance).to be_instance_of(Petstore::SpecialCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 9335129107c6..1da72d15e9ef 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -56,6 +56,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -118,6 +120,8 @@ lib/petstore/models/outer_object_with_enum_property.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb +lib/petstore/models/special_cat.rb +lib/petstore/models/special_cat_all_of.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/user.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index b0f3201a1849..f16361b3af37 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -165,6 +165,8 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) + - [Petstore::SpecialCat](docs/SpecialCat.md) + - [Petstore::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby-faraday/docs/SpecialCat.md b/samples/client/petstore/ruby-faraday/docs/SpecialCat.md new file mode 100644 index 000000000000..02d7c24617e4 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/SpecialCat.md @@ -0,0 +1,18 @@ +# Petstore::SpecialCat + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **kind** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::SpecialCat.new( + kind: null +) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md b/samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..45a7adfa46c6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md @@ -0,0 +1,18 @@ +# Petstore::SpecialCatAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **kind** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::SpecialCatAllOf.new( + kind: null +) +``` + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 7f20a8db2f63..6fe8af469ebb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -60,11 +60,13 @@ require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' +require 'petstore/models/special_cat_all_of' require 'petstore/models/special_model_name' require 'petstore/models/tag' require 'petstore/models/user' require 'petstore/models/cat' require 'petstore/models/dog' +require 'petstore/models/special_cat' # APIs require 'petstore/api/another_fake_api' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb new file mode 100644 index 000000000000..30f7e87422a4 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb @@ -0,0 +1,265 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class SpecialCat < Cat + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Cat', + :'SpecialCatAllOf' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb new file mode 100644 index 000000000000..aaa98f36b623 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb @@ -0,0 +1,253 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class SpecialCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb new file mode 100644 index 000000000000..7dcbe3a078c8 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb @@ -0,0 +1,38 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::SpecialCatAllOf do + let(:instance) { Petstore::SpecialCatAllOf.new } + + describe 'test an instance of SpecialCatAllOf' do + it 'should create an instance of SpecialCatAllOf' do + expect(instance).to be_instance_of(Petstore::SpecialCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb new file mode 100644 index 000000000000..ddaee4891c36 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb @@ -0,0 +1,38 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::SpecialCat do + let(:instance) { Petstore::SpecialCat.new } + + describe 'test an instance of SpecialCat' do + it 'should create an instance of SpecialCat' do + expect(instance).to be_instance_of(Petstore::SpecialCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index 9335129107c6..1da72d15e9ef 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -56,6 +56,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -118,6 +120,8 @@ lib/petstore/models/outer_object_with_enum_property.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb +lib/petstore/models/special_cat.rb +lib/petstore/models/special_cat_all_of.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/user.rb diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index b0f3201a1849..f16361b3af37 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -165,6 +165,8 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) + - [Petstore::SpecialCat](docs/SpecialCat.md) + - [Petstore::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby/docs/SpecialCat.md b/samples/client/petstore/ruby/docs/SpecialCat.md new file mode 100644 index 000000000000..02d7c24617e4 --- /dev/null +++ b/samples/client/petstore/ruby/docs/SpecialCat.md @@ -0,0 +1,18 @@ +# Petstore::SpecialCat + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **kind** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::SpecialCat.new( + kind: null +) +``` + diff --git a/samples/client/petstore/ruby/docs/SpecialCatAllOf.md b/samples/client/petstore/ruby/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..45a7adfa46c6 --- /dev/null +++ b/samples/client/petstore/ruby/docs/SpecialCatAllOf.md @@ -0,0 +1,18 @@ +# Petstore::SpecialCatAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **kind** | **String** | | [optional] | + +## Example + +```ruby +require 'petstore' + +instance = Petstore::SpecialCatAllOf.new( + kind: null +) +``` + diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 7f20a8db2f63..6fe8af469ebb 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -60,11 +60,13 @@ require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' +require 'petstore/models/special_cat_all_of' require 'petstore/models/special_model_name' require 'petstore/models/tag' require 'petstore/models/user' require 'petstore/models/cat' require 'petstore/models/dog' +require 'petstore/models/special_cat' # APIs require 'petstore/api/another_fake_api' diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_cat.rb b/samples/client/petstore/ruby/lib/petstore/models/special_cat.rb new file mode 100644 index 000000000000..30f7e87422a4 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/special_cat.rb @@ -0,0 +1,265 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class SpecialCat < Cat + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Cat', + :'SpecialCatAllOf' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb new file mode 100644 index 000000000000..aaa98f36b623 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb @@ -0,0 +1,253 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module Petstore + class SpecialCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Petstore.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb new file mode 100644 index 000000000000..7dcbe3a078c8 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb @@ -0,0 +1,38 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::SpecialCatAllOf do + let(:instance) { Petstore::SpecialCatAllOf.new } + + describe 'test an instance of SpecialCatAllOf' do + it 'should create an instance of SpecialCatAllOf' do + expect(instance).to be_instance_of(Petstore::SpecialCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/special_cat_spec.rb b/samples/client/petstore/ruby/spec/models/special_cat_spec.rb new file mode 100644 index 000000000000..ddaee4891c36 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/special_cat_spec.rb @@ -0,0 +1,38 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.5.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Petstore::SpecialCat do + let(:instance) { Petstore::SpecialCat.new } + + describe 'test an instance of SpecialCat' do + it 'should create an instance of SpecialCat' do + expect(instance).to be_instance_of(Petstore::SpecialCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES index 3c0152db6cba..f1a2aaa4c914 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES @@ -52,6 +52,8 @@ models/Pet.ts models/ReadOnlyFirst.ts models/Return.ts models/SingleRefType.ts +models/SpecialCat.ts +models/SpecialCatAllOf.ts models/SpecialModelName.ts models/Tag.ts models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts index 7c611d3f08e9..b3e3ac9b3614 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts @@ -15,7 +15,8 @@ import { exists, mapValues } from '../runtime'; import { CatFromJSONTyped, - DogFromJSONTyped + DogFromJSONTyped, + SpecialCatFromJSONTyped } from './'; /** @@ -63,6 +64,9 @@ export function AnimalFromJSONTyped(json: any, ignoreDiscriminator: boolean): An if (json['className'] === 'Dog') { return DogFromJSONTyped(json, true); } + if (json['className'] === 'Special-Cat') { + return SpecialCatFromJSONTyped(json, true); + } } return { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts new file mode 100644 index 000000000000..cece3293fa4f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import type { Cat } from './Cat'; +import { + CatFromJSON, + CatFromJSONTyped, + CatToJSON, +} from './Cat'; + +/** + * + * @export + * @interface SpecialCat + */ +export interface SpecialCat extends Cat { + /** + * + * @type {string} + * @memberof SpecialCat + */ + kind?: SpecialCatKindEnum; +} + + +/** + * @export + */ +export const SpecialCatKindEnum = { + Lions: 'lions', + Tigers: 'tigers', + Leopards: 'leopards', + Jaguars: 'jaguars' +} as const; +export type SpecialCatKindEnum = typeof SpecialCatKindEnum[keyof typeof SpecialCatKindEnum]; + + +/** + * Check if a given object implements the SpecialCat interface. + */ +export function instanceOfSpecialCat(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SpecialCatFromJSON(json: any): SpecialCat { + return SpecialCatFromJSONTyped(json, false); +} + +export function SpecialCatFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialCat { + if ((json === undefined) || (json === null)) { + return json; + } + return { + ...CatFromJSONTyped(json, ignoreDiscriminator), + 'kind': !exists(json, 'kind') ? undefined : json['kind'], + }; +} + +export function SpecialCatToJSON(value?: SpecialCat | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + ...CatToJSON(value), + 'kind': value.kind, + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts new file mode 100644 index 000000000000..dbcf957149a5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SpecialCatAllOf + */ +export interface SpecialCatAllOf { + /** + * + * @type {string} + * @memberof SpecialCatAllOf + */ + kind?: SpecialCatAllOfKindEnum; +} + + +/** + * @export + */ +export const SpecialCatAllOfKindEnum = { + Lions: 'lions', + Tigers: 'tigers', + Leopards: 'leopards', + Jaguars: 'jaguars' +} as const; +export type SpecialCatAllOfKindEnum = typeof SpecialCatAllOfKindEnum[keyof typeof SpecialCatAllOfKindEnum]; + + +/** + * Check if a given object implements the SpecialCatAllOf interface. + */ +export function instanceOfSpecialCatAllOf(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function SpecialCatAllOfFromJSON(json: any): SpecialCatAllOf { + return SpecialCatAllOfFromJSONTyped(json, false); +} + +export function SpecialCatAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialCatAllOf { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'kind': !exists(json, 'kind') ? undefined : json['kind'], + }; +} + +export function SpecialCatAllOfToJSON(value?: SpecialCatAllOf | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'kind': value.kind, + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts index 7229eeb8e284..79b35cc087e4 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts @@ -45,6 +45,8 @@ export * from './Pet'; export * from './ReadOnlyFirst'; export * from './Return'; export * from './SingleRefType'; +export * from './SpecialCat'; +export * from './SpecialCatAllOf'; export * from './SpecialModelName'; export * from './Tag'; export * from './User'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index b34094eb0a2f..3900082065bf 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -52,6 +52,8 @@ doc/Pet.md doc/PetApi.md doc/ReadOnlyFirst.md doc/SingleRefType.md +doc/SpecialCat.md +doc/SpecialCatAllOf.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md @@ -117,6 +119,8 @@ lib/src/model/outer_object_with_enum_property.dart lib/src/model/pet.dart lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart +lib/src/model/special_cat.dart +lib/src/model/special_cat_all_of.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index 152c6163d770..b8eeb402a558 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -155,6 +155,8 @@ Class | Method | HTTP request | Description - [Pet](doc/Pet.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) + - [SpecialCat](doc/SpecialCat.md) + - [SpecialCatAllOf](doc/SpecialCatAllOf.md) - [SpecialModelName](doc/SpecialModelName.md) - [Tag](doc/Tag.md) - [User](doc/User.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md new file mode 100644 index 000000000000..42a2dea3f96b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md @@ -0,0 +1,18 @@ +# openapi.model.SpecialCat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md new file mode 100644 index 000000000000..b63c7fd6014a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialCatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index 3beabf11dfcd..b7a74e572738 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -61,6 +61,8 @@ export 'package:openapi/src/model/outer_object_with_enum_property.dart'; export 'package:openapi/src/model/pet.dart'; export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_cat.dart'; +export 'package:openapi/src/model/special_cat_all_of.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart index 5460a3d223e1..b77a4f3b7339 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -37,6 +37,8 @@ import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/read_only_first.dart'; +import 'package:openapi/src/model/special_cat.dart'; +import 'package:openapi/src/model/special_cat_all_of.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; import 'package:openapi/src/model/user.dart'; @@ -155,6 +157,10 @@ final _regMap = RegExp(r'^Map$'); case 'SingleRefType': + case 'SpecialCat': + return SpecialCat.fromJson(value as Map) as ReturnType; + case 'SpecialCatAllOf': + return SpecialCatAllOf.fromJson(value as Map) as ReturnType; case 'SpecialModelName': return SpecialModelName.fromJson(value as Map) as ReturnType; case 'Tag': diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart new file mode 100644 index 000000000000..1f5463dfa289 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart @@ -0,0 +1,120 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:openapi/src/model/cat.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'special_cat.g.dart'; + +// ignore_for_file: unused_import + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialCat { + /// Returns a new [SpecialCat] instance. + SpecialCat({ + + required this.className, + + this.color = 'red', + + this.declawed, + + this.kind, + }); + + @JsonKey( + + name: r'className', + required: true, + includeIfNull: false + ) + + + final String className; + + + + @JsonKey( + defaultValue: 'red', + name: r'color', + required: false, + includeIfNull: false + ) + + + final String? color; + + + + @JsonKey( + + name: r'declawed', + required: false, + includeIfNull: false + ) + + + final bool? declawed; + + + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false + ) + + + final SpecialCatKindEnum? kind; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialCat && + other.className == className && + other.color == color && + other.declawed == declawed && + other.kind == kind; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + declawed.hashCode + + kind.hashCode; + + factory SpecialCat.fromJson(Map json) => _$SpecialCatFromJson(json); + + Map toJson() => _$SpecialCatToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum SpecialCatKindEnum { + @JsonValue(r'lions') + lions, + @JsonValue(r'tigers') + tigers, + @JsonValue(r'leopards') + leopards, + @JsonValue(r'jaguars') + jaguars, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart new file mode 100644 index 000000000000..ebed76a9289c --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart @@ -0,0 +1,69 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +part 'special_cat_all_of.g.dart'; + + +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SpecialCatAllOf { + /// Returns a new [SpecialCatAllOf] instance. + SpecialCatAllOf({ + + this.kind, + }); + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false + ) + + + final SpecialCatAllOfKindEnum? kind; + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialCatAllOf && + other.kind == kind; + + @override + int get hashCode => + kind.hashCode; + + factory SpecialCatAllOf.fromJson(Map json) => _$SpecialCatAllOfFromJson(json); + + Map toJson() => _$SpecialCatAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + + +enum SpecialCatAllOfKindEnum { + @JsonValue(r'lions') + lions, + @JsonValue(r'tigers') + tigers, + @JsonValue(r'leopards') + leopards, + @JsonValue(r'jaguars') + jaguars, + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi, +} + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart new file mode 100644 index 000000000000..1df6d3b9eb9a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialCatAllOf +void main() { + final SpecialCatAllOf? instance = /* SpecialCatAllOf(...) */ null; + // TODO add properties to the entity + + group(SpecialCatAllOf, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart new file mode 100644 index 000000000000..4e2c1fd66fc4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialCat +void main() { + final SpecialCat? instance = /* SpecialCat(...) */ null; + // TODO add properties to the entity + + group(SpecialCat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index 1a69ee77d623..ad5903581283 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -51,6 +51,8 @@ doc/Pet.md doc/PetApi.md doc/ReadOnlyFirst.md doc/SingleRefType.md +doc/SpecialCat.md +doc/SpecialCatAllOf.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md @@ -118,6 +120,8 @@ lib/src/model/outer_object_with_enum_property.dart lib/src/model/pet.dart lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart +lib/src/model/special_cat.dart +lib/src/model/special_cat_all_of.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index 12076ad230c7..eef5dbd68631 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -154,6 +154,8 @@ Class | Method | HTTP request | Description - [Pet](doc/Pet.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) + - [SpecialCat](doc/SpecialCat.md) + - [SpecialCatAllOf](doc/SpecialCatAllOf.md) - [SpecialModelName](doc/SpecialModelName.md) - [Tag](doc/Tag.md) - [User](doc/User.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md new file mode 100644 index 000000000000..42a2dea3f96b --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md @@ -0,0 +1,18 @@ +# openapi.model.SpecialCat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md new file mode 100644 index 000000000000..b63c7fd6014a --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialCatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index 17f56a53fae1..fffcb78dae53 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -62,6 +62,8 @@ export 'package:openapi/src/model/outer_object_with_enum_property.dart'; export 'package:openapi/src/model/pet.dart'; export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; +export 'package:openapi/src/model/special_cat.dart'; +export 'package:openapi/src/model/special_cat_all_of.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart index 01a52a6a1707..7add4d62a209 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart @@ -3,6 +3,7 @@ // // ignore_for_file: unused_element +import 'package:openapi/src/model/special_cat.dart'; import 'package:openapi/src/model/dog.dart'; import 'package:openapi/src/model/cat.dart'; import 'package:built_value/built_value.dart'; @@ -28,6 +29,7 @@ abstract class Animal { static const Map discriminatorMapping = { r'Cat': Cat, r'Dog': Dog, + r'Special-Cat': SpecialCat, }; @BuiltValueSerializer(custom: true) @@ -42,6 +44,9 @@ extension AnimalDiscriminatorExt on Animal { if (this is Dog) { return r'Dog'; } + if (this is SpecialCat) { + return r'Special-Cat'; + } return null; } } @@ -53,6 +58,9 @@ extension AnimalBuilderDiscriminatorExt on AnimalBuilder { if (this is DogBuilder) { return r'Dog'; } + if (this is SpecialCatBuilder) { + return r'Special-Cat'; + } return null; } } @@ -95,6 +103,9 @@ class _$AnimalSerializer implements PrimitiveSerializer { if (object is Dog) { return serializers.serialize(object, specifiedType: FullType(Dog))!; } + if (object is SpecialCat) { + return serializers.serialize(object, specifiedType: FullType(SpecialCat))!; + } return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @@ -112,6 +123,8 @@ class _$AnimalSerializer implements PrimitiveSerializer { return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; case r'Dog': return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; + case r'Special-Cat': + return serializers.deserialize(serialized, specifiedType: FullType(SpecialCat)) as SpecialCat; default: return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart index 23d19b38b05a..95f5a638a79b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart @@ -3,6 +3,7 @@ // // ignore_for_file: unused_element +import 'package:openapi/src/model/special_cat.dart'; import 'package:openapi/src/model/animal.dart'; import 'package:openapi/src/model/cat_all_of.dart'; import 'package:built_value/built_value.dart'; @@ -16,23 +17,38 @@ part 'cat.g.dart'; /// * [className] /// * [color] /// * [declawed] -@BuiltValue() -abstract class Cat implements Animal, CatAllOf, Built { - Cat._(); +@BuiltValue(instantiable: false) +abstract class Cat implements Animal, CatAllOf { + static const String discriminatorFieldName = r'className'; - factory Cat([void updates(CatBuilder b)]) = _$Cat; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; + static const Map discriminatorMapping = { + r'Special-Cat': SpecialCat, + }; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CatSerializer(); } +extension CatDiscriminatorExt on Cat { + String? get discriminatorValue { + if (this is SpecialCat) { + return r'Special-Cat'; + } + return null; + } +} +extension CatBuilderDiscriminatorExt on CatBuilder { + String? get discriminatorValue { + if (this is SpecialCatBuilder) { + return r'Special-Cat'; + } + return null; + } +} + class _$CatSerializer implements PrimitiveSerializer { @override - final Iterable types = const [Cat, _$Cat]; + final Iterable types = const [Cat]; @override final String wireName = r'Cat'; @@ -69,9 +85,60 @@ class _$CatSerializer implements PrimitiveSerializer { Cat object, { FullType specifiedType = FullType.unspecified, }) { + if (object is SpecialCat) { + return serializers.serialize(object, specifiedType: FullType(SpecialCat))!; + } return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } + @override + Cat deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final serializedList = (serialized as Iterable).toList(); + final discIndex = serializedList.indexOf(Cat.discriminatorFieldName) + 1; + final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; + switch (discValue) { + case r'Special-Cat': + return serializers.deserialize(serialized, specifiedType: FullType(SpecialCat)) as SpecialCat; + default: + return serializers.deserialize(serialized, specifiedType: FullType($Cat)) as $Cat; + } + } +} + +/// a concrete implementation of [Cat], since [Cat] is not instantiable +@BuiltValue(instantiable: true) +abstract class $Cat implements Cat, Built<$Cat, $CatBuilder> { + $Cat._(); + + factory $Cat([void Function($CatBuilder)? updates]) = _$$Cat; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($CatBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$Cat> get serializer => _$$CatSerializer(); +} + +class _$$CatSerializer implements PrimitiveSerializer<$Cat> { + @override + final Iterable types = const [$Cat, _$$Cat]; + + @override + final String wireName = r'$Cat'; + + @override + Object serialize( + Serializers serializers, + $Cat object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(Cat))!; + } + void _deserializeProperties( Serializers serializers, Object serialized, { @@ -114,12 +181,12 @@ class _$CatSerializer implements PrimitiveSerializer { } @override - Cat deserialize( + $Cat deserialize( Serializers serializers, Object serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = CatBuilder(); + final result = $CatBuilder(); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart new file mode 100644 index 000000000000..86797dd32cd9 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart @@ -0,0 +1,173 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:openapi/src/model/cat.dart'; +import 'package:openapi/src/model/special_cat_all_of.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'special_cat.g.dart'; + +/// SpecialCat +/// +/// Properties: +/// * [className] +/// * [color] +/// * [declawed] +/// * [kind] +@BuiltValue() +abstract class SpecialCat implements Cat, SpecialCatAllOf, Built { + SpecialCat._(); + + factory SpecialCat([void updates(SpecialCatBuilder b)]) = _$SpecialCat; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(SpecialCatBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$SpecialCatSerializer(); +} + +class _$SpecialCatSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [SpecialCat, _$SpecialCat]; + + @override + final String wireName = r'SpecialCat'; + + Iterable _serializeProperties( + Serializers serializers, + SpecialCat object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'className'; + yield serializers.serialize( + object.className, + specifiedType: const FullType(String), + ); + if (object.color != null) { + yield r'color'; + yield serializers.serialize( + object.color, + specifiedType: const FullType(String), + ); + } + if (object.declawed != null) { + yield r'declawed'; + yield serializers.serialize( + object.declawed, + specifiedType: const FullType(bool), + ); + } + if (object.kind != null) { + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(SpecialCatAllOfKindEnum), + ); + } + } + + @override + Object serialize( + Serializers serializers, + SpecialCat object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required SpecialCatBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'className': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.className = valueDes; + break; + case r'color': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.color = valueDes; + break; + case r'declawed': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.declawed = valueDes; + break; + case r'kind': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(SpecialCatAllOfKindEnum), + ) as SpecialCatAllOfKindEnum; + result.kind = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + SpecialCat deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = SpecialCatBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class SpecialCatKindEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'lions') + static const SpecialCatKindEnum lions = _$specialCatKindEnum_lions; + @BuiltValueEnumConst(wireName: r'tigers') + static const SpecialCatKindEnum tigers = _$specialCatKindEnum_tigers; + @BuiltValueEnumConst(wireName: r'leopards') + static const SpecialCatKindEnum leopards = _$specialCatKindEnum_leopards; + @BuiltValueEnumConst(wireName: r'jaguars') + static const SpecialCatKindEnum jaguars = _$specialCatKindEnum_jaguars; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const SpecialCatKindEnum unknownDefaultOpenApi = _$specialCatKindEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$specialCatKindEnumSerializer; + + const SpecialCatKindEnum._(String name): super(name); + + static BuiltSet get values => _$specialCatKindEnumValues; + static SpecialCatKindEnum valueOf(String name) => _$specialCatKindEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart new file mode 100644 index 000000000000..beed6f69770f --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart @@ -0,0 +1,164 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'special_cat_all_of.g.dart'; + +/// SpecialCatAllOf +/// +/// Properties: +/// * [kind] +@BuiltValue(instantiable: false) +abstract class SpecialCatAllOf { + @BuiltValueField(wireName: r'kind') + SpecialCatAllOfKindEnum? get kind; + // enum kindEnum { lions, tigers, leopards, jaguars, }; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$SpecialCatAllOfSerializer(); +} + +class _$SpecialCatAllOfSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [SpecialCatAllOf]; + + @override + final String wireName = r'SpecialCatAllOf'; + + Iterable _serializeProperties( + Serializers serializers, + SpecialCatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.kind != null) { + yield r'kind'; + yield serializers.serialize( + object.kind, + specifiedType: const FullType(SpecialCatAllOfKindEnum), + ); + } + } + + @override + Object serialize( + Serializers serializers, + SpecialCatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + @override + SpecialCatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.deserialize(serialized, specifiedType: FullType($SpecialCatAllOf)) as $SpecialCatAllOf; + } +} + +/// a concrete implementation of [SpecialCatAllOf], since [SpecialCatAllOf] is not instantiable +@BuiltValue(instantiable: true) +abstract class $SpecialCatAllOf implements SpecialCatAllOf, Built<$SpecialCatAllOf, $SpecialCatAllOfBuilder> { + $SpecialCatAllOf._(); + + factory $SpecialCatAllOf([void Function($SpecialCatAllOfBuilder)? updates]) = _$$SpecialCatAllOf; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults($SpecialCatAllOfBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer<$SpecialCatAllOf> get serializer => _$$SpecialCatAllOfSerializer(); +} + +class _$$SpecialCatAllOfSerializer implements PrimitiveSerializer<$SpecialCatAllOf> { + @override + final Iterable types = const [$SpecialCatAllOf, _$$SpecialCatAllOf]; + + @override + final String wireName = r'$SpecialCatAllOf'; + + @override + Object serialize( + Serializers serializers, + $SpecialCatAllOf object, { + FullType specifiedType = FullType.unspecified, + }) { + return serializers.serialize(object, specifiedType: FullType(SpecialCatAllOf))!; + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required SpecialCatAllOfBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'kind': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(SpecialCatAllOfKindEnum), + ) as SpecialCatAllOfKindEnum; + result.kind = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + $SpecialCatAllOf deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = $SpecialCatAllOfBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + +class SpecialCatAllOfKindEnum extends EnumClass { + + @BuiltValueEnumConst(wireName: r'lions') + static const SpecialCatAllOfKindEnum lions = _$specialCatAllOfKindEnum_lions; + @BuiltValueEnumConst(wireName: r'tigers') + static const SpecialCatAllOfKindEnum tigers = _$specialCatAllOfKindEnum_tigers; + @BuiltValueEnumConst(wireName: r'leopards') + static const SpecialCatAllOfKindEnum leopards = _$specialCatAllOfKindEnum_leopards; + @BuiltValueEnumConst(wireName: r'jaguars') + static const SpecialCatAllOfKindEnum jaguars = _$specialCatAllOfKindEnum_jaguars; + @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) + static const SpecialCatAllOfKindEnum unknownDefaultOpenApi = _$specialCatAllOfKindEnum_unknownDefaultOpenApi; + + static Serializer get serializer => _$specialCatAllOfKindEnumSerializer; + + const SpecialCatAllOfKindEnum._(String name): super(name); + + static BuiltSet get values => _$specialCatAllOfKindEnumValues; + static SpecialCatAllOfKindEnum valueOf(String name) => _$specialCatAllOfKindEnumValueOf(name); +} + diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart index 60f50e5a77f7..6218c9fe46ec 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart @@ -59,6 +59,8 @@ import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/read_only_first.dart'; import 'package:openapi/src/model/single_ref_type.dart'; +import 'package:openapi/src/model/special_cat.dart'; +import 'package:openapi/src/model/special_cat_all_of.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; import 'package:openapi/src/model/user.dart'; @@ -74,7 +76,7 @@ part 'serializers.g.dart'; ArrayOfNumberOnly, ArrayTest, Capitalization, - Cat, + Cat,$Cat, CatAllOf,$CatAllOf, Category, ClassModel, @@ -111,6 +113,8 @@ part 'serializers.g.dart'; Pet, ReadOnlyFirst, SingleRefType, + SpecialCat, + SpecialCatAllOf,$SpecialCatAllOf, SpecialModelName, Tag, User, @@ -149,8 +153,10 @@ Serializers serializers = (_$serializers.toBuilder() () => ListBuilder(), ) ..add(Animal.serializer) + ..add(Cat.serializer) ..add(CatAllOf.serializer) ..add(DogAllOf.serializer) + ..add(SpecialCatAllOf.serializer) ..add(const OneOfSerializer()) ..add(const AnyOfSerializer()) ..add(const DateSerializer()) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart new file mode 100644 index 000000000000..bca1751442f4 --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialCatAllOf +void main() { + //final instance = SpecialCatAllOfBuilder(); + // TODO add properties to the builder and call build() + + group(SpecialCatAllOf, () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart new file mode 100644 index 000000000000..2a7924c3b6eb --- /dev/null +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:openapi/openapi.dart'; + +// tests for SpecialCat +void main() { + final instance = SpecialCatBuilder(); + // TODO add properties to the builder and call build() + + group(SpecialCat, () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + }); +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES index c2faff09ed83..6acebf4d324c 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES @@ -52,6 +52,8 @@ doc/Pet.md doc/PetApi.md doc/ReadOnlyFirst.md doc/SingleRefType.md +doc/SpecialCat.md +doc/SpecialCatAllOf.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md @@ -119,6 +121,8 @@ lib/model/outer_object_with_enum_property.dart lib/model/pet.dart lib/model/read_only_first.dart lib/model/single_ref_type.dart +lib/model/special_cat.dart +lib/model/special_cat_all_of.dart lib/model/special_model_name.dart lib/model/tag.dart lib/model/user.dart diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md index ed181f1495b2..5ee870af8cd2 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md @@ -148,6 +148,8 @@ Class | Method | HTTP request | Description - [Pet](doc//Pet.md) - [ReadOnlyFirst](doc//ReadOnlyFirst.md) - [SingleRefType](doc//SingleRefType.md) + - [SpecialCat](doc//SpecialCat.md) + - [SpecialCatAllOf](doc//SpecialCatAllOf.md) - [SpecialModelName](doc//SpecialModelName.md) - [Tag](doc//Tag.md) - [User](doc//User.md) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md new file mode 100644 index 000000000000..42a2dea3f96b --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md @@ -0,0 +1,18 @@ +# openapi.model.SpecialCat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md new file mode 100644 index 000000000000..b63c7fd6014a --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md @@ -0,0 +1,15 @@ +# openapi.model.SpecialCatAllOf + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart index e624212cc80d..a90754c104d0 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart @@ -80,6 +80,8 @@ part 'model/outer_object_with_enum_property.dart'; part 'model/pet.dart'; part 'model/read_only_first.dart'; part 'model/single_ref_type.dart'; +part 'model/special_cat.dart'; +part 'model/special_cat_all_of.dart'; part 'model/special_model_name.dart'; part 'model/tag.dart'; part 'model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart index 22839ae04f0b..49c3d52e4064 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart @@ -271,6 +271,10 @@ class ApiClient { return ReadOnlyFirst.fromJson(value); case 'SingleRefType': return SingleRefTypeTypeTransformer().decode(value); + case 'SpecialCat': + return SpecialCat.fromJson(value); + case 'SpecialCatAllOf': + return SpecialCatAllOf.fromJson(value); case 'SpecialModelName': return SpecialModelName.fromJson(value); case 'Tag': diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart new file mode 100644 index 000000000000..f096c289670b --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart @@ -0,0 +1,226 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SpecialCat { + /// Returns a new [SpecialCat] instance. + SpecialCat({ + required this.className, + this.color = 'red', + this.declawed, + this.kind, + }); + + String className; + + String color; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? declawed; + + SpecialCatKindEnum? kind; + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialCat && + other.className == className && + other.color == color && + other.declawed == declawed && + other.kind == kind; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (className.hashCode) + + (color.hashCode) + + (declawed == null ? 0 : declawed!.hashCode) + + (kind == null ? 0 : kind!.hashCode); + + @override + String toString() => 'SpecialCat[className=$className, color=$color, declawed=$declawed, kind=$kind]'; + + Map toJson() { + final json = {}; + json[r'className'] = this.className; + json[r'color'] = this.color; + if (this.declawed != null) { + json[r'declawed'] = this.declawed; + } else { + json[r'declawed'] = null; + } + if (this.kind != null) { + json[r'kind'] = this.kind; + } else { + json[r'kind'] = null; + } + return json; + } + + /// Returns a new [SpecialCat] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SpecialCat? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "SpecialCat[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SpecialCat[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SpecialCat( + className: mapValueOfType(json, r'className')!, + color: mapValueOfType(json, r'color') ?? 'red', + declawed: mapValueOfType(json, r'declawed'), + kind: SpecialCatKindEnum.fromJson(json[r'kind']), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SpecialCat.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SpecialCat.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SpecialCat-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SpecialCat.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'className', + }; +} + + +class SpecialCatKindEnum { + /// Instantiate a new enum with the provided [value]. + const SpecialCatKindEnum._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const lions = SpecialCatKindEnum._(r'lions'); + static const tigers = SpecialCatKindEnum._(r'tigers'); + static const leopards = SpecialCatKindEnum._(r'leopards'); + static const jaguars = SpecialCatKindEnum._(r'jaguars'); + + /// List of all possible values in this [enum][SpecialCatKindEnum]. + static const values = [ + lions, + tigers, + leopards, + jaguars, + ]; + + static SpecialCatKindEnum? fromJson(dynamic value) => SpecialCatKindEnumTypeTransformer().decode(value); + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SpecialCatKindEnum.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [SpecialCatKindEnum] to String, +/// and [decode] dynamic data back to [SpecialCatKindEnum]. +class SpecialCatKindEnumTypeTransformer { + factory SpecialCatKindEnumTypeTransformer() => _instance ??= const SpecialCatKindEnumTypeTransformer._(); + + const SpecialCatKindEnumTypeTransformer._(); + + String encode(SpecialCatKindEnum data) => data.value; + + /// Decodes a [dynamic value][data] to a SpecialCatKindEnum. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + SpecialCatKindEnum? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case r'lions': return SpecialCatKindEnum.lions; + case r'tigers': return SpecialCatKindEnum.tigers; + case r'leopards': return SpecialCatKindEnum.leopards; + case r'jaguars': return SpecialCatKindEnum.jaguars; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [SpecialCatKindEnumTypeTransformer] instance. + static SpecialCatKindEnumTypeTransformer? _instance; +} + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart new file mode 100644 index 000000000000..c0ad675e2dbe --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart @@ -0,0 +1,194 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SpecialCatAllOf { + /// Returns a new [SpecialCatAllOf] instance. + SpecialCatAllOf({ + this.kind, + }); + + SpecialCatAllOfKindEnum? kind; + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialCatAllOf && + other.kind == kind; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (kind == null ? 0 : kind!.hashCode); + + @override + String toString() => 'SpecialCatAllOf[kind=$kind]'; + + Map toJson() { + final json = {}; + if (this.kind != null) { + json[r'kind'] = this.kind; + } else { + json[r'kind'] = null; + } + return json; + } + + /// Returns a new [SpecialCatAllOf] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SpecialCatAllOf? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "SpecialCatAllOf[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SpecialCatAllOf[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SpecialCatAllOf( + kind: SpecialCatAllOfKindEnum.fromJson(json[r'kind']), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SpecialCatAllOf.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SpecialCatAllOf.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SpecialCatAllOf-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SpecialCatAllOf.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + + +class SpecialCatAllOfKindEnum { + /// Instantiate a new enum with the provided [value]. + const SpecialCatAllOfKindEnum._(this.value); + + /// The underlying value of this enum member. + final String value; + + @override + String toString() => value; + + String toJson() => value; + + static const lions = SpecialCatAllOfKindEnum._(r'lions'); + static const tigers = SpecialCatAllOfKindEnum._(r'tigers'); + static const leopards = SpecialCatAllOfKindEnum._(r'leopards'); + static const jaguars = SpecialCatAllOfKindEnum._(r'jaguars'); + + /// List of all possible values in this [enum][SpecialCatAllOfKindEnum]. + static const values = [ + lions, + tigers, + leopards, + jaguars, + ]; + + static SpecialCatAllOfKindEnum? fromJson(dynamic value) => SpecialCatAllOfKindEnumTypeTransformer().decode(value); + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SpecialCatAllOfKindEnum.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [SpecialCatAllOfKindEnum] to String, +/// and [decode] dynamic data back to [SpecialCatAllOfKindEnum]. +class SpecialCatAllOfKindEnumTypeTransformer { + factory SpecialCatAllOfKindEnumTypeTransformer() => _instance ??= const SpecialCatAllOfKindEnumTypeTransformer._(); + + const SpecialCatAllOfKindEnumTypeTransformer._(); + + String encode(SpecialCatAllOfKindEnum data) => data.value; + + /// Decodes a [dynamic value][data] to a SpecialCatAllOfKindEnum. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + SpecialCatAllOfKindEnum? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case r'lions': return SpecialCatAllOfKindEnum.lions; + case r'tigers': return SpecialCatAllOfKindEnum.tigers; + case r'leopards': return SpecialCatAllOfKindEnum.leopards; + case r'jaguars': return SpecialCatAllOfKindEnum.jaguars; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [SpecialCatAllOfKindEnumTypeTransformer] instance. + static SpecialCatAllOfKindEnumTypeTransformer? _instance; +} + + diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart new file mode 100644 index 000000000000..2ca8cef1b58d --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SpecialCatAllOf +void main() { + // final instance = SpecialCatAllOf(); + + group('test SpecialCatAllOf', () { + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart new file mode 100644 index 000000000000..160c16eb26e0 --- /dev/null +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for SpecialCat +void main() { + // final instance = SpecialCat(); + + group('test SpecialCat', () { + // String className + test('to test the property `className`', () async { + // TODO + }); + + // String color (default value: 'red') + test('to test the property `color`', () async { + // TODO + }); + + // bool declawed + test('to test the property `declawed`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES index c362f355b01b..1f8317f8ef82 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES @@ -52,6 +52,8 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -116,6 +118,8 @@ petstore_api/models/outer_object_with_enum_property.py petstore_api/models/pet.py petstore_api/models/read_only_first.py petstore_api/models/single_ref_type.py +petstore_api/models/special_cat.py +petstore_api/models/special_cat_all_of.py petstore_api/models/special_model_name.py petstore_api/models/tag.py petstore_api/models/user.py diff --git a/samples/openapi3/client/petstore/python-legacy/README.md b/samples/openapi3/client/petstore/python-legacy/README.md index bee1d84445ef..feeae38004cf 100755 --- a/samples/openapi3/client/petstore/python-legacy/README.md +++ b/samples/openapi3/client/petstore/python-legacy/README.md @@ -171,6 +171,8 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) + - [SpecialCat](docs/SpecialCat.md) + - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md b/samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md new file mode 100644 index 000000000000..202b38f6c4b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md @@ -0,0 +1,11 @@ +# SpecialCat + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md b/samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..ad4913f6708e --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md @@ -0,0 +1,11 @@ +# SpecialCatAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py index 68ec54c6b79a..3942680c70af 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py @@ -80,6 +80,8 @@ from petstore_api.models.pet import Pet from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.single_ref_type import SingleRefType +from petstore_api.models.special_cat import SpecialCat +from petstore_api.models.special_cat_all_of import SpecialCatAllOf from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.tag import Tag from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py index 2b4432c9e36a..79fdeb5978ff 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py @@ -59,6 +59,8 @@ from petstore_api.models.pet import Pet from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.single_ref_type import SingleRefType +from petstore_api.models.special_cat import SpecialCat +from petstore_api.models.special_cat_all_of import SpecialCatAllOf from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.tag import Tag from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py index d4a49534078d..04a10d5f700e 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py @@ -47,7 +47,8 @@ class Animal(object): discriminator_value_class_map = { 'Cat': 'Cat', - 'Dog': 'Dog' + 'Dog': 'Dog', + 'Special-Cat': 'SpecialCat' } def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py new file mode 100644 index 000000000000..83f8537424db --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from petstore_api.configuration import Configuration + + +class SpecialCat(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'kind': 'str' + } + + attribute_map = { + 'kind': 'kind' + } + + def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 + """SpecialCat - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._kind = None + self.discriminator = None + + if kind is not None: + self.kind = kind + + @property + def kind(self): + """Gets the kind of this SpecialCat. # noqa: E501 + + + :return: The kind of this SpecialCat. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this SpecialCat. + + + :param kind: The kind of this SpecialCat. # noqa: E501 + :type kind: str + """ + allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 + .format(kind, allowed_values) + ) + + self._kind = kind + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpecialCat): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpecialCat): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py new file mode 100644 index 000000000000..be592e9b1566 --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from petstore_api.configuration import Configuration + + +class SpecialCatAllOf(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'kind': 'str' + } + + attribute_map = { + 'kind': 'kind' + } + + def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 + """SpecialCatAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._kind = None + self.discriminator = None + + if kind is not None: + self.kind = kind + + @property + def kind(self): + """Gets the kind of this SpecialCatAllOf. # noqa: E501 + + + :return: The kind of this SpecialCatAllOf. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this SpecialCatAllOf. + + + :param kind: The kind of this SpecialCatAllOf. # noqa: E501 + :type kind: str + """ + allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 + .format(kind, allowed_values) + ) + + self._kind = kind + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpecialCatAllOf): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpecialCatAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py b/samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py new file mode 100644 index 000000000000..ba21e10630fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.special_cat import SpecialCat # noqa: E501 +from petstore_api.rest import ApiException + +class TestSpecialCat(unittest.TestCase): + """SpecialCat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialCat(self): + """Test SpecialCat""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py new file mode 100644 index 000000000000..10e079016d52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import petstore_api +from petstore_api.models.special_cat_all_of import SpecialCatAllOf # noqa: E501 +from petstore_api.rest import ApiException + +class TestSpecialCatAllOf(unittest.TestCase): + """SpecialCatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test SpecialCatAllOf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.special_cat_all_of.SpecialCatAllOf() # noqa: E501 + if include_optional : + return SpecialCatAllOf( + kind = 'lions' + ) + else : + return SpecialCatAllOf( + ) + + def testSpecialCatAllOf(self): + """Test SpecialCatAllOf""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/schema/petstore/mysql/.openapi-generator/FILES b/samples/schema/petstore/mysql/.openapi-generator/FILES index 84ef3294ab0f..690ad833d234 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/FILES +++ b/samples/schema/petstore/mysql/.openapi-generator/FILES @@ -43,6 +43,8 @@ Model/Pet.sql Model/ReadOnlyFirst.sql Model/Return.sql Model/SingleRefType.sql +Model/SpecialCat.sql +Model/SpecialCatAllOf.sql Model/SpecialModelName.sql Model/Tag.sql Model/User.sql diff --git a/samples/schema/petstore/mysql/Model/SpecialCat.sql b/samples/schema/petstore/mysql/Model/SpecialCat.sql new file mode 100644 index 000000000000..eeed339468a7 --- /dev/null +++ b/samples/schema/petstore/mysql/Model/SpecialCat.sql @@ -0,0 +1,26 @@ +-- +-- OpenAPI Petstore. +-- Prepared SQL queries for 'Special-Cat' definition. +-- + + +-- +-- SELECT template for table `Special-Cat` +-- +SELECT `className`, `color`, `declawed`, `kind` FROM `Special-Cat` WHERE 1; + +-- +-- INSERT template for table `Special-Cat` +-- +INSERT INTO `Special-Cat`(`className`, `color`, `declawed`, `kind`) VALUES (?, ?, ?, ?); + +-- +-- UPDATE template for table `Special-Cat` +-- +UPDATE `Special-Cat` SET `className` = ?, `color` = ?, `declawed` = ?, `kind` = ? WHERE 1; + +-- +-- DELETE template for table `Special-Cat` +-- +DELETE FROM `Special-Cat` WHERE 0; + diff --git a/samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql b/samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql new file mode 100644 index 000000000000..7f2e6d37f8ac --- /dev/null +++ b/samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql @@ -0,0 +1,26 @@ +-- +-- OpenAPI Petstore. +-- Prepared SQL queries for 'Special_Cat_allOf' definition. +-- + + +-- +-- SELECT template for table `Special_Cat_allOf` +-- +SELECT `kind` FROM `Special_Cat_allOf` WHERE 1; + +-- +-- INSERT template for table `Special_Cat_allOf` +-- +INSERT INTO `Special_Cat_allOf`(`kind`) VALUES (?); + +-- +-- UPDATE template for table `Special_Cat_allOf` +-- +UPDATE `Special_Cat_allOf` SET `kind` = ? WHERE 1; + +-- +-- DELETE template for table `Special_Cat_allOf` +-- +DELETE FROM `Special_Cat_allOf` WHERE 0; + diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index d22077b8d129..fba1265ebaf1 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -401,6 +401,25 @@ CREATE TABLE IF NOT EXISTS `Return` ( `return` INT DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Model for testing reserved words'; +-- +-- Table structure for table `Special-Cat` generated from model 'SpecialMinusCat' +-- + +CREATE TABLE IF NOT EXISTS `Special-Cat` ( + `className` TEXT NOT NULL, + `color` TEXT, + `declawed` TINYINT(1) DEFAULT NULL, + `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `Special_Cat_allOf` generated from model 'SpecialUnderscoreCatUnderscoreallOf' +-- + +CREATE TABLE IF NOT EXISTS `Special_Cat_allOf` ( + `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `_special_model.name_` generated from model 'UnderscorespecialUnderscoremodelPeriodnameUnderscore' -- diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES b/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES index ab1dc1a7a752..9477844b02da 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES +++ b/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES @@ -103,6 +103,10 @@ model/Return.cpp model/Return.h model/SingleRefType.cpp model/SingleRefType.h +model/Special_Cat.cpp +model/Special_Cat.h +model/Special_Cat_allOf.cpp +model/Special_Cat_allOf.h model/Tag.cpp model/Tag.h model/User.cpp diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp new file mode 100644 index 000000000000..ff878acb8934 --- /dev/null +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp @@ -0,0 +1,153 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "Special_Cat.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "helpers.h" + +using boost::property_tree::ptree; +using boost::property_tree::read_json; +using boost::property_tree::write_json; + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +Special_Cat::Special_Cat(boost::property_tree::ptree const& pt) +{ + fromPropertyTree(pt); +} + + +std::string Special_Cat::toJsonString(bool prettyJson /* = false */) const +{ + std::stringstream ss; + write_json(ss, this->toPropertyTree(), prettyJson); + // workaround inspired by: https://stackoverflow.com/a/56395440 + std::regex reg("\\\"([0-9]+\\.{0,1}[0-9]*)\\\""); + std::string result = std::regex_replace(ss.str(), reg, "$1"); + return result; +} + +void Special_Cat::fromJsonString(std::string const& jsonString) +{ + std::stringstream ss(jsonString); + ptree pt; + read_json(ss,pt); + this->fromPropertyTree(pt); +} + +ptree Special_Cat::toPropertyTree() const +{ + ptree pt; + ptree tmp_node; + pt.put("className", m_ClassName); + pt.put("color", m_Color); + pt.put("declawed", m_Declawed); + pt.put("kind", m_Kind); + return pt; +} + +void Special_Cat::fromPropertyTree(ptree const &pt) +{ + ptree tmp_node; + m_ClassName = pt.get("className", ""); + m_Color = pt.get("color", "red"); + m_Declawed = pt.get("declawed", false); + setKind(pt.get("kind", "")); +} + +std::string Special_Cat::getClassName() const +{ + return m_ClassName; +} + +void Special_Cat::setClassName(std::string value) +{ + m_ClassName = value; +} + + +std::string Special_Cat::getColor() const +{ + return m_Color; +} + +void Special_Cat::setColor(std::string value) +{ + m_Color = value; +} + + +bool Special_Cat::isDeclawed() const +{ + return m_Declawed; +} + +void Special_Cat::setDeclawed(bool value) +{ + m_Declawed = value; +} + + +std::string Special_Cat::getKind() const +{ + return m_Kind; +} + +void Special_Cat::setKind(std::string value) +{ + static const std::array allowedValues = { + "lions", "tigers", "leopards", "jaguars" + }; + + if (std::find(allowedValues.begin(), allowedValues.end(), value) != allowedValues.end()) { + m_Kind = value; + } else { + throw std::runtime_error("Value " + boost::lexical_cast(value) + " not allowed"); + } +} + + + +std::vector createSpecial_CatVectorFromJsonString(const std::string& json) +{ + std::stringstream sstream(json); + boost::property_tree::ptree pt; + boost::property_tree::json_parser::read_json(sstream,pt); + + auto vec = std::vector(); + for (const auto& child: pt) { + vec.emplace_back(Special_Cat(child.second)); + } + + return vec; +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h new file mode 100644 index 000000000000..9734629ebc1d --- /dev/null +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h @@ -0,0 +1,114 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Special_Cat.h + * + * + */ + +#ifndef Special_Cat_H_ +#define Special_Cat_H_ + + + +#include "Cat.h" +#include +#include +#include +#include +#include +#include "Cat.h" +#include "Special_Cat_allOf.h" +#include "helpers.h" + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +/// +/// +/// +class Special_Cat : public Cat, public Special_Cat_allOf +{ +public: + Special_Cat() = default; + explicit Special_Cat(boost::property_tree::ptree const& pt); + virtual ~Special_Cat() = default; + + Special_Cat(const Special_Cat& other) = default; // copy constructor + Special_Cat(Special_Cat&& other) noexcept = default; // move constructor + + Special_Cat& operator=(const Special_Cat& other) = default; // copy assignment + Special_Cat& operator=(Special_Cat&& other) noexcept = default; // move assignment + + std::string toJsonString(bool prettyJson = false) const; + void fromJsonString(std::string const& jsonString); + boost::property_tree::ptree toPropertyTree() const; + void fromPropertyTree(boost::property_tree::ptree const& pt); + + + ///////////////////////////////////////////// + /// Special_Cat members + + /// + /// + /// + std::string getClassName() const; + void setClassName(std::string value); + + /// + /// + /// + std::string getColor() const; + void setColor(std::string value); + + /// + /// + /// + bool isDeclawed() const; + void setDeclawed(bool value); + + /// + /// + /// + std::string getKind() const; + void setKind(std::string value); + +protected: + std::string m_ClassName = ""; + std::string m_Color = "red"; + bool m_Declawed = false; + std::string m_Kind = ""; +}; + +std::vector createSpecial_CatVectorFromJsonString(const std::string& json); + +template<> +inline boost::property_tree::ptree toPt(const Special_Cat& val) { + return val.toPropertyTree(); +} + +template<> +inline Special_Cat fromPt(const boost::property_tree::ptree& pt) { + Special_Cat ret; + ret.fromPropertyTree(pt); + return ret; +} + +} +} +} +} + +#endif /* Special_Cat_H_ */ diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp new file mode 100644 index 000000000000..bb1c7a42a958 --- /dev/null +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp @@ -0,0 +1,114 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "Special_Cat_allOf.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "helpers.h" + +using boost::property_tree::ptree; +using boost::property_tree::read_json; +using boost::property_tree::write_json; + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +Special_Cat_allOf::Special_Cat_allOf(boost::property_tree::ptree const& pt) +{ + fromPropertyTree(pt); +} + + +std::string Special_Cat_allOf::toJsonString(bool prettyJson /* = false */) const +{ + std::stringstream ss; + write_json(ss, this->toPropertyTree(), prettyJson); + // workaround inspired by: https://stackoverflow.com/a/56395440 + std::regex reg("\\\"([0-9]+\\.{0,1}[0-9]*)\\\""); + std::string result = std::regex_replace(ss.str(), reg, "$1"); + return result; +} + +void Special_Cat_allOf::fromJsonString(std::string const& jsonString) +{ + std::stringstream ss(jsonString); + ptree pt; + read_json(ss,pt); + this->fromPropertyTree(pt); +} + +ptree Special_Cat_allOf::toPropertyTree() const +{ + ptree pt; + ptree tmp_node; + pt.put("kind", m_Kind); + return pt; +} + +void Special_Cat_allOf::fromPropertyTree(ptree const &pt) +{ + ptree tmp_node; + setKind(pt.get("kind", "")); +} + +std::string Special_Cat_allOf::getKind() const +{ + return m_Kind; +} + +void Special_Cat_allOf::setKind(std::string value) +{ + static const std::array allowedValues = { + "lions", "tigers", "leopards", "jaguars" + }; + + if (std::find(allowedValues.begin(), allowedValues.end(), value) != allowedValues.end()) { + m_Kind = value; + } else { + throw std::runtime_error("Value " + boost::lexical_cast(value) + " not allowed"); + } +} + + + +std::vector createSpecial_Cat_allOfVectorFromJsonString(const std::string& json) +{ + std::stringstream sstream(json); + boost::property_tree::ptree pt; + boost::property_tree::json_parser::read_json(sstream,pt); + + auto vec = std::vector(); + for (const auto& child: pt) { + vec.emplace_back(Special_Cat_allOf(child.second)); + } + + return vec; +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h new file mode 100644 index 000000000000..dd9c9a8b1ffa --- /dev/null +++ b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h @@ -0,0 +1,90 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Special_Cat_allOf.h + * + * + */ + +#ifndef Special_Cat_allOf_H_ +#define Special_Cat_allOf_H_ + + + +#include +#include +#include +#include +#include +#include "helpers.h" + +namespace org { +namespace openapitools { +namespace server { +namespace model { + +/// +/// +/// +class Special_Cat_allOf +{ +public: + Special_Cat_allOf() = default; + explicit Special_Cat_allOf(boost::property_tree::ptree const& pt); + virtual ~Special_Cat_allOf() = default; + + Special_Cat_allOf(const Special_Cat_allOf& other) = default; // copy constructor + Special_Cat_allOf(Special_Cat_allOf&& other) noexcept = default; // move constructor + + Special_Cat_allOf& operator=(const Special_Cat_allOf& other) = default; // copy assignment + Special_Cat_allOf& operator=(Special_Cat_allOf&& other) noexcept = default; // move assignment + + std::string toJsonString(bool prettyJson = false) const; + void fromJsonString(std::string const& jsonString); + boost::property_tree::ptree toPropertyTree() const; + void fromPropertyTree(boost::property_tree::ptree const& pt); + + + ///////////////////////////////////////////// + /// Special_Cat_allOf members + + /// + /// + /// + std::string getKind() const; + void setKind(std::string value); + +protected: + std::string m_Kind = ""; +}; + +std::vector createSpecial_Cat_allOfVectorFromJsonString(const std::string& json); + +template<> +inline boost::property_tree::ptree toPt(const Special_Cat_allOf& val) { + return val.toPropertyTree(); +} + +template<> +inline Special_Cat_allOf fromPt(const boost::property_tree::ptree& pt) { + Special_Cat_allOf ret; + ret.fromPropertyTree(pt); + return ret; +} + +} +} +} +} + +#endif /* Special_Cat_allOf_H_ */ diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES index 9fdbc1aebe2c..25a20158699d 100644 --- a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES @@ -62,6 +62,8 @@ src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/server/model/Pet.java src/main/java/org/openapitools/server/model/ReadOnlyFirst.java src/main/java/org/openapitools/server/model/SingleRefType.java +src/main/java/org/openapitools/server/model/SpecialCat.java +src/main/java/org/openapitools/server/model/SpecialCatAllOf.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java index da9c02ed0c39..0cd3f029a7d4 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Cat; import org.openapitools.server.model.Dog; +import org.openapitools.server.model.SpecialCat; import jakarta.validation.constraints.*; import jakarta.validation.Valid; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java index 78534303e0ff..e742daf6765b 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; +import org.openapitools.server.model.SpecialCat; import jakarta.validation.constraints.*; import jakarta.validation.Valid; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java new file mode 100644 index 000000000000..7a42d59ad41c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java @@ -0,0 +1,127 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.Cat; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class SpecialCat extends Cat { + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static KindEnum fromString(String s) { + for (KindEnum b : KindEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private KindEnum kind; + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + /** + * Set kind + **/ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public SpecialCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..b5819113c3bb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java @@ -0,0 +1,123 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class SpecialCatAllOf { + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static KindEnum fromString(String s) { + for (KindEnum b : KindEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private KindEnum kind; + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + /** + * Set kind + **/ + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public SpecialCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml index 6667e32d34cb..536a7cadf78f 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -1505,6 +1505,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2140,6 +2144,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..6980c1bf5d6b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java new file mode 100644 index 000000000000..8d2829c0247c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.Cat; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES index 93bbc6b3b013..300a5134d43e 100644 --- a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES @@ -63,6 +63,8 @@ src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/server/model/Pet.java src/main/java/org/openapitools/server/model/ReadOnlyFirst.java src/main/java/org/openapitools/server/model/SingleRefType.java +src/main/java/org/openapitools/server/model/SpecialCat.java +src/main/java/org/openapitools/server/model/SpecialCatAllOf.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java index 72fd34477f82..b2ed9adc471b 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Cat; import org.openapitools.server.model.Dog; +import org.openapitools.server.model.SpecialCat; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java index 663f2a85183a..a6eaae636b93 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; +import org.openapitools.server.model.SpecialCat; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java new file mode 100644 index 000000000000..6d50414bd48a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java @@ -0,0 +1,112 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.Cat; + + + +public class SpecialCat extends Cat { + + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + TIGERS("tigers"), + LEOPARDS("leopards"), + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private KindEnum kind; + + /** + * Default constructor. + */ + public SpecialCat() { + // JSON-B / Jackson + } + + /** + * Create SpecialCat. + * + * @param kind kind + */ + public SpecialCat( + KindEnum kind + ) { + this.kind = kind; + } + + + + /** + * Get kind + * @return kind + */ + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..fc16dc538c9b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java @@ -0,0 +1,108 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class SpecialCatAllOf { + + + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + TIGERS("tigers"), + LEOPARDS("leopards"), + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private KindEnum kind; + + /** + * Default constructor. + */ + public SpecialCatAllOf() { + // JSON-B / Jackson + } + + /** + * Create SpecialCatAllOf. + * + * @param kind kind + */ + public SpecialCatAllOf( + KindEnum kind + ) { + this.kind = kind; + } + + + + /** + * Get kind + * @return kind + */ + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml index 6667e32d34cb..536a7cadf78f 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -1505,6 +1505,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2140,6 +2144,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..6980c1bf5d6b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java new file mode 100644 index 000000000000..8d2829c0247c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.Cat; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES index 463e9366b2c2..199ffbd9c490 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES @@ -66,6 +66,8 @@ src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java src/gen/java/org/openapitools/model/Pet.java src/gen/java/org/openapitools/model/ReadOnlyFirst.java src/gen/java/org/openapitools/model/SingleRefType.java +src/gen/java/org/openapitools/model/SpecialCat.java +src/gen/java/org/openapitools/model/SpecialCatAllOf.java src/gen/java/org/openapitools/model/SpecialModelName.java src/gen/java/org/openapitools/model/Tag.java src/gen/java/org/openapitools/model/User.java diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java index a5eae51787ce..a0eaa1f43555 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java new file mode 100644 index 000000000000..4ca258e22490 --- /dev/null +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java @@ -0,0 +1,135 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public SpecialCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty(value = "kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..6f87f6763607 --- /dev/null +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public SpecialCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty(value = "kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/php-laravel/.openapi-generator/FILES b/samples/server/petstore/php-laravel/.openapi-generator/FILES index eb2e7313fb42..9becd67ee3a0 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/FILES +++ b/samples/server/petstore/php-laravel/.openapi-generator/FILES @@ -67,6 +67,8 @@ lib/app/Models/OuterObjectWithEnumProperty.php lib/app/Models/Pet.php lib/app/Models/ReadOnlyFirst.php lib/app/Models/SingleRefType.php +lib/app/Models/SpecialCat.php +lib/app/Models/SpecialCatAllOf.php lib/app/Models/SpecialModelName.php lib/app/Models/Tag.php lib/app/Models/User.php diff --git a/samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php b/samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php new file mode 100644 index 000000000000..6522248c97be --- /dev/null +++ b/samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php @@ -0,0 +1,24 @@ + Date: Mon, 6 Mar 2023 14:04:33 +1000 Subject: [PATCH 3/4] Revert "Add sample scenario and test for jackson serialization and deserialization" This reverts commit 509bc370b88168b4bbc383d45d669fd31416ab62. --- ...ith-fake-endpoints-models-for-testing.yaml | 8 - .../OpenAPIClient/.openapi-generator/FILES | 4 - .../petstore/csharp/OpenAPIClient/README.md | 2 - .../csharp/OpenAPIClient/docs/SpecialCat.md | 14 - .../OpenAPIClient/docs/SpecialCatAllOf.md | 13 - .../Model/SpecialCatAllOfTests.cs | 79 ---- .../Model/SpecialCatTests.cs | 79 ---- .../src/Org.OpenAPITools/Model/Animal.cs | 1 - .../src/Org.OpenAPITools/Model/Cat.cs | 10 - .../src/Org.OpenAPITools/Model/SpecialCat.cs | 163 ------- .../Org.OpenAPITools/Model/SpecialCatAllOf.cs | 156 ------ .../petstore/elixir/.openapi-generator/FILES | 2 - .../lib/openapi_petstore/model/special_cat.ex | 30 -- .../model/special_cat_all_of.ex | 24 - .../mp/.openapi-generator/FILES | 4 - .../java-helidon-client/mp/docs/SpecialCat.md | 24 - .../mp/docs/SpecialCatAllOf.md | 24 - .../org/openapitools/client/model/Animal.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/SpecialCat.java | 98 ---- .../client/model/SpecialCatAllOf.java | 94 ---- .../client/model/SpecialCatAllOfTest.java | 47 -- .../client/model/SpecialCatTest.java | 75 --- .../se/.openapi-generator/FILES | 4 - .../java-helidon-client/se/docs/SpecialCat.md | 24 - .../se/docs/SpecialCatAllOf.md | 24 - .../org/openapitools/client/model/Animal.java | 1 - .../org/openapitools/client/model/Cat.java | 1 - .../openapitools/client/model/SpecialCat.java | 98 ---- .../client/model/SpecialCatAllOf.java | 94 ---- .../client/model/SpecialCatAllOfTest.java | 47 -- .../client/model/SpecialCatTest.java | 75 --- .../.openapi-generator/FILES | 4 - .../petstore/java/apache-httpclient/README.md | 2 - .../java/apache-httpclient/api/openapi.yaml | 15 - .../java/apache-httpclient/docs/SpecialCat.md | 24 - .../apache-httpclient/docs/SpecialCatAllOf.md | 24 - .../org/openapitools/client/model/Animal.java | 2 - .../org/openapitools/client/model/Cat.java | 4 - .../openapitools/client/model/SpecialCat.java | 234 --------- .../client/model/SpecialCatAllOf.java | 191 -------- .../client/model/SpecialCatAllOfTest.java | 48 -- .../client/model/SpecialCatJacksonTest.java | 35 -- .../client/model/SpecialCatTest.java | 76 --- .../java/feign/.openapi-generator/FILES | 2 - .../petstore/java/feign/api/openapi.yaml | 15 - .../org/openapitools/client/model/Animal.java | 2 - .../org/openapitools/client/model/Cat.java | 4 - .../openapitools/client/model/SpecialCat.java | 156 ------ .../client/model/SpecialCatAllOf.java | 143 ------ .../client/model/SpecialCatAllOfTest.java | 46 -- .../client/model/SpecialCatTest.java | 74 --- .../.openapi-generator/FILES | 4 - .../petstore/java/webclient-jakarta/README.md | 2 - .../java/webclient-jakarta/api/openapi.yaml | 15 - .../java/webclient-jakarta/docs/SpecialCat.md | 24 - .../webclient-jakarta/docs/SpecialCatAllOf.md | 24 - .../org/openapitools/client/model/Animal.java | 2 - .../org/openapitools/client/model/Cat.java | 4 - .../openapitools/client/model/SpecialCat.java | 156 ------ .../client/model/SpecialCatAllOf.java | 143 ------ .../client/model/SpecialCatAllOfTest.java | 48 -- .../client/model/SpecialCatTest.java | 76 --- .../java/webclient/.openapi-generator/FILES | 4 - .../client/petstore/java/webclient/README.md | 2 - .../petstore/java/webclient/api/openapi.yaml | 15 - .../java/webclient/docs/SpecialCat.md | 24 - .../java/webclient/docs/SpecialCatAllOf.md | 24 - .../org/openapitools/client/model/Animal.java | 2 - .../org/openapitools/client/model/Cat.java | 4 - .../openapitools/client/model/SpecialCat.java | 156 ------ .../client/model/SpecialCatAllOf.java | 143 ------ .../client/model/SpecialCatAllOfTest.java | 48 -- .../client/model/SpecialCatTest.java | 76 --- .../petstore/perl/.openapi-generator/FILES | 4 - samples/client/petstore/perl/README.md | 6 - .../client/petstore/perl/docs/SpecialCat.md | 15 - .../petstore/perl/docs/SpecialCatAllOf.md | 15 - .../WWW/OpenAPIClient/Object/SpecialCat.pm | 255 ---------- .../OpenAPIClient/Object/SpecialCatAllOf.pm | 242 ---------- .../petstore/perl/t/SpecialCatAllOfTest.t | 34 -- .../client/petstore/perl/t/SpecialCatTest.t | 34 -- .../.openapi-generator/FILES | 4 - .../petstore/php/OpenAPIClient-php/README.md | 2 - .../docs/Model/SpecialCat.md | 9 - .../docs/Model/SpecialCatAllOf.md | 9 - .../lib/Model/SpecialCat.php | 441 ----------------- .../lib/Model/SpecialCatAllOf.php | 447 ------------------ .../test/Model/SpecialCatAllOfTest.php | 90 ---- .../test/Model/SpecialCatTest.php | 90 ---- .../ruby-autoload/.openapi-generator/FILES | 4 - .../client/petstore/ruby-autoload/README.md | 2 - .../petstore/ruby-autoload/docs/SpecialCat.md | 18 - .../ruby-autoload/docs/SpecialCatAllOf.md | 18 - .../petstore/ruby-autoload/lib/petstore.rb | 2 - .../lib/petstore/models/special_cat.rb | 265 ----------- .../lib/petstore/models/special_cat_all_of.rb | 253 ---------- .../spec/models/special_cat_all_of_spec.rb | 38 -- .../spec/models/special_cat_spec.rb | 38 -- .../ruby-faraday/.openapi-generator/FILES | 4 - .../client/petstore/ruby-faraday/README.md | 2 - .../petstore/ruby-faraday/docs/SpecialCat.md | 18 - .../ruby-faraday/docs/SpecialCatAllOf.md | 18 - .../petstore/ruby-faraday/lib/petstore.rb | 2 - .../lib/petstore/models/special_cat.rb | 265 ----------- .../lib/petstore/models/special_cat_all_of.rb | 253 ---------- .../spec/models/special_cat_all_of_spec.rb | 38 -- .../spec/models/special_cat_spec.rb | 38 -- .../petstore/ruby/.openapi-generator/FILES | 4 - samples/client/petstore/ruby/README.md | 2 - .../client/petstore/ruby/docs/SpecialCat.md | 18 - .../petstore/ruby/docs/SpecialCatAllOf.md | 18 - samples/client/petstore/ruby/lib/petstore.rb | 2 - .../ruby/lib/petstore/models/special_cat.rb | 265 ----------- .../lib/petstore/models/special_cat_all_of.rb | 253 ---------- .../spec/models/special_cat_all_of_spec.rb | 38 -- .../ruby/spec/models/special_cat_spec.rb | 38 -- .../default-v3.0/.openapi-generator/FILES | 2 - .../builds/default-v3.0/models/Animal.ts | 6 +- .../builds/default-v3.0/models/SpecialCat.ts | 85 ---- .../default-v3.0/models/SpecialCatAllOf.ts | 78 --- .../builds/default-v3.0/models/index.ts | 2 - .../.openapi-generator/FILES | 4 - .../README.md | 2 - .../doc/SpecialCat.md | 18 - .../doc/SpecialCatAllOf.md | 15 - .../lib/openapi.dart | 2 - .../lib/src/deserialize.dart | 6 - .../lib/src/model/special_cat.dart | 120 ----- .../lib/src/model/special_cat_all_of.dart | 69 --- .../test/special_cat_all_of_test.dart | 16 - .../test/special_cat_test.dart | 31 -- .../.openapi-generator/FILES | 4 - .../petstore_client_lib_fake/README.md | 2 - .../doc/SpecialCat.md | 18 - .../doc/SpecialCatAllOf.md | 15 - .../petstore_client_lib_fake/lib/openapi.dart | 2 - .../lib/src/model/animal.dart | 13 - .../lib/src/model/cat.dart | 89 +--- .../lib/src/model/special_cat.dart | 173 ------- .../lib/src/model/special_cat_all_of.dart | 164 ------- .../lib/src/serializers.dart | 8 +- .../test/special_cat_all_of_test.dart | 16 - .../test/special_cat_test.dart | 31 -- .../.openapi-generator/FILES | 4 - .../dart2/petstore_client_lib_fake/README.md | 2 - .../doc/SpecialCat.md | 18 - .../doc/SpecialCatAllOf.md | 15 - .../petstore_client_lib_fake/lib/api.dart | 2 - .../lib/api_client.dart | 4 - .../lib/model/special_cat.dart | 226 --------- .../lib/model/special_cat_all_of.dart | 194 -------- .../test/special_cat_all_of_test.dart | 27 -- .../test/special_cat_test.dart | 42 -- .../python-legacy/.openapi-generator/FILES | 4 - .../client/petstore/python-legacy/README.md | 2 - .../petstore/python-legacy/docs/SpecialCat.md | 11 - .../python-legacy/docs/SpecialCatAllOf.md | 11 - .../python-legacy/petstore_api/__init__.py | 2 - .../petstore_api/models/__init__.py | 2 - .../petstore_api/models/animal.py | 3 +- .../petstore_api/models/special_cat.py | 137 ------ .../petstore_api/models/special_cat_all_of.py | 137 ------ .../python-legacy/test/test_special_cat.py | 37 -- .../test/test_special_cat_all_of.py | 51 -- .../petstore/mysql/.openapi-generator/FILES | 2 - .../petstore/mysql/Model/SpecialCat.sql | 26 - .../petstore/mysql/Model/SpecialCatAllOf.sql | 26 - .../schema/petstore/mysql/mysql_schema.sql | 19 - .../generated/3_0/.openapi-generator/FILES | 4 - .../generated/3_0/model/Special_Cat.cpp | 153 ------ .../generated/3_0/model/Special_Cat.h | 114 ----- .../generated/3_0/model/Special_Cat_allOf.cpp | 114 ----- .../generated/3_0/model/Special_Cat_allOf.h | 90 ---- .../mp/.openapi-generator/FILES | 2 - .../org/openapitools/server/model/Animal.java | 1 - .../org/openapitools/server/model/Cat.java | 1 - .../openapitools/server/model/SpecialCat.java | 127 ----- .../server/model/SpecialCatAllOf.java | 123 ----- .../src/main/resources/META-INF/openapi.yml | 15 - .../server/model/SpecialCatAllOfTest.java | 43 -- .../server/model/SpecialCatTest.java | 71 --- .../se/.openapi-generator/FILES | 2 - .../org/openapitools/server/model/Animal.java | 1 - .../org/openapitools/server/model/Cat.java | 1 - .../openapitools/server/model/SpecialCat.java | 112 ----- .../server/model/SpecialCatAllOf.java | 108 ----- .../src/main/resources/META-INF/openapi.yml | 15 - .../server/model/SpecialCatAllOfTest.java | 43 -- .../server/model/SpecialCatTest.java | 71 --- .../jaxrs-jersey/.openapi-generator/FILES | 2 - .../java/org/openapitools/model/Animal.java | 1 - .../org/openapitools/model/SpecialCat.java | 135 ------ .../openapitools/model/SpecialCatAllOf.java | 133 ------ .../php-laravel/.openapi-generator/FILES | 2 - .../php-laravel/lib/app/Models/SpecialCat.php | 24 - .../lib/app/Models/SpecialCatAllOf.php | 15 - 197 files changed, 14 insertions(+), 10533 deletions(-) delete mode 100644 samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md delete mode 100644 samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs delete mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs delete mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs delete mode 100644 samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs delete mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex delete mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex delete mode 100644 samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md delete mode 100644 samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java delete mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java delete mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java delete mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java delete mode 100644 samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md delete mode 100644 samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java delete mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java delete mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java delete mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java delete mode 100644 samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md delete mode 100644 samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java delete mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java delete mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java delete mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java delete mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java delete mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java delete mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java delete mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java delete mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java delete mode 100644 samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md delete mode 100644 samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java delete mode 100644 samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java delete mode 100644 samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java delete mode 100644 samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java delete mode 100644 samples/client/petstore/java/webclient/docs/SpecialCat.md delete mode 100644 samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java delete mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java delete mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java delete mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java delete mode 100644 samples/client/petstore/perl/docs/SpecialCat.md delete mode 100644 samples/client/petstore/perl/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm delete mode 100644 samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm delete mode 100644 samples/client/petstore/perl/t/SpecialCatAllOfTest.t delete mode 100644 samples/client/petstore/perl/t/SpecialCatTest.t delete mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md delete mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php delete mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php delete mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php delete mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php delete mode 100644 samples/client/petstore/ruby-autoload/docs/SpecialCat.md delete mode 100644 samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb delete mode 100644 samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb delete mode 100644 samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb delete mode 100644 samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/docs/SpecialCat.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb delete mode 100644 samples/client/petstore/ruby/docs/SpecialCat.md delete mode 100644 samples/client/petstore/ruby/docs/SpecialCatAllOf.md delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/special_cat.rb delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb delete mode 100644 samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb delete mode 100644 samples/client/petstore/ruby/spec/models/special_cat_spec.rb delete mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart delete mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md delete mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart delete mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py delete mode 100644 samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py delete mode 100644 samples/schema/petstore/mysql/Model/SpecialCat.sql delete mode 100644 samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql delete mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp delete mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h delete mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp delete mode 100644 samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h delete mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java delete mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java delete mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java delete mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java delete mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java delete mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java delete mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java delete mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java delete mode 100644 samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java delete mode 100644 samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java delete mode 100644 samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php delete mode 100644 samples/server/petstore/php-laravel/lib/app/Models/SpecialCatAllOf.php diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 782399c3bae5..6ec5b66e0e65 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1480,14 +1480,6 @@ components: properties: declawed: type: boolean - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - type: object - properties: - kind: - type: string - enum: [lions, tigers, leopards, jaguars] Animal: type: object discriminator: diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES index c5cd18f81627..f55c7b183ce7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES @@ -54,8 +54,6 @@ docs/PetApi.md docs/ReadOnlyFirst.md docs/Return.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -125,8 +123,6 @@ src/Org.OpenAPITools/Model/Pet.cs src/Org.OpenAPITools/Model/ReadOnlyFirst.cs src/Org.OpenAPITools/Model/Return.cs src/Org.OpenAPITools/Model/SingleRefType.cs -src/Org.OpenAPITools/Model/SpecialCat.cs -src/Org.OpenAPITools/Model/SpecialCatAllOf.cs src/Org.OpenAPITools/Model/SpecialModelName.cs src/Org.OpenAPITools/Model/Tag.cs src/Org.OpenAPITools/Model/User.cs diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index fec153d5e228..f7defb79030c 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -195,8 +195,6 @@ Class | Method | HTTP request | Description - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SingleRefType](docs/SingleRefType.md) - - [Model.SpecialCat](docs/SpecialCat.md) - - [Model.SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md deleted file mode 100644 index 4c6e2432ac5f..000000000000 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCat.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Org.OpenAPITools.Model.SpecialCat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Declawed** | **bool** | | [optional] -**Kind** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md deleted file mode 100644 index bbe07b624f25..000000000000 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Org.OpenAPITools.Model.SpecialCatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Kind** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs deleted file mode 100644 index 0588cb603d07..000000000000 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatAllOfTests.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Test -{ - /// - /// Class for testing SpecialCatAllOf - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class SpecialCatAllOfTests - { - // TODO uncomment below to declare an instance variable for SpecialCatAllOf - //private SpecialCatAllOf instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of SpecialCatAllOf - //instance = new SpecialCatAllOf(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of SpecialCatAllOf - /// - [Test] - public void SpecialCatAllOfInstanceTest() - { - // TODO uncomment below to test "IsInstanceOf" SpecialCatAllOf - //Assert.IsInstanceOf(typeof(SpecialCatAllOf), instance); - } - - - /// - /// Test the property 'Kind' - /// - [Test] - public void KindTest() - { - // TODO unit test for the property 'Kind' - } - - } - -} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs deleted file mode 100644 index 53cc1b9a968c..000000000000 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialCatTests.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Test -{ - /// - /// Class for testing SpecialCat - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class SpecialCatTests - { - // TODO uncomment below to declare an instance variable for SpecialCat - //private SpecialCat instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of SpecialCat - //instance = new SpecialCat(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of SpecialCat - /// - [Test] - public void SpecialCatInstanceTest() - { - // TODO uncomment below to test "IsInstanceOf" SpecialCat - //Assert.IsInstanceOf(typeof(SpecialCat), instance); - } - - - /// - /// Test the property 'Kind' - /// - [Test] - public void KindTest() - { - // TODO unit test for the property 'Kind' - } - - } - -} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index bf6cdd0abed9..d06c695fa6ab 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -32,7 +32,6 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "className")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] - [JsonSubtypes.KnownSubType(typeof(SpecialCat), "Special-Cat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index e9926951dc6e..3110e4e5fe01 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -122,16 +122,6 @@ public override int GetHashCode() /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach(var x in base.BaseValidate(validationContext)) yield return x; yield break; diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs deleted file mode 100644 index 466db02bccb5..000000000000 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCat.cs +++ /dev/null @@ -1,163 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; - -namespace Org.OpenAPITools.Model -{ - /// - /// SpecialCat - /// - [DataContract] - public partial class SpecialCat : Cat, IEquatable, IValidatableObject - { - /// - /// Defines Kind - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum KindEnum - { - /// - /// Enum Lions for value: lions - /// - [EnumMember(Value = "lions")] - Lions = 1, - - /// - /// Enum Tigers for value: tigers - /// - [EnumMember(Value = "tigers")] - Tigers = 2, - - /// - /// Enum Leopards for value: leopards - /// - [EnumMember(Value = "leopards")] - Leopards = 3, - - /// - /// Enum Jaguars for value: jaguars - /// - [EnumMember(Value = "jaguars")] - Jaguars = 4 - - } - - /// - /// Gets or Sets Kind - /// - [DataMember(Name="kind", EmitDefaultValue=false)] - public KindEnum? Kind { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - protected SpecialCat() { } - /// - /// Initializes a new instance of the class. - /// - /// kind. - public SpecialCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) - { - this.Kind = kind; - } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SpecialCat {\n"); - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); - sb.Append(" Kind: ").Append(Kind).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public override string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as SpecialCat); - } - - /// - /// Returns true if SpecialCat instances are equal - /// - /// Instance of SpecialCat to be compared - /// Boolean - public bool Equals(SpecialCat input) - { - if (input == null) - return false; - - return base.Equals(input) && - ( - this.Kind == input.Kind || - (this.Kind != null && - this.Kind.Equals(input.Kind)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = base.GetHashCode(); - if (this.Kind != null) - hashCode = hashCode * 59 + this.Kind.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - foreach(var x in base.BaseValidate(validationContext)) yield return x; - yield break; - } - } - -} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs deleted file mode 100644 index 63d999a11029..000000000000 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialCatAllOf.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; - -namespace Org.OpenAPITools.Model -{ - /// - /// SpecialCatAllOf - /// - [DataContract] - public partial class SpecialCatAllOf : IEquatable, IValidatableObject - { - /// - /// Defines Kind - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum KindEnum - { - /// - /// Enum Lions for value: lions - /// - [EnumMember(Value = "lions")] - Lions = 1, - - /// - /// Enum Tigers for value: tigers - /// - [EnumMember(Value = "tigers")] - Tigers = 2, - - /// - /// Enum Leopards for value: leopards - /// - [EnumMember(Value = "leopards")] - Leopards = 3, - - /// - /// Enum Jaguars for value: jaguars - /// - [EnumMember(Value = "jaguars")] - Jaguars = 4 - - } - - /// - /// Gets or Sets Kind - /// - [DataMember(Name="kind", EmitDefaultValue=false)] - public KindEnum? Kind { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// kind. - public SpecialCatAllOf(KindEnum? kind = default(KindEnum?)) - { - this.Kind = kind; - } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class SpecialCatAllOf {\n"); - sb.Append(" Kind: ").Append(Kind).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as SpecialCatAllOf); - } - - /// - /// Returns true if SpecialCatAllOf instances are equal - /// - /// Instance of SpecialCatAllOf to be compared - /// Boolean - public bool Equals(SpecialCatAllOf input) - { - if (input == null) - return false; - - return - ( - this.Kind == input.Kind || - (this.Kind != null && - this.Kind.Equals(input.Kind)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Kind != null) - hashCode = hashCode * 59 + this.Kind.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/samples/client/petstore/elixir/.openapi-generator/FILES b/samples/client/petstore/elixir/.openapi-generator/FILES index 036e88c7bee6..d3fc35881099 100644 --- a/samples/client/petstore/elixir/.openapi-generator/FILES +++ b/samples/client/petstore/elixir/.openapi-generator/FILES @@ -58,8 +58,6 @@ lib/openapi_petstore/model/pet.ex lib/openapi_petstore/model/read_only_first.ex lib/openapi_petstore/model/return.ex lib/openapi_petstore/model/single_ref_type.ex -lib/openapi_petstore/model/special_cat.ex -lib/openapi_petstore/model/special_cat_all_of.ex lib/openapi_petstore/model/tag.ex lib/openapi_petstore/model/user.ex lib/openapi_petstore/request_builder.ex diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex deleted file mode 100644 index c63aaadb8c17..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat.ex +++ /dev/null @@ -1,30 +0,0 @@ -# NOTE: This file is auto generated by OpenAPI Generator 6.5.0-SNAPSHOT (https://openapi-generator.tech). -# Do not edit this file manually. - -defmodule OpenapiPetstore.Model.SpecialCat do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :className, - :color, - :declawed, - :kind - ] - - @type t :: %__MODULE__{ - :className => String.t, - :color => String.t | nil, - :declawed => boolean() | nil, - :kind => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.SpecialCat do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex deleted file mode 100644 index 2ae145f9cfaf..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_cat_all_of.ex +++ /dev/null @@ -1,24 +0,0 @@ -# NOTE: This file is auto generated by OpenAPI Generator 6.5.0-SNAPSHOT (https://openapi-generator.tech). -# Do not edit this file manually. - -defmodule OpenapiPetstore.Model.SpecialCatAllOf do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :kind - ] - - @type t :: %__MODULE__{ - :kind => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.SpecialCatAllOf do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES index caa93daccd2e..1b046cca4abd 100644 --- a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES @@ -49,8 +49,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -113,8 +111,6 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java -src/main/java/org/openapitools/client/model/SpecialCat.java -src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md b/samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md deleted file mode 100644 index 1e1781c92cd7..000000000000 --- a/samples/client/petstore/java-helidon-client/mp/docs/SpecialCat.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCat - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md b/samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md deleted file mode 100644 index 60aeeb4fdc4f..000000000000 --- a/samples/client/petstore/java-helidon-client/mp/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCatAllOf - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java index 956366a31574..36ecf9c54f65 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java index 9d42a1c1a79d..be9c69545616 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java deleted file mode 100644 index b2c8943fc397..000000000000 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCat.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; - - - - -public class SpecialCat extends Cat { - -public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - -} - - private KindEnum kind; - - /** - * Get kind - * @return kind - **/ - public KindEnum getKind() { - return kind; - } - - /** - * Set kind - **/ - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public SpecialCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java deleted file mode 100644 index 9b13f629228d..000000000000 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; - - - - -public class SpecialCatAllOf { - -public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - -} - - private KindEnum kind; - - /** - * Get kind - * @return kind - **/ - public KindEnum getKind() { - return kind; - } - - /** - * Set kind - **/ - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public SpecialCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java deleted file mode 100644 index 9a86505a4451..000000000000 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java deleted file mode 100644 index 27c2b55fef48..000000000000 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialCatTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES index 40a8340cc2a5..16af74d61d2a 100644 --- a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES @@ -49,8 +49,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -122,8 +120,6 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java -src/main/java/org/openapitools/client/model/SpecialCat.java -src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md b/samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md deleted file mode 100644 index 1e1781c92cd7..000000000000 --- a/samples/client/petstore/java-helidon-client/se/docs/SpecialCat.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCat - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md b/samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md deleted file mode 100644 index 60aeeb4fdc4f..000000000000 --- a/samples/client/petstore/java-helidon-client/se/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCatAllOf - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java index 956366a31574..36ecf9c54f65 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java index 9d42a1c1a79d..be9c69545616 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.SpecialCat; diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java deleted file mode 100644 index b2c8943fc397..000000000000 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCat.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; - - - - -public class SpecialCat extends Cat { - -public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - -} - - private KindEnum kind; - - /** - * Get kind - * @return kind - **/ - public KindEnum getKind() { - return kind; - } - - /** - * Set kind - **/ - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public SpecialCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java deleted file mode 100644 index 9b13f629228d..000000000000 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; - - - - -public class SpecialCatAllOf { - -public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - -} - - private KindEnum kind; - - /** - * Get kind - * @return kind - **/ - public KindEnum getKind() { - return kind; - } - - /** - * Set kind - **/ - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public SpecialCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java deleted file mode 100644 index 9a86505a4451..000000000000 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java deleted file mode 100644 index 27c2b55fef48..000000000000 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialCatTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES index c49bbdffa3c1..46568169f68b 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/FILES @@ -55,8 +55,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -138,8 +136,6 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java -src/main/java/org/openapitools/client/model/SpecialCat.java -src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/apache-httpclient/README.md b/samples/client/petstore/java/apache-httpclient/README.md index c34e26b2003b..45ace68ceee4 100644 --- a/samples/client/petstore/java/apache-httpclient/README.md +++ b/samples/client/petstore/java/apache-httpclient/README.md @@ -196,8 +196,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) - - [SpecialCat](docs/SpecialCat.md) - - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index dab05f6ac452..2828944e5542 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -1505,10 +1505,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2144,17 +2140,6 @@ components: type: boolean type: object example: null - Special_Cat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md b/samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md deleted file mode 100644 index 1e1781c92cd7..000000000000 --- a/samples/client/petstore/java/apache-httpclient/docs/SpecialCat.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCat - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md b/samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md deleted file mode 100644 index 60aeeb4fdc4f..000000000000 --- a/samples/client/petstore/java/apache-httpclient/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCatAllOf - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java index a47b43df4743..1d37baf0f8c4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.UnsupportedEncodingException; @@ -48,7 +47,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java index 07eea3f8dcd7..b3ab6517bc0e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import java.io.UnsupportedEncodingException; @@ -43,9 +42,6 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), -}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java deleted file mode 100644 index 2c1f3d58f63e..000000000000 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCat.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.StringJoiner; - -/** - * SpecialCat - */ -@JsonPropertyOrder({ - SpecialCat.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - -public class SpecialCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCat() { - - } - - public SpecialCat kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCat specialCat = (SpecialCat) o; - return Objects.equals(this.kind, specialCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `className` to the URL query string - if (getClassName() != null) { - try { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), "UTF-8").replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `color` to the URL query string - if (getColor() != null) { - try { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), "UTF-8").replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `declawed` to the URL query string - if (getDeclawed() != null) { - try { - joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), "UTF-8").replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - // add `kind` to the URL query string - if (getKind() != null) { - try { - joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), "UTF-8").replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - return joiner.toString(); - } - -} - diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java deleted file mode 100644 index 04e9df8cac72..000000000000 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.StringJoiner; - -/** - * SpecialCatAllOf - */ -@JsonPropertyOrder({ - SpecialCatAllOf.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SpecialCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCatAllOf() { - } - - public SpecialCatAllOf kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; - return Objects.equals(this.kind, specialCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `kind` to the URL query string - if (getKind() != null) { - try { - joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), "UTF-8").replaceAll("\\+", "%20"))); - } catch (UnsupportedEncodingException e) { - // Should never happen, UTF-8 is always supported - throw new RuntimeException(e); - } - } - - return joiner.toString(); - } - -} - diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java deleted file mode 100644 index 947c778e233f..000000000000 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java deleted file mode 100644 index 4154350c3dca..000000000000 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.model; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Test; - -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -public class SpecialCatJacksonTest { - - private final ObjectMapper objectMapper = new ObjectMapper(); - - @Test - public void shouldSerializeAndDeserializeModel() throws JsonProcessingException { - String color = "yellow-gold"; - Animal model = new SpecialCat().kind(SpecialCat.KindEnum.LIONS).declawed(false).color(color); - - String json = objectMapper.writeValueAsString(model); - - assertThat(json, containsString("\"className\":\"Special-Cat\"")); - - Animal result = objectMapper.readValue(json, Animal.class); - - assertThat(result, instanceOf(SpecialCat.class)); - - SpecialCat specialCat = (SpecialCat) result; - assertThat(specialCat.getColor(), is(color)); - assertThat(specialCat.getDeclawed(), is(false)); - assertThat(specialCat.getKind(), is(SpecialCat.KindEnum.LIONS)); - } - -} \ No newline at end of file diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java deleted file mode 100644 index 8252e2d02f8a..000000000000 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES index 7e6d9a770aa2..1e8d11e21e95 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -84,8 +84,6 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java -src/main/java/org/openapitools/client/model/SpecialCat.java -src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index dab05f6ac452..2828944e5542 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1505,10 +1505,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2144,17 +2140,6 @@ components: type: boolean type: object example: null - Special_Cat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index f974fa6fd171..31932c6e6815 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -45,7 +44,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 3ead0c5620ec..98b53f1e4fd5 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -40,9 +39,6 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), -}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java deleted file mode 100644 index ac08ab645c40..000000000000 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCat.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * SpecialCat - */ -@JsonPropertyOrder({ - SpecialCat.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - -public class SpecialCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCat() { - - } - - public SpecialCat kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCat specialCat = (SpecialCat) o; - return Objects.equals(this.kind, specialCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java deleted file mode 100644 index 7197872c0b5e..000000000000 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * SpecialCatAllOf - */ -@JsonPropertyOrder({ - SpecialCatAllOf.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SpecialCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCatAllOf() { - } - - public SpecialCatAllOf kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; - return Objects.equals(this.kind, specialCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java deleted file mode 100644 index 5bf432c8e11c..000000000000 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java deleted file mode 100644 index 75f29e155154..000000000000 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialCatTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCat - */ -class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES b/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES index 8f4bf157bb6c..bc9e24cb1f99 100644 --- a/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient-jakarta/.openapi-generator/FILES @@ -55,8 +55,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -135,8 +133,6 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java -src/main/java/org/openapitools/client/model/SpecialCat.java -src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient-jakarta/README.md b/samples/client/petstore/java/webclient-jakarta/README.md index e986feee76ee..75a5fba59e2d 100644 --- a/samples/client/petstore/java/webclient-jakarta/README.md +++ b/samples/client/petstore/java/webclient-jakarta/README.md @@ -203,8 +203,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) - - [SpecialCat](docs/SpecialCat.md) - - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml index dab05f6ac452..2828944e5542 100644 --- a/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml +++ b/samples/client/petstore/java/webclient-jakarta/api/openapi.yaml @@ -1505,10 +1505,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2144,17 +2140,6 @@ components: type: boolean type: object example: null - Special_Cat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md b/samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md deleted file mode 100644 index 1e1781c92cd7..000000000000 --- a/samples/client/petstore/java/webclient-jakarta/docs/SpecialCat.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCat - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md b/samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md deleted file mode 100644 index 60aeeb4fdc4f..000000000000 --- a/samples/client/petstore/java/webclient-jakarta/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCatAllOf - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java index 7cfd4c54be1b..217f89650372 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -45,7 +44,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java index b2c359b77b68..762c68f3b8b4 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -40,9 +39,6 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), -}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java deleted file mode 100644 index 7ff89083bf8f..000000000000 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCat.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * SpecialCat - */ -@JsonPropertyOrder({ - SpecialCat.JSON_PROPERTY_KIND -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - -public class SpecialCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCat() { - - } - - public SpecialCat kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCat specialCat = (SpecialCat) o; - return Objects.equals(this.kind, specialCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java deleted file mode 100644 index bb50d17fcfa6..000000000000 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * SpecialCatAllOf - */ -@JsonPropertyOrder({ - SpecialCatAllOf.JSON_PROPERTY_KIND -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SpecialCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCatAllOf() { - } - - public SpecialCatAllOf kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; - return Objects.equals(this.kind, specialCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java deleted file mode 100644 index 947c778e233f..000000000000 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java deleted file mode 100644 index 8252e2d02f8a..000000000000 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialCatTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/webclient/.openapi-generator/FILES b/samples/client/petstore/java/webclient/.openapi-generator/FILES index 8f4bf157bb6c..bc9e24cb1f99 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/FILES +++ b/samples/client/petstore/java/webclient/.openapi-generator/FILES @@ -55,8 +55,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -135,8 +133,6 @@ src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java src/main/java/org/openapitools/client/model/SingleRefType.java -src/main/java/org/openapitools/client/model/SpecialCat.java -src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md index e986feee76ee..75a5fba59e2d 100644 --- a/samples/client/petstore/java/webclient/README.md +++ b/samples/client/petstore/java/webclient/README.md @@ -203,8 +203,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) - - [SpecialCat](docs/SpecialCat.md) - - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index dab05f6ac452..2828944e5542 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1505,10 +1505,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2144,17 +2140,6 @@ components: type: boolean type: object example: null - Special_Cat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/webclient/docs/SpecialCat.md b/samples/client/petstore/java/webclient/docs/SpecialCat.md deleted file mode 100644 index 1e1781c92cd7..000000000000 --- a/samples/client/petstore/java/webclient/docs/SpecialCat.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCat - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md b/samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md deleted file mode 100644 index 60aeeb4fdc4f..000000000000 --- a/samples/client/petstore/java/webclient/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ - - -# SpecialCatAllOf - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**kind** | [**KindEnum**](#KindEnum) | | [optional] | - - - -## Enum: KindEnum - -| Name | Value | -|---- | -----| -| LIONS | "lions" | -| TIGERS | "tigers" | -| LEOPARDS | "leopards" | -| JAGUARS | "jaguars" | - - - diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index f974fa6fd171..31932c6e6815 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -45,7 +44,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index 3ba0df2c1e54..e14f5458acbf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -40,9 +39,6 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), -}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java deleted file mode 100644 index ac08ab645c40..000000000000 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCat.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * SpecialCat - */ -@JsonPropertyOrder({ - SpecialCat.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - -public class SpecialCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCat() { - - } - - public SpecialCat kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCat specialCat = (SpecialCat) o; - return Objects.equals(this.kind, specialCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java deleted file mode 100644 index 7197872c0b5e..000000000000 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * SpecialCatAllOf - */ -@JsonPropertyOrder({ - SpecialCatAllOf.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SpecialCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public SpecialCatAllOf() { - } - - public SpecialCatAllOf kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; - return Objects.equals(this.kind, specialCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java deleted file mode 100644 index 947c778e233f..000000000000 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java deleted file mode 100644 index 8252e2d02f8a..000000000000 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialCatTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/perl/.openapi-generator/FILES b/samples/client/petstore/perl/.openapi-generator/FILES index 534718bf55d7..73f05fa4007a 100644 --- a/samples/client/petstore/perl/.openapi-generator/FILES +++ b/samples/client/petstore/perl/.openapi-generator/FILES @@ -52,8 +52,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -112,8 +110,6 @@ lib/WWW/OpenAPIClient/Object/OuterObjectWithEnumProperty.pm lib/WWW/OpenAPIClient/Object/Pet.pm lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm lib/WWW/OpenAPIClient/Object/SingleRefType.pm -lib/WWW/OpenAPIClient/Object/SpecialCat.pm -lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm lib/WWW/OpenAPIClient/Object/SpecialModelName.pm lib/WWW/OpenAPIClient/Object/Tag.pm lib/WWW/OpenAPIClient/Object/User.pm diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 34d2172f016c..17380420a74b 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -287,8 +287,6 @@ use WWW::OpenAPIClient::Object::OuterObjectWithEnumProperty; use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SingleRefType; -use WWW::OpenAPIClient::Object::SpecialCat; -use WWW::OpenAPIClient::Object::SpecialCatAllOf; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; use WWW::OpenAPIClient::Object::User; @@ -357,8 +355,6 @@ use WWW::OpenAPIClient::Object::OuterObjectWithEnumProperty; use WWW::OpenAPIClient::Object::Pet; use WWW::OpenAPIClient::Object::ReadOnlyFirst; use WWW::OpenAPIClient::Object::SingleRefType; -use WWW::OpenAPIClient::Object::SpecialCat; -use WWW::OpenAPIClient::Object::SpecialCatAllOf; use WWW::OpenAPIClient::Object::SpecialModelName; use WWW::OpenAPIClient::Object::Tag; use WWW::OpenAPIClient::Object::User; @@ -477,8 +473,6 @@ Class | Method | HTTP request | Description - [WWW::OpenAPIClient::Object::Pet](docs/Pet.md) - [WWW::OpenAPIClient::Object::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [WWW::OpenAPIClient::Object::SingleRefType](docs/SingleRefType.md) - - [WWW::OpenAPIClient::Object::SpecialCat](docs/SpecialCat.md) - - [WWW::OpenAPIClient::Object::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [WWW::OpenAPIClient::Object::SpecialModelName](docs/SpecialModelName.md) - [WWW::OpenAPIClient::Object::Tag](docs/Tag.md) - [WWW::OpenAPIClient::Object::User](docs/User.md) diff --git a/samples/client/petstore/perl/docs/SpecialCat.md b/samples/client/petstore/perl/docs/SpecialCat.md deleted file mode 100644 index 1b078f0e7395..000000000000 --- a/samples/client/petstore/perl/docs/SpecialCat.md +++ /dev/null @@ -1,15 +0,0 @@ -# WWW::OpenAPIClient::Object::SpecialCat - -## Load the model package -```perl -use WWW::OpenAPIClient::Object::SpecialCat; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/perl/docs/SpecialCatAllOf.md b/samples/client/petstore/perl/docs/SpecialCatAllOf.md deleted file mode 100644 index abd91c13ed0a..000000000000 --- a/samples/client/petstore/perl/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# WWW::OpenAPIClient::Object::SpecialCatAllOf - -## Load the model package -```perl -use WWW::OpenAPIClient::Object::SpecialCatAllOf; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm deleted file mode 100644 index eddba082ca15..000000000000 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCat.pm +++ /dev/null @@ -1,255 +0,0 @@ -=begin comment - -OpenAPI Petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech - -=end comment - -=cut - -# -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# Do not edit the class manually. -# Ref: https://openapi-generator.tech -# -package WWW::OpenAPIClient::Object::SpecialCat; - -require 5.6.0; -use strict; -use warnings; -use utf8; -use JSON qw(decode_json); -use Data::Dumper; -use Module::Runtime qw(use_module); -use Log::Any qw($log); -use Date::Parse; -use DateTime; - -use WWW::OpenAPIClient::Object::Cat; - -use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Cat"); - -# -# -# -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. -# REF: https://openapi-generator.tech -# - -=begin comment - -OpenAPI Petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech - -=end comment - -=cut - -# -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# Do not edit the class manually. -# Ref: https://openapi-generator.tech -# -__PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('openapi_types' => {}); -__PACKAGE__->mk_classdata('method_documentation' => {}); -__PACKAGE__->mk_classdata('class_documentation' => {}); - -# new plain object -sub new { - my ($class, %args) = @_; - - my $self = bless {}, $class; - - $self->init(%args); - - return $self; -} - -# initialize the object -sub init -{ - my ($self, %args) = @_; - - foreach my $attribute (keys %{$self->attribute_map}) { - my $args_key = $self->attribute_map->{$attribute}; - $self->$attribute( $args{ $args_key } ); - } - - # initialize parent object Cat - $self->WWW::OpenAPIClient::Object::Cat::init(%args); -} - -# return perl hash -sub to_hash { - my $self = shift; - my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); - - # call Cat to_hash and then combine hash - $_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Cat::to_hash }; - - return $_hash; -} - -# used by JSON for serialization -sub TO_JSON { - my $self = shift; - my $_data = {}; - foreach my $_key (keys %{$self->attribute_map}) { - if (defined $self->{$_key}) { - my $_json_attribute = $self->attribute_map->{$_key}; - my $_type = $self->openapi_types->{$_key}; - my $_value = $self->{$_key}; - if ($_type =~ /^array\[(.+)\]$/i) { # array - my $_subclass = $1; - $_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ]; - } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash - my $_subclass = $1; - my %_hash = (); - while (my($_key, $_element) = each %{$_value}) { - $_hash{$_key} = $self->_to_json_primitives($_subclass, $_element); - } - $_data->{$_json_attribute} = \%_hash; - } elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) { - $_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value); - } else { - $_data->{$_json_attribute} = $_value; - } - } - } - - # combine parent (Cat) TO_JSON - $_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Cat::TO_JSON }; - - return $_data; -} - -# to_json non-array data -sub _to_json_primitives { - my ($self, $type, $data) = @_; - if ( grep( /^$type$/, ('int', 'double'))) { - # https://metacpan.org/pod/JSON#simple-scalars - # numify it, ensuring it will be dumped as a number - return undef unless defined $data; - return $data + 0; - } elsif ($type eq 'string') { - # https://metacpan.org/pod/JSON#simple-scalars - # stringified - return undef unless defined $data; - return $data . q(); - } elsif ($type eq 'boolean') { - # https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null - return $data ? \1 : \0; - } elsif ($type eq 'DATE') { - return undef unless defined $data; - if (ref($data) eq 'DateTime') { - # https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...) - return $data->ymd; - } - return $data .q(); - } elsif ($type eq 'DATE_TIME') { - return undef unless defined $data; - # the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z - if (ref($data) eq 'DateTime') { - # https://metacpan.org/pod/DateTime#$dt-%3Erfc3339 - return $data->rfc3339; - } - return $data .q(); - } else { # hash (model), In this case, the TO_JSON of the $data object is executed - return $data; - } -} - -# from Perl hashref -sub from_hash { - my ($self, $hash) = @_; - - # loop through attributes and use openapi_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->openapi_types} ) { - my $_json_attribute = $self->attribute_map->{$_key}; - if ($_type =~ /^array\[(.+)\]$/i) { # array - my $_subclass = $1; - my @_array = (); - foreach my $_element (@{$hash->{$_json_attribute}}) { - push @_array, $self->_deserialize($_subclass, $_element); - } - $self->{$_key} = \@_array; - } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash - my $_subclass = $1; - my %_hash = (); - while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { - $_hash{$_key} = $self->_deserialize($_subclass, $_element); - } - $self->{$_key} = \%_hash; - } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime - $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); - } else { - $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); - } - } - - # call parent (Cat) from_hash - $self->WWW::OpenAPIClient::Object::Cat::from_hash($hash); - - return $self; -} - -# deserialize non-array data -sub _deserialize { - my ($self, $type, $data) = @_; - $log->debugf("deserializing %s with %s",Dumper($data), $type); - - if (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) { - return DateTime->from_epoch(epoch => str2time($data)); - } elsif ( grep( /^$type$/, ('int', 'double'))) { - return undef unless defined $data; - return $data + 0; - } elsif ($type eq 'string') { - return undef unless defined $data; - return $data . q(); - } elsif ($type eq 'boolean') { - return !!$data; - } else { # hash(model) - my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; - return $_instance->from_hash($data); - } -} - - -__PACKAGE__->class_documentation({description => '', - class => 'SpecialCat', - required => [], # TODO -} ); - -__PACKAGE__->method_documentation({ - 'kind' => { - datatype => 'string', - base_name => 'kind', - description => '', - format => '', - read_only => '', - }, -}); - -__PACKAGE__->openapi_types( { - 'kind' => 'string' -} ); - -__PACKAGE__->attribute_map( { - 'kind' => 'kind' -} ); - -__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); - - -1; diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm deleted file mode 100644 index 9293307aa73a..000000000000 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialCatAllOf.pm +++ /dev/null @@ -1,242 +0,0 @@ -=begin comment - -OpenAPI Petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech - -=end comment - -=cut - -# -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# Do not edit the class manually. -# Ref: https://openapi-generator.tech -# -package WWW::OpenAPIClient::Object::SpecialCatAllOf; - -require 5.6.0; -use strict; -use warnings; -use utf8; -use JSON qw(decode_json); -use Data::Dumper; -use Module::Runtime qw(use_module); -use Log::Any qw($log); -use Date::Parse; -use DateTime; - - -use base ("Class::Accessor", "Class::Data::Inheritable"); - -# -# -# -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. -# REF: https://openapi-generator.tech -# - -=begin comment - -OpenAPI Petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech - -=end comment - -=cut - -# -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# Do not edit the class manually. -# Ref: https://openapi-generator.tech -# -__PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('openapi_types' => {}); -__PACKAGE__->mk_classdata('method_documentation' => {}); -__PACKAGE__->mk_classdata('class_documentation' => {}); - -# new plain object -sub new { - my ($class, %args) = @_; - - my $self = bless {}, $class; - - $self->init(%args); - - return $self; -} - -# initialize the object -sub init -{ - my ($self, %args) = @_; - - foreach my $attribute (keys %{$self->attribute_map}) { - my $args_key = $self->attribute_map->{$attribute}; - $self->$attribute( $args{ $args_key } ); - } -} - -# return perl hash -sub to_hash { - my $self = shift; - my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); - - return $_hash; -} - -# used by JSON for serialization -sub TO_JSON { - my $self = shift; - my $_data = {}; - foreach my $_key (keys %{$self->attribute_map}) { - if (defined $self->{$_key}) { - my $_json_attribute = $self->attribute_map->{$_key}; - my $_type = $self->openapi_types->{$_key}; - my $_value = $self->{$_key}; - if ($_type =~ /^array\[(.+)\]$/i) { # array - my $_subclass = $1; - $_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ]; - } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash - my $_subclass = $1; - my %_hash = (); - while (my($_key, $_element) = each %{$_value}) { - $_hash{$_key} = $self->_to_json_primitives($_subclass, $_element); - } - $_data->{$_json_attribute} = \%_hash; - } elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) { - $_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value); - } else { - $_data->{$_json_attribute} = $_value; - } - } - } - - return $_data; -} - -# to_json non-array data -sub _to_json_primitives { - my ($self, $type, $data) = @_; - if ( grep( /^$type$/, ('int', 'double'))) { - # https://metacpan.org/pod/JSON#simple-scalars - # numify it, ensuring it will be dumped as a number - return undef unless defined $data; - return $data + 0; - } elsif ($type eq 'string') { - # https://metacpan.org/pod/JSON#simple-scalars - # stringified - return undef unless defined $data; - return $data . q(); - } elsif ($type eq 'boolean') { - # https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null - return $data ? \1 : \0; - } elsif ($type eq 'DATE') { - return undef unless defined $data; - if (ref($data) eq 'DateTime') { - # https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...) - return $data->ymd; - } - return $data .q(); - } elsif ($type eq 'DATE_TIME') { - return undef unless defined $data; - # the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z - if (ref($data) eq 'DateTime') { - # https://metacpan.org/pod/DateTime#$dt-%3Erfc3339 - return $data->rfc3339; - } - return $data .q(); - } else { # hash (model), In this case, the TO_JSON of the $data object is executed - return $data; - } -} - -# from Perl hashref -sub from_hash { - my ($self, $hash) = @_; - - # loop through attributes and use openapi_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->openapi_types} ) { - my $_json_attribute = $self->attribute_map->{$_key}; - if ($_type =~ /^array\[(.+)\]$/i) { # array - my $_subclass = $1; - my @_array = (); - foreach my $_element (@{$hash->{$_json_attribute}}) { - push @_array, $self->_deserialize($_subclass, $_element); - } - $self->{$_key} = \@_array; - } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash - my $_subclass = $1; - my %_hash = (); - while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { - $_hash{$_key} = $self->_deserialize($_subclass, $_element); - } - $self->{$_key} = \%_hash; - } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime - $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); - } else { - $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); - } - } - - return $self; -} - -# deserialize non-array data -sub _deserialize { - my ($self, $type, $data) = @_; - $log->debugf("deserializing %s with %s",Dumper($data), $type); - - if (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) { - return DateTime->from_epoch(epoch => str2time($data)); - } elsif ( grep( /^$type$/, ('int', 'double'))) { - return undef unless defined $data; - return $data + 0; - } elsif ($type eq 'string') { - return undef unless defined $data; - return $data . q(); - } elsif ($type eq 'boolean') { - return !!$data; - } else { # hash(model) - my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; - return $_instance->from_hash($data); - } -} - - -__PACKAGE__->class_documentation({description => '', - class => 'SpecialCatAllOf', - required => [], # TODO -} ); - -__PACKAGE__->method_documentation({ - 'kind' => { - datatype => 'string', - base_name => 'kind', - description => '', - format => '', - read_only => '', - }, -}); - -__PACKAGE__->openapi_types( { - 'kind' => 'string' -} ); - -__PACKAGE__->attribute_map( { - 'kind' => 'kind' -} ); - -__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); - - -1; diff --git a/samples/client/petstore/perl/t/SpecialCatAllOfTest.t b/samples/client/petstore/perl/t/SpecialCatAllOfTest.t deleted file mode 100644 index 23fce0718d3c..000000000000 --- a/samples/client/petstore/perl/t/SpecialCatAllOfTest.t +++ /dev/null @@ -1,34 +0,0 @@ -=begin comment - -OpenAPI Petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech - -=end comment - -=cut - -# -# NOTE: This class is auto generated by the OpenAPI Generator -# Please update the test cases below to test the model. -# Ref: https://openapi-generator.tech -# -use Test::More tests => 2; -use Test::Exception; - -use lib 'lib'; -use strict; -use warnings; - - -use_ok('WWW::OpenAPIClient::Object::SpecialCatAllOf'); - -# uncomment below and update the test -#my $instance = WWW::OpenAPIClient::Object::SpecialCatAllOf->new(); -# -#isa_ok($instance, 'WWW::OpenAPIClient::Object::SpecialCatAllOf'); - diff --git a/samples/client/petstore/perl/t/SpecialCatTest.t b/samples/client/petstore/perl/t/SpecialCatTest.t deleted file mode 100644 index 87878cbad00e..000000000000 --- a/samples/client/petstore/perl/t/SpecialCatTest.t +++ /dev/null @@ -1,34 +0,0 @@ -=begin comment - -OpenAPI Petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech - -=end comment - -=cut - -# -# NOTE: This class is auto generated by the OpenAPI Generator -# Please update the test cases below to test the model. -# Ref: https://openapi-generator.tech -# -use Test::More tests => 2; -use Test::Exception; - -use lib 'lib'; -use strict; -use warnings; - - -use_ok('WWW::OpenAPIClient::Object::SpecialCat'); - -# uncomment below and update the test -#my $instance = WWW::OpenAPIClient::Object::SpecialCat->new(); -# -#isa_ok($instance, 'WWW::OpenAPIClient::Object::SpecialCat'); - diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES index 5fa1b282dd9b..da556bb1e431 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -55,8 +55,6 @@ docs/Model/OuterObjectWithEnumProperty.md docs/Model/Pet.md docs/Model/ReadOnlyFirst.md docs/Model/SingleRefType.md -docs/Model/SpecialCat.md -docs/Model/SpecialCatAllOf.md docs/Model/SpecialModelName.md docs/Model/Tag.md docs/Model/User.md @@ -117,8 +115,6 @@ lib/Model/OuterObjectWithEnumProperty.php lib/Model/Pet.php lib/Model/ReadOnlyFirst.php lib/Model/SingleRefType.php -lib/Model/SpecialCat.php -lib/Model/SpecialCatAllOf.php lib/Model/SpecialModelName.php lib/Model/Tag.php lib/Model/User.php diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 1d9fb68381e2..b68c5316fdc3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -161,8 +161,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SingleRefType](docs/Model/SingleRefType.md) -- [SpecialCat](docs/Model/SpecialCat.md) -- [SpecialCatAllOf](docs/Model/SpecialCatAllOf.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md deleted file mode 100644 index 6cf707ecfb6a..000000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCat.md +++ /dev/null @@ -1,9 +0,0 @@ -# # SpecialCat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md deleted file mode 100644 index 820bf5912992..000000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/SpecialCatAllOf.md +++ /dev/null @@ -1,9 +0,0 @@ -# # SpecialCatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php deleted file mode 100644 index f6c1c85067e6..000000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCat.php +++ /dev/null @@ -1,441 +0,0 @@ - - */ -class SpecialCat extends Cat -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Special-Cat'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'kind' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'kind' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'kind' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes + parent::openAPITypes(); - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats + parent::openAPIFormats(); - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables + parent::openAPINullables(); - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'kind' => 'kind' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'kind' => 'setKind' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'kind' => 'getKind' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return parent::attributeMap() + self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return parent::setters() + self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return parent::getters() + self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const KIND_LIONS = 'lions'; - public const KIND_TIGERS = 'tigers'; - public const KIND_LEOPARDS = 'leopards'; - public const KIND_JAGUARS = 'jaguars'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getKindAllowableValues() - { - return [ - self::KIND_LIONS, - self::KIND_TIGERS, - self::KIND_LEOPARDS, - self::KIND_JAGUARS, - ]; - } - - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - parent::__construct($data); - - $this->setIfExists('kind', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = parent::listInvalidProperties(); - - $allowedValues = $this->getKindAllowableValues(); - if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'kind', must be one of '%s'", - $this->container['kind'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets kind - * - * @return string|null - */ - public function getKind() - { - return $this->container['kind']; - } - - /** - * Sets kind - * - * @param string|null $kind kind - * - * @return self - */ - public function setKind($kind) - { - if (is_null($kind)) { - throw new \InvalidArgumentException('non-nullable kind cannot be null'); - } - $allowedValues = $this->getKindAllowableValues(); - if (!in_array($kind, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'kind', must be one of '%s'", - $kind, - implode("', '", $allowedValues) - ) - ); - } - $this->container['kind'] = $kind; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php deleted file mode 100644 index 0ba9315393b9..000000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialCatAllOf.php +++ /dev/null @@ -1,447 +0,0 @@ - - */ -class SpecialCatAllOf implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Special_Cat_allOf'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'kind' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'kind' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'kind' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'kind' => 'kind' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'kind' => 'setKind' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'kind' => 'getKind' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - public const KIND_LIONS = 'lions'; - public const KIND_TIGERS = 'tigers'; - public const KIND_LEOPARDS = 'leopards'; - public const KIND_JAGUARS = 'jaguars'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getKindAllowableValues() - { - return [ - self::KIND_LIONS, - self::KIND_TIGERS, - self::KIND_LEOPARDS, - self::KIND_JAGUARS, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('kind', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getKindAllowableValues(); - if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'kind', must be one of '%s'", - $this->container['kind'], - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets kind - * - * @return string|null - */ - public function getKind() - { - return $this->container['kind']; - } - - /** - * Sets kind - * - * @param string|null $kind kind - * - * @return self - */ - public function setKind($kind) - { - if (is_null($kind)) { - throw new \InvalidArgumentException('non-nullable kind cannot be null'); - } - $allowedValues = $this->getKindAllowableValues(); - if (!in_array($kind, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'kind', must be one of '%s'", - $kind, - implode("', '", $allowedValues) - ) - ); - } - $this->container['kind'] = $kind; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php deleted file mode 100644 index 6acf86b0a45d..000000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatAllOfTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "kind" - */ - public function testPropertyKind() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php deleted file mode 100644 index 890d9fe8f6c6..000000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialCatTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "kind" - */ - public function testPropertyKind() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/samples/client/petstore/ruby-autoload/.openapi-generator/FILES b/samples/client/petstore/ruby-autoload/.openapi-generator/FILES index 1da72d15e9ef..9335129107c6 100644 --- a/samples/client/petstore/ruby-autoload/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-autoload/.openapi-generator/FILES @@ -56,8 +56,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -120,8 +118,6 @@ lib/petstore/models/outer_object_with_enum_property.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb -lib/petstore/models/special_cat.rb -lib/petstore/models/special_cat_all_of.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/user.rb diff --git a/samples/client/petstore/ruby-autoload/README.md b/samples/client/petstore/ruby-autoload/README.md index f16361b3af37..b0f3201a1849 100644 --- a/samples/client/petstore/ruby-autoload/README.md +++ b/samples/client/petstore/ruby-autoload/README.md @@ -165,8 +165,6 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) - - [Petstore::SpecialCat](docs/SpecialCat.md) - - [Petstore::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby-autoload/docs/SpecialCat.md b/samples/client/petstore/ruby-autoload/docs/SpecialCat.md deleted file mode 100644 index 02d7c24617e4..000000000000 --- a/samples/client/petstore/ruby-autoload/docs/SpecialCat.md +++ /dev/null @@ -1,18 +0,0 @@ -# Petstore::SpecialCat - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **kind** | **String** | | [optional] | - -## Example - -```ruby -require 'petstore' - -instance = Petstore::SpecialCat.new( - kind: null -) -``` - diff --git a/samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md b/samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md deleted file mode 100644 index 45a7adfa46c6..000000000000 --- a/samples/client/petstore/ruby-autoload/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Petstore::SpecialCatAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **kind** | **String** | | [optional] | - -## Example - -```ruby -require 'petstore' - -instance = Petstore::SpecialCatAllOf.new( - kind: null -) -``` - diff --git a/samples/client/petstore/ruby-autoload/lib/petstore.rb b/samples/client/petstore/ruby-autoload/lib/petstore.rb index 75c931329850..c23884f2ae09 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore.rb @@ -62,8 +62,6 @@ Petstore.autoload :Pet, 'petstore/models/pet' Petstore.autoload :ReadOnlyFirst, 'petstore/models/read_only_first' Petstore.autoload :SingleRefType, 'petstore/models/single_ref_type' -Petstore.autoload :SpecialCat, 'petstore/models/special_cat' -Petstore.autoload :SpecialCatAllOf, 'petstore/models/special_cat_all_of' Petstore.autoload :SpecialModelName, 'petstore/models/special_model_name' Petstore.autoload :Tag, 'petstore/models/tag' Petstore.autoload :User, 'petstore/models/user' diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb b/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb deleted file mode 100644 index 30f7e87422a4..000000000000 --- a/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'date' -require 'time' - -module Petstore - class SpecialCat < Cat - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) - def self.acceptable_attributes - attribute_map.values.concat(superclass.acceptable_attributes) - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Cat', - :'SpecialCatAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true && super - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Petstore.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb b/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb deleted file mode 100644 index aaa98f36b623..000000000000 --- a/samples/client/petstore/ruby-autoload/lib/petstore/models/special_cat_all_of.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'date' -require 'time' - -module Petstore - class SpecialCatAllOf - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Petstore.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb deleted file mode 100644 index 7dcbe3a078c8..000000000000 --- a/samples/client/petstore/ruby-autoload/spec/models/special_cat_all_of_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialCatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Petstore::SpecialCatAllOf do - let(:instance) { Petstore::SpecialCatAllOf.new } - - describe 'test an instance of SpecialCatAllOf' do - it 'should create an instance of SpecialCatAllOf' do - expect(instance).to be_instance_of(Petstore::SpecialCatAllOf) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb b/samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb deleted file mode 100644 index ddaee4891c36..000000000000 --- a/samples/client/petstore/ruby-autoload/spec/models/special_cat_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialCat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Petstore::SpecialCat do - let(:instance) { Petstore::SpecialCat.new } - - describe 'test an instance of SpecialCat' do - it 'should create an instance of SpecialCat' do - expect(instance).to be_instance_of(Petstore::SpecialCat) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 1da72d15e9ef..9335129107c6 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -56,8 +56,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -120,8 +118,6 @@ lib/petstore/models/outer_object_with_enum_property.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb -lib/petstore/models/special_cat.rb -lib/petstore/models/special_cat_all_of.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/user.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index f16361b3af37..b0f3201a1849 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -165,8 +165,6 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) - - [Petstore::SpecialCat](docs/SpecialCat.md) - - [Petstore::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby-faraday/docs/SpecialCat.md b/samples/client/petstore/ruby-faraday/docs/SpecialCat.md deleted file mode 100644 index 02d7c24617e4..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/SpecialCat.md +++ /dev/null @@ -1,18 +0,0 @@ -# Petstore::SpecialCat - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **kind** | **String** | | [optional] | - -## Example - -```ruby -require 'petstore' - -instance = Petstore::SpecialCat.new( - kind: null -) -``` - diff --git a/samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md b/samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md deleted file mode 100644 index 45a7adfa46c6..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Petstore::SpecialCatAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **kind** | **String** | | [optional] | - -## Example - -```ruby -require 'petstore' - -instance = Petstore::SpecialCatAllOf.new( - kind: null -) -``` - diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 6fe8af469ebb..7f20a8db2f63 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -60,13 +60,11 @@ require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' -require 'petstore/models/special_cat_all_of' require 'petstore/models/special_model_name' require 'petstore/models/tag' require 'petstore/models/user' require 'petstore/models/cat' require 'petstore/models/dog' -require 'petstore/models/special_cat' # APIs require 'petstore/api/another_fake_api' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb deleted file mode 100644 index 30f7e87422a4..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'date' -require 'time' - -module Petstore - class SpecialCat < Cat - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) - def self.acceptable_attributes - attribute_map.values.concat(superclass.acceptable_attributes) - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Cat', - :'SpecialCatAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true && super - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Petstore.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb deleted file mode 100644 index aaa98f36b623..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_cat_all_of.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'date' -require 'time' - -module Petstore - class SpecialCatAllOf - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Petstore.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb deleted file mode 100644 index 7dcbe3a078c8..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/special_cat_all_of_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialCatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Petstore::SpecialCatAllOf do - let(:instance) { Petstore::SpecialCatAllOf.new } - - describe 'test an instance of SpecialCatAllOf' do - it 'should create an instance of SpecialCatAllOf' do - expect(instance).to be_instance_of(Petstore::SpecialCatAllOf) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb deleted file mode 100644 index ddaee4891c36..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/special_cat_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialCat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Petstore::SpecialCat do - let(:instance) { Petstore::SpecialCat.new } - - describe 'test an instance of SpecialCat' do - it 'should create an instance of SpecialCat' do - expect(instance).to be_instance_of(Petstore::SpecialCat) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index 1da72d15e9ef..9335129107c6 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -56,8 +56,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -120,8 +118,6 @@ lib/petstore/models/outer_object_with_enum_property.rb lib/petstore/models/pet.rb lib/petstore/models/read_only_first.rb lib/petstore/models/single_ref_type.rb -lib/petstore/models/special_cat.rb -lib/petstore/models/special_cat_all_of.rb lib/petstore/models/special_model_name.rb lib/petstore/models/tag.rb lib/petstore/models/user.rb diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index f16361b3af37..b0f3201a1849 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -165,8 +165,6 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SingleRefType](docs/SingleRefType.md) - - [Petstore::SpecialCat](docs/SpecialCat.md) - - [Petstore::SpecialCatAllOf](docs/SpecialCatAllOf.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) diff --git a/samples/client/petstore/ruby/docs/SpecialCat.md b/samples/client/petstore/ruby/docs/SpecialCat.md deleted file mode 100644 index 02d7c24617e4..000000000000 --- a/samples/client/petstore/ruby/docs/SpecialCat.md +++ /dev/null @@ -1,18 +0,0 @@ -# Petstore::SpecialCat - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **kind** | **String** | | [optional] | - -## Example - -```ruby -require 'petstore' - -instance = Petstore::SpecialCat.new( - kind: null -) -``` - diff --git a/samples/client/petstore/ruby/docs/SpecialCatAllOf.md b/samples/client/petstore/ruby/docs/SpecialCatAllOf.md deleted file mode 100644 index 45a7adfa46c6..000000000000 --- a/samples/client/petstore/ruby/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Petstore::SpecialCatAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **kind** | **String** | | [optional] | - -## Example - -```ruby -require 'petstore' - -instance = Petstore::SpecialCatAllOf.new( - kind: null -) -``` - diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 6fe8af469ebb..7f20a8db2f63 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -60,13 +60,11 @@ require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/single_ref_type' -require 'petstore/models/special_cat_all_of' require 'petstore/models/special_model_name' require 'petstore/models/tag' require 'petstore/models/user' require 'petstore/models/cat' require 'petstore/models/dog' -require 'petstore/models/special_cat' # APIs require 'petstore/api/another_fake_api' diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_cat.rb b/samples/client/petstore/ruby/lib/petstore/models/special_cat.rb deleted file mode 100644 index 30f7e87422a4..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/special_cat.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'date' -require 'time' - -module Petstore - class SpecialCat < Cat - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) - def self.acceptable_attributes - attribute_map.values.concat(superclass.acceptable_attributes) - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Cat', - :'SpecialCatAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCat` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - # call parent's initialize - super(attributes) - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = super - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true && super - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind && super(o) - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - super(attributes) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Petstore.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = super - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb deleted file mode 100644 index aaa98f36b623..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/special_cat_all_of.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'date' -require 'time' - -module Petstore - class SpecialCatAllOf - attr_accessor :kind - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'kind' => :'kind' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'kind' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialCatAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'kind') - self.kind = attributes[:'kind'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - return false unless kind_validator.valid?(@kind) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] kind Object to be assigned - def kind=(kind) - validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - unless validator.valid?(kind) - fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." - end - @kind = kind - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - kind == o.kind - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [kind].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Petstore.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb deleted file mode 100644 index 7dcbe3a078c8..000000000000 --- a/samples/client/petstore/ruby/spec/models/special_cat_all_of_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialCatAllOf -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Petstore::SpecialCatAllOf do - let(:instance) { Petstore::SpecialCatAllOf.new } - - describe 'test an instance of SpecialCatAllOf' do - it 'should create an instance of SpecialCatAllOf' do - expect(instance).to be_instance_of(Petstore::SpecialCatAllOf) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/special_cat_spec.rb b/samples/client/petstore/ruby/spec/models/special_cat_spec.rb deleted file mode 100644 index ddaee4891c36..000000000000 --- a/samples/client/petstore/ruby/spec/models/special_cat_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.5.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::SpecialCat -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe Petstore::SpecialCat do - let(:instance) { Petstore::SpecialCat.new } - - describe 'test an instance of SpecialCat' do - it 'should create an instance of SpecialCat' do - expect(instance).to be_instance_of(Petstore::SpecialCat) - end - end - describe 'test attribute "kind"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) - # validator.allowable_values.each do |value| - # expect { instance.kind = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES index f1a2aaa4c914..3c0152db6cba 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/FILES @@ -52,8 +52,6 @@ models/Pet.ts models/ReadOnlyFirst.ts models/Return.ts models/SingleRefType.ts -models/SpecialCat.ts -models/SpecialCatAllOf.ts models/SpecialModelName.ts models/Tag.ts models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts index b3e3ac9b3614..7c611d3f08e9 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts @@ -15,8 +15,7 @@ import { exists, mapValues } from '../runtime'; import { CatFromJSONTyped, - DogFromJSONTyped, - SpecialCatFromJSONTyped + DogFromJSONTyped } from './'; /** @@ -64,9 +63,6 @@ export function AnimalFromJSONTyped(json: any, ignoreDiscriminator: boolean): An if (json['className'] === 'Dog') { return DogFromJSONTyped(json, true); } - if (json['className'] === 'Special-Cat') { - return SpecialCatFromJSONTyped(json, true); - } } return { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts deleted file mode 100644 index cece3293fa4f..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCat.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -import type { Cat } from './Cat'; -import { - CatFromJSON, - CatFromJSONTyped, - CatToJSON, -} from './Cat'; - -/** - * - * @export - * @interface SpecialCat - */ -export interface SpecialCat extends Cat { - /** - * - * @type {string} - * @memberof SpecialCat - */ - kind?: SpecialCatKindEnum; -} - - -/** - * @export - */ -export const SpecialCatKindEnum = { - Lions: 'lions', - Tigers: 'tigers', - Leopards: 'leopards', - Jaguars: 'jaguars' -} as const; -export type SpecialCatKindEnum = typeof SpecialCatKindEnum[keyof typeof SpecialCatKindEnum]; - - -/** - * Check if a given object implements the SpecialCat interface. - */ -export function instanceOfSpecialCat(value: object): boolean { - let isInstance = true; - - return isInstance; -} - -export function SpecialCatFromJSON(json: any): SpecialCat { - return SpecialCatFromJSONTyped(json, false); -} - -export function SpecialCatFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialCat { - if ((json === undefined) || (json === null)) { - return json; - } - return { - ...CatFromJSONTyped(json, ignoreDiscriminator), - 'kind': !exists(json, 'kind') ? undefined : json['kind'], - }; -} - -export function SpecialCatToJSON(value?: SpecialCat | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - ...CatToJSON(value), - 'kind': value.kind, - }; -} - diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts deleted file mode 100644 index dbcf957149a5..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialCatAllOf.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface SpecialCatAllOf - */ -export interface SpecialCatAllOf { - /** - * - * @type {string} - * @memberof SpecialCatAllOf - */ - kind?: SpecialCatAllOfKindEnum; -} - - -/** - * @export - */ -export const SpecialCatAllOfKindEnum = { - Lions: 'lions', - Tigers: 'tigers', - Leopards: 'leopards', - Jaguars: 'jaguars' -} as const; -export type SpecialCatAllOfKindEnum = typeof SpecialCatAllOfKindEnum[keyof typeof SpecialCatAllOfKindEnum]; - - -/** - * Check if a given object implements the SpecialCatAllOf interface. - */ -export function instanceOfSpecialCatAllOf(value: object): boolean { - let isInstance = true; - - return isInstance; -} - -export function SpecialCatAllOfFromJSON(json: any): SpecialCatAllOf { - return SpecialCatAllOfFromJSONTyped(json, false); -} - -export function SpecialCatAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialCatAllOf { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'kind': !exists(json, 'kind') ? undefined : json['kind'], - }; -} - -export function SpecialCatAllOfToJSON(value?: SpecialCatAllOf | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'kind': value.kind, - }; -} - diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts index 79b35cc087e4..7229eeb8e284 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/index.ts @@ -45,8 +45,6 @@ export * from './Pet'; export * from './ReadOnlyFirst'; export * from './Return'; export * from './SingleRefType'; -export * from './SpecialCat'; -export * from './SpecialCatAllOf'; export * from './SpecialModelName'; export * from './Tag'; export * from './User'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES index 3900082065bf..b34094eb0a2f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/.openapi-generator/FILES @@ -52,8 +52,6 @@ doc/Pet.md doc/PetApi.md doc/ReadOnlyFirst.md doc/SingleRefType.md -doc/SpecialCat.md -doc/SpecialCatAllOf.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md @@ -119,8 +117,6 @@ lib/src/model/outer_object_with_enum_property.dart lib/src/model/pet.dart lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart -lib/src/model/special_cat.dart -lib/src/model/special_cat_all_of.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md index b8eeb402a558..152c6163d770 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/README.md @@ -155,8 +155,6 @@ Class | Method | HTTP request | Description - [Pet](doc/Pet.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) - - [SpecialCat](doc/SpecialCat.md) - - [SpecialCatAllOf](doc/SpecialCatAllOf.md) - [SpecialModelName](doc/SpecialModelName.md) - [Tag](doc/Tag.md) - [User](doc/User.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md deleted file mode 100644 index 42a2dea3f96b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCat.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.SpecialCat - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**declawed** | **bool** | | [optional] -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md deleted file mode 100644 index b63c7fd6014a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/doc/SpecialCatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.SpecialCatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart index b7a74e572738..3beabf11dfcd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/openapi.dart @@ -61,8 +61,6 @@ export 'package:openapi/src/model/outer_object_with_enum_property.dart'; export 'package:openapi/src/model/pet.dart'; export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_cat.dart'; -export 'package:openapi/src/model/special_cat_all_of.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart index b77a4f3b7339..5460a3d223e1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/deserialize.dart @@ -37,8 +37,6 @@ import 'package:openapi/src/model/outer_composite.dart'; import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/read_only_first.dart'; -import 'package:openapi/src/model/special_cat.dart'; -import 'package:openapi/src/model/special_cat_all_of.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; import 'package:openapi/src/model/user.dart'; @@ -157,10 +155,6 @@ final _regMap = RegExp(r'^Map$'); case 'SingleRefType': - case 'SpecialCat': - return SpecialCat.fromJson(value as Map) as ReturnType; - case 'SpecialCatAllOf': - return SpecialCatAllOf.fromJson(value as Map) as ReturnType; case 'SpecialModelName': return SpecialModelName.fromJson(value as Map) as ReturnType; case 'Tag': diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart deleted file mode 100644 index 1f5463dfa289..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat.dart +++ /dev/null @@ -1,120 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:openapi/src/model/cat.dart'; -import 'package:json_annotation/json_annotation.dart'; - -part 'special_cat.g.dart'; - -// ignore_for_file: unused_import - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class SpecialCat { - /// Returns a new [SpecialCat] instance. - SpecialCat({ - - required this.className, - - this.color = 'red', - - this.declawed, - - this.kind, - }); - - @JsonKey( - - name: r'className', - required: true, - includeIfNull: false - ) - - - final String className; - - - - @JsonKey( - defaultValue: 'red', - name: r'color', - required: false, - includeIfNull: false - ) - - - final String? color; - - - - @JsonKey( - - name: r'declawed', - required: false, - includeIfNull: false - ) - - - final bool? declawed; - - - - @JsonKey( - - name: r'kind', - required: false, - includeIfNull: false - ) - - - final SpecialCatKindEnum? kind; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialCat && - other.className == className && - other.color == color && - other.declawed == declawed && - other.kind == kind; - - @override - int get hashCode => - className.hashCode + - color.hashCode + - declawed.hashCode + - kind.hashCode; - - factory SpecialCat.fromJson(Map json) => _$SpecialCatFromJson(json); - - Map toJson() => _$SpecialCatToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - - -enum SpecialCatKindEnum { - @JsonValue(r'lions') - lions, - @JsonValue(r'tigers') - tigers, - @JsonValue(r'leopards') - leopards, - @JsonValue(r'jaguars') - jaguars, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart deleted file mode 100644 index ebed76a9289c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_cat_all_of.dart +++ /dev/null @@ -1,69 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:json_annotation/json_annotation.dart'; - -part 'special_cat_all_of.g.dart'; - - -@JsonSerializable( - checked: true, - createToJson: true, - disallowUnrecognizedKeys: false, - explicitToJson: true, -) -class SpecialCatAllOf { - /// Returns a new [SpecialCatAllOf] instance. - SpecialCatAllOf({ - - this.kind, - }); - - @JsonKey( - - name: r'kind', - required: false, - includeIfNull: false - ) - - - final SpecialCatAllOfKindEnum? kind; - - - - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialCatAllOf && - other.kind == kind; - - @override - int get hashCode => - kind.hashCode; - - factory SpecialCatAllOf.fromJson(Map json) => _$SpecialCatAllOfFromJson(json); - - Map toJson() => _$SpecialCatAllOfToJson(this); - - @override - String toString() { - return toJson().toString(); - } - -} - - -enum SpecialCatAllOfKindEnum { - @JsonValue(r'lions') - lions, - @JsonValue(r'tigers') - tigers, - @JsonValue(r'leopards') - leopards, - @JsonValue(r'jaguars') - jaguars, - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi, -} - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart deleted file mode 100644 index 1df6d3b9eb9a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_all_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialCatAllOf -void main() { - final SpecialCatAllOf? instance = /* SpecialCatAllOf(...) */ null; - // TODO add properties to the entity - - group(SpecialCatAllOf, () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart deleted file mode 100644 index 4e2c1fd66fc4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/test/special_cat_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialCat -void main() { - final SpecialCat? instance = /* SpecialCat(...) */ null; - // TODO add properties to the entity - - group(SpecialCat, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES index ad5903581283..1a69ee77d623 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/FILES @@ -51,8 +51,6 @@ doc/Pet.md doc/PetApi.md doc/ReadOnlyFirst.md doc/SingleRefType.md -doc/SpecialCat.md -doc/SpecialCatAllOf.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md @@ -120,8 +118,6 @@ lib/src/model/outer_object_with_enum_property.dart lib/src/model/pet.dart lib/src/model/read_only_first.dart lib/src/model/single_ref_type.dart -lib/src/model/special_cat.dart -lib/src/model/special_cat_all_of.dart lib/src/model/special_model_name.dart lib/src/model/tag.dart lib/src/model/user.dart diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md index eef5dbd68631..12076ad230c7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/README.md @@ -154,8 +154,6 @@ Class | Method | HTTP request | Description - [Pet](doc/Pet.md) - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - [SingleRefType](doc/SingleRefType.md) - - [SpecialCat](doc/SpecialCat.md) - - [SpecialCatAllOf](doc/SpecialCatAllOf.md) - [SpecialModelName](doc/SpecialModelName.md) - [Tag](doc/Tag.md) - [User](doc/User.md) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md deleted file mode 100644 index 42a2dea3f96b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCat.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.SpecialCat - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**declawed** | **bool** | | [optional] -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md deleted file mode 100644 index b63c7fd6014a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/SpecialCatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.SpecialCatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart index fffcb78dae53..17f56a53fae1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/openapi.dart @@ -62,8 +62,6 @@ export 'package:openapi/src/model/outer_object_with_enum_property.dart'; export 'package:openapi/src/model/pet.dart'; export 'package:openapi/src/model/read_only_first.dart'; export 'package:openapi/src/model/single_ref_type.dart'; -export 'package:openapi/src/model/special_cat.dart'; -export 'package:openapi/src/model/special_cat_all_of.dart'; export 'package:openapi/src/model/special_model_name.dart'; export 'package:openapi/src/model/tag.dart'; export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart index 7add4d62a209..01a52a6a1707 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/animal.dart @@ -3,7 +3,6 @@ // // ignore_for_file: unused_element -import 'package:openapi/src/model/special_cat.dart'; import 'package:openapi/src/model/dog.dart'; import 'package:openapi/src/model/cat.dart'; import 'package:built_value/built_value.dart'; @@ -29,7 +28,6 @@ abstract class Animal { static const Map discriminatorMapping = { r'Cat': Cat, r'Dog': Dog, - r'Special-Cat': SpecialCat, }; @BuiltValueSerializer(custom: true) @@ -44,9 +42,6 @@ extension AnimalDiscriminatorExt on Animal { if (this is Dog) { return r'Dog'; } - if (this is SpecialCat) { - return r'Special-Cat'; - } return null; } } @@ -58,9 +53,6 @@ extension AnimalBuilderDiscriminatorExt on AnimalBuilder { if (this is DogBuilder) { return r'Dog'; } - if (this is SpecialCatBuilder) { - return r'Special-Cat'; - } return null; } } @@ -103,9 +95,6 @@ class _$AnimalSerializer implements PrimitiveSerializer { if (object is Dog) { return serializers.serialize(object, specifiedType: FullType(Dog))!; } - if (object is SpecialCat) { - return serializers.serialize(object, specifiedType: FullType(SpecialCat))!; - } return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } @@ -123,8 +112,6 @@ class _$AnimalSerializer implements PrimitiveSerializer { return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat; case r'Dog': return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog; - case r'Special-Cat': - return serializers.deserialize(serialized, specifiedType: FullType(SpecialCat)) as SpecialCat; default: return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal; } diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart index 95f5a638a79b..23d19b38b05a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/cat.dart @@ -3,7 +3,6 @@ // // ignore_for_file: unused_element -import 'package:openapi/src/model/special_cat.dart'; import 'package:openapi/src/model/animal.dart'; import 'package:openapi/src/model/cat_all_of.dart'; import 'package:built_value/built_value.dart'; @@ -17,38 +16,23 @@ part 'cat.g.dart'; /// * [className] /// * [color] /// * [declawed] -@BuiltValue(instantiable: false) -abstract class Cat implements Animal, CatAllOf { - static const String discriminatorFieldName = r'className'; +@BuiltValue() +abstract class Cat implements Animal, CatAllOf, Built { + Cat._(); - static const Map discriminatorMapping = { - r'Special-Cat': SpecialCat, - }; + factory Cat([void updates(CatBuilder b)]) = _$Cat; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CatBuilder b) => b..className=b.discriminatorValue + ..color = 'red'; @BuiltValueSerializer(custom: true) static Serializer get serializer => _$CatSerializer(); } -extension CatDiscriminatorExt on Cat { - String? get discriminatorValue { - if (this is SpecialCat) { - return r'Special-Cat'; - } - return null; - } -} -extension CatBuilderDiscriminatorExt on CatBuilder { - String? get discriminatorValue { - if (this is SpecialCatBuilder) { - return r'Special-Cat'; - } - return null; - } -} - class _$CatSerializer implements PrimitiveSerializer { @override - final Iterable types = const [Cat]; + final Iterable types = const [Cat, _$Cat]; @override final String wireName = r'Cat'; @@ -85,60 +69,9 @@ class _$CatSerializer implements PrimitiveSerializer { Cat object, { FullType specifiedType = FullType.unspecified, }) { - if (object is SpecialCat) { - return serializers.serialize(object, specifiedType: FullType(SpecialCat))!; - } return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); } - @override - Cat deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final serializedList = (serialized as Iterable).toList(); - final discIndex = serializedList.indexOf(Cat.discriminatorFieldName) + 1; - final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String; - switch (discValue) { - case r'Special-Cat': - return serializers.deserialize(serialized, specifiedType: FullType(SpecialCat)) as SpecialCat; - default: - return serializers.deserialize(serialized, specifiedType: FullType($Cat)) as $Cat; - } - } -} - -/// a concrete implementation of [Cat], since [Cat] is not instantiable -@BuiltValue(instantiable: true) -abstract class $Cat implements Cat, Built<$Cat, $CatBuilder> { - $Cat._(); - - factory $Cat([void Function($CatBuilder)? updates]) = _$$Cat; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($CatBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$Cat> get serializer => _$$CatSerializer(); -} - -class _$$CatSerializer implements PrimitiveSerializer<$Cat> { - @override - final Iterable types = const [$Cat, _$$Cat]; - - @override - final String wireName = r'$Cat'; - - @override - Object serialize( - Serializers serializers, - $Cat object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(Cat))!; - } - void _deserializeProperties( Serializers serializers, Object serialized, { @@ -181,12 +114,12 @@ class _$$CatSerializer implements PrimitiveSerializer<$Cat> { } @override - $Cat deserialize( + Cat deserialize( Serializers serializers, Object serialized, { FullType specifiedType = FullType.unspecified, }) { - final result = $CatBuilder(); + final result = CatBuilder(); final serializedList = (serialized as Iterable).toList(); final unhandled = []; _deserializeProperties( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart deleted file mode 100644 index 86797dd32cd9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat.dart +++ /dev/null @@ -1,173 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/cat.dart'; -import 'package:openapi/src/model/special_cat_all_of.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'special_cat.g.dart'; - -/// SpecialCat -/// -/// Properties: -/// * [className] -/// * [color] -/// * [declawed] -/// * [kind] -@BuiltValue() -abstract class SpecialCat implements Cat, SpecialCatAllOf, Built { - SpecialCat._(); - - factory SpecialCat([void updates(SpecialCatBuilder b)]) = _$SpecialCat; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(SpecialCatBuilder b) => b..className=b.discriminatorValue - ..color = 'red'; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialCatSerializer(); -} - -class _$SpecialCatSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [SpecialCat, _$SpecialCat]; - - @override - final String wireName = r'SpecialCat'; - - Iterable _serializeProperties( - Serializers serializers, - SpecialCat object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - yield r'className'; - yield serializers.serialize( - object.className, - specifiedType: const FullType(String), - ); - if (object.color != null) { - yield r'color'; - yield serializers.serialize( - object.color, - specifiedType: const FullType(String), - ); - } - if (object.declawed != null) { - yield r'declawed'; - yield serializers.serialize( - object.declawed, - specifiedType: const FullType(bool), - ); - } - if (object.kind != null) { - yield r'kind'; - yield serializers.serialize( - object.kind, - specifiedType: const FullType(SpecialCatAllOfKindEnum), - ); - } - } - - @override - Object serialize( - Serializers serializers, - SpecialCat object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required SpecialCatBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'className': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.color = valueDes; - break; - case r'declawed': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(bool), - ) as bool; - result.declawed = valueDes; - break; - case r'kind': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(SpecialCatAllOfKindEnum), - ) as SpecialCatAllOfKindEnum; - result.kind = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - SpecialCat deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = SpecialCatBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - -class SpecialCatKindEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'lions') - static const SpecialCatKindEnum lions = _$specialCatKindEnum_lions; - @BuiltValueEnumConst(wireName: r'tigers') - static const SpecialCatKindEnum tigers = _$specialCatKindEnum_tigers; - @BuiltValueEnumConst(wireName: r'leopards') - static const SpecialCatKindEnum leopards = _$specialCatKindEnum_leopards; - @BuiltValueEnumConst(wireName: r'jaguars') - static const SpecialCatKindEnum jaguars = _$specialCatKindEnum_jaguars; - @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const SpecialCatKindEnum unknownDefaultOpenApi = _$specialCatKindEnum_unknownDefaultOpenApi; - - static Serializer get serializer => _$specialCatKindEnumSerializer; - - const SpecialCatKindEnum._(String name): super(name); - - static BuiltSet get values => _$specialCatKindEnumValues; - static SpecialCatKindEnum valueOf(String name) => _$specialCatKindEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart deleted file mode 100644 index beed6f69770f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/model/special_cat_all_of.dart +++ /dev/null @@ -1,164 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_element -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'special_cat_all_of.g.dart'; - -/// SpecialCatAllOf -/// -/// Properties: -/// * [kind] -@BuiltValue(instantiable: false) -abstract class SpecialCatAllOf { - @BuiltValueField(wireName: r'kind') - SpecialCatAllOfKindEnum? get kind; - // enum kindEnum { lions, tigers, leopards, jaguars, }; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialCatAllOfSerializer(); -} - -class _$SpecialCatAllOfSerializer implements PrimitiveSerializer { - @override - final Iterable types = const [SpecialCatAllOf]; - - @override - final String wireName = r'SpecialCatAllOf'; - - Iterable _serializeProperties( - Serializers serializers, - SpecialCatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) sync* { - if (object.kind != null) { - yield r'kind'; - yield serializers.serialize( - object.kind, - specifiedType: const FullType(SpecialCatAllOfKindEnum), - ); - } - } - - @override - Object serialize( - Serializers serializers, - SpecialCatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); - } - - @override - SpecialCatAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.deserialize(serialized, specifiedType: FullType($SpecialCatAllOf)) as $SpecialCatAllOf; - } -} - -/// a concrete implementation of [SpecialCatAllOf], since [SpecialCatAllOf] is not instantiable -@BuiltValue(instantiable: true) -abstract class $SpecialCatAllOf implements SpecialCatAllOf, Built<$SpecialCatAllOf, $SpecialCatAllOfBuilder> { - $SpecialCatAllOf._(); - - factory $SpecialCatAllOf([void Function($SpecialCatAllOfBuilder)? updates]) = _$$SpecialCatAllOf; - - @BuiltValueHook(initializeBuilder: true) - static void _defaults($SpecialCatAllOfBuilder b) => b; - - @BuiltValueSerializer(custom: true) - static Serializer<$SpecialCatAllOf> get serializer => _$$SpecialCatAllOfSerializer(); -} - -class _$$SpecialCatAllOfSerializer implements PrimitiveSerializer<$SpecialCatAllOf> { - @override - final Iterable types = const [$SpecialCatAllOf, _$$SpecialCatAllOf]; - - @override - final String wireName = r'$SpecialCatAllOf'; - - @override - Object serialize( - Serializers serializers, - $SpecialCatAllOf object, { - FullType specifiedType = FullType.unspecified, - }) { - return serializers.serialize(object, specifiedType: FullType(SpecialCatAllOf))!; - } - - void _deserializeProperties( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - required List serializedList, - required SpecialCatAllOfBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'kind': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(SpecialCatAllOfKindEnum), - ) as SpecialCatAllOfKindEnum; - result.kind = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } - } - - @override - $SpecialCatAllOf deserialize( - Serializers serializers, - Object serialized, { - FullType specifiedType = FullType.unspecified, - }) { - final result = $SpecialCatAllOfBuilder(); - final serializedList = (serialized as Iterable).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); - return result.build(); - } -} - -class SpecialCatAllOfKindEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'lions') - static const SpecialCatAllOfKindEnum lions = _$specialCatAllOfKindEnum_lions; - @BuiltValueEnumConst(wireName: r'tigers') - static const SpecialCatAllOfKindEnum tigers = _$specialCatAllOfKindEnum_tigers; - @BuiltValueEnumConst(wireName: r'leopards') - static const SpecialCatAllOfKindEnum leopards = _$specialCatAllOfKindEnum_leopards; - @BuiltValueEnumConst(wireName: r'jaguars') - static const SpecialCatAllOfKindEnum jaguars = _$specialCatAllOfKindEnum_jaguars; - @BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true) - static const SpecialCatAllOfKindEnum unknownDefaultOpenApi = _$specialCatAllOfKindEnum_unknownDefaultOpenApi; - - static Serializer get serializer => _$specialCatAllOfKindEnumSerializer; - - const SpecialCatAllOfKindEnum._(String name): super(name); - - static BuiltSet get values => _$specialCatAllOfKindEnumValues; - static SpecialCatAllOfKindEnum valueOf(String name) => _$specialCatAllOfKindEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart index 6218c9fe46ec..60f50e5a77f7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/src/serializers.dart @@ -59,8 +59,6 @@ import 'package:openapi/src/model/outer_object_with_enum_property.dart'; import 'package:openapi/src/model/pet.dart'; import 'package:openapi/src/model/read_only_first.dart'; import 'package:openapi/src/model/single_ref_type.dart'; -import 'package:openapi/src/model/special_cat.dart'; -import 'package:openapi/src/model/special_cat_all_of.dart'; import 'package:openapi/src/model/special_model_name.dart'; import 'package:openapi/src/model/tag.dart'; import 'package:openapi/src/model/user.dart'; @@ -76,7 +74,7 @@ part 'serializers.g.dart'; ArrayOfNumberOnly, ArrayTest, Capitalization, - Cat,$Cat, + Cat, CatAllOf,$CatAllOf, Category, ClassModel, @@ -113,8 +111,6 @@ part 'serializers.g.dart'; Pet, ReadOnlyFirst, SingleRefType, - SpecialCat, - SpecialCatAllOf,$SpecialCatAllOf, SpecialModelName, Tag, User, @@ -153,10 +149,8 @@ Serializers serializers = (_$serializers.toBuilder() () => ListBuilder(), ) ..add(Animal.serializer) - ..add(Cat.serializer) ..add(CatAllOf.serializer) ..add(DogAllOf.serializer) - ..add(SpecialCatAllOf.serializer) ..add(const OneOfSerializer()) ..add(const AnyOfSerializer()) ..add(const DateSerializer()) diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart deleted file mode 100644 index bca1751442f4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_all_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialCatAllOf -void main() { - //final instance = SpecialCatAllOfBuilder(); - // TODO add properties to the builder and call build() - - group(SpecialCatAllOf, () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart deleted file mode 100644 index 2a7924c3b6eb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/test/special_cat_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialCat -void main() { - final instance = SpecialCatBuilder(); - // TODO add properties to the builder and call build() - - group(SpecialCat, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES index 6acebf4d324c..c2faff09ed83 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/FILES @@ -52,8 +52,6 @@ doc/Pet.md doc/PetApi.md doc/ReadOnlyFirst.md doc/SingleRefType.md -doc/SpecialCat.md -doc/SpecialCatAllOf.md doc/SpecialModelName.md doc/StoreApi.md doc/Tag.md @@ -121,8 +119,6 @@ lib/model/outer_object_with_enum_property.dart lib/model/pet.dart lib/model/read_only_first.dart lib/model/single_ref_type.dart -lib/model/special_cat.dart -lib/model/special_cat_all_of.dart lib/model/special_model_name.dart lib/model/tag.dart lib/model/user.dart diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md index 5ee870af8cd2..ed181f1495b2 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/README.md @@ -148,8 +148,6 @@ Class | Method | HTTP request | Description - [Pet](doc//Pet.md) - [ReadOnlyFirst](doc//ReadOnlyFirst.md) - [SingleRefType](doc//SingleRefType.md) - - [SpecialCat](doc//SpecialCat.md) - - [SpecialCatAllOf](doc//SpecialCatAllOf.md) - [SpecialModelName](doc//SpecialModelName.md) - [Tag](doc//Tag.md) - [User](doc//User.md) diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md deleted file mode 100644 index 42a2dea3f96b..000000000000 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCat.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.SpecialCat - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**declawed** | **bool** | | [optional] -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md deleted file mode 100644 index b63c7fd6014a..000000000000 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/SpecialCatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.SpecialCatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart index a90754c104d0..e624212cc80d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api.dart @@ -80,8 +80,6 @@ part 'model/outer_object_with_enum_property.dart'; part 'model/pet.dart'; part 'model/read_only_first.dart'; part 'model/single_ref_type.dart'; -part 'model/special_cat.dart'; -part 'model/special_cat_all_of.dart'; part 'model/special_model_name.dart'; part 'model/tag.dart'; part 'model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart index 49c3d52e4064..22839ae04f0b 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api_client.dart @@ -271,10 +271,6 @@ class ApiClient { return ReadOnlyFirst.fromJson(value); case 'SingleRefType': return SingleRefTypeTypeTransformer().decode(value); - case 'SpecialCat': - return SpecialCat.fromJson(value); - case 'SpecialCatAllOf': - return SpecialCatAllOf.fromJson(value); case 'SpecialModelName': return SpecialModelName.fromJson(value); case 'Tag': diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart deleted file mode 100644 index f096c289670b..000000000000 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat.dart +++ /dev/null @@ -1,226 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -part of openapi.api; - -class SpecialCat { - /// Returns a new [SpecialCat] instance. - SpecialCat({ - required this.className, - this.color = 'red', - this.declawed, - this.kind, - }); - - String className; - - String color; - - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? declawed; - - SpecialCatKindEnum? kind; - - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialCat && - other.className == className && - other.color == color && - other.declawed == declawed && - other.kind == kind; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (className.hashCode) + - (color.hashCode) + - (declawed == null ? 0 : declawed!.hashCode) + - (kind == null ? 0 : kind!.hashCode); - - @override - String toString() => 'SpecialCat[className=$className, color=$color, declawed=$declawed, kind=$kind]'; - - Map toJson() { - final json = {}; - json[r'className'] = this.className; - json[r'color'] = this.color; - if (this.declawed != null) { - json[r'declawed'] = this.declawed; - } else { - json[r'declawed'] = null; - } - if (this.kind != null) { - json[r'kind'] = this.kind; - } else { - json[r'kind'] = null; - } - return json; - } - - /// Returns a new [SpecialCat] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SpecialCat? fromJson(dynamic value) { - if (value is Map) { - final json = value.cast(); - - // Ensure that the map contains the required keys. - // Note 1: the values aren't checked for validity beyond being non-null. - // Note 2: this code is stripped in release mode! - assert(() { - requiredKeys.forEach((key) { - assert(json.containsKey(key), 'Required key "SpecialCat[$key]" is missing from JSON.'); - assert(json[key] != null, 'Required key "SpecialCat[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return SpecialCat( - className: mapValueOfType(json, r'className')!, - color: mapValueOfType(json, r'color') ?? 'red', - declawed: mapValueOfType(json, r'declawed'), - kind: SpecialCatKindEnum.fromJson(json[r'kind']), - ); - } - return null; - } - - static List? listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SpecialCat.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SpecialCat.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SpecialCat-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SpecialCat.listFromJson(entry.value, growable: growable,); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'className', - }; -} - - -class SpecialCatKindEnum { - /// Instantiate a new enum with the provided [value]. - const SpecialCatKindEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const lions = SpecialCatKindEnum._(r'lions'); - static const tigers = SpecialCatKindEnum._(r'tigers'); - static const leopards = SpecialCatKindEnum._(r'leopards'); - static const jaguars = SpecialCatKindEnum._(r'jaguars'); - - /// List of all possible values in this [enum][SpecialCatKindEnum]. - static const values = [ - lions, - tigers, - leopards, - jaguars, - ]; - - static SpecialCatKindEnum? fromJson(dynamic value) => SpecialCatKindEnumTypeTransformer().decode(value); - - static List? listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SpecialCatKindEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SpecialCatKindEnum] to String, -/// and [decode] dynamic data back to [SpecialCatKindEnum]. -class SpecialCatKindEnumTypeTransformer { - factory SpecialCatKindEnumTypeTransformer() => _instance ??= const SpecialCatKindEnumTypeTransformer._(); - - const SpecialCatKindEnumTypeTransformer._(); - - String encode(SpecialCatKindEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a SpecialCatKindEnum. - /// - /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, - /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] - /// cannot be decoded successfully, then an [UnimplementedError] is thrown. - /// - /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, - /// and users are still using an old app with the old code. - SpecialCatKindEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'lions': return SpecialCatKindEnum.lions; - case r'tigers': return SpecialCatKindEnum.tigers; - case r'leopards': return SpecialCatKindEnum.leopards; - case r'jaguars': return SpecialCatKindEnum.jaguars; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SpecialCatKindEnumTypeTransformer] instance. - static SpecialCatKindEnumTypeTransformer? _instance; -} - - diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart deleted file mode 100644 index c0ad675e2dbe..000000000000 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/special_cat_all_of.dart +++ /dev/null @@ -1,194 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -part of openapi.api; - -class SpecialCatAllOf { - /// Returns a new [SpecialCatAllOf] instance. - SpecialCatAllOf({ - this.kind, - }); - - SpecialCatAllOfKindEnum? kind; - - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialCatAllOf && - other.kind == kind; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (kind == null ? 0 : kind!.hashCode); - - @override - String toString() => 'SpecialCatAllOf[kind=$kind]'; - - Map toJson() { - final json = {}; - if (this.kind != null) { - json[r'kind'] = this.kind; - } else { - json[r'kind'] = null; - } - return json; - } - - /// Returns a new [SpecialCatAllOf] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SpecialCatAllOf? fromJson(dynamic value) { - if (value is Map) { - final json = value.cast(); - - // Ensure that the map contains the required keys. - // Note 1: the values aren't checked for validity beyond being non-null. - // Note 2: this code is stripped in release mode! - assert(() { - requiredKeys.forEach((key) { - assert(json.containsKey(key), 'Required key "SpecialCatAllOf[$key]" is missing from JSON.'); - assert(json[key] != null, 'Required key "SpecialCatAllOf[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return SpecialCatAllOf( - kind: SpecialCatAllOfKindEnum.fromJson(json[r'kind']), - ); - } - return null; - } - - static List? listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SpecialCatAllOf.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SpecialCatAllOf.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SpecialCatAllOf-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SpecialCatAllOf.listFromJson(entry.value, growable: growable,); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - - -class SpecialCatAllOfKindEnum { - /// Instantiate a new enum with the provided [value]. - const SpecialCatAllOfKindEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const lions = SpecialCatAllOfKindEnum._(r'lions'); - static const tigers = SpecialCatAllOfKindEnum._(r'tigers'); - static const leopards = SpecialCatAllOfKindEnum._(r'leopards'); - static const jaguars = SpecialCatAllOfKindEnum._(r'jaguars'); - - /// List of all possible values in this [enum][SpecialCatAllOfKindEnum]. - static const values = [ - lions, - tigers, - leopards, - jaguars, - ]; - - static SpecialCatAllOfKindEnum? fromJson(dynamic value) => SpecialCatAllOfKindEnumTypeTransformer().decode(value); - - static List? listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SpecialCatAllOfKindEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SpecialCatAllOfKindEnum] to String, -/// and [decode] dynamic data back to [SpecialCatAllOfKindEnum]. -class SpecialCatAllOfKindEnumTypeTransformer { - factory SpecialCatAllOfKindEnumTypeTransformer() => _instance ??= const SpecialCatAllOfKindEnumTypeTransformer._(); - - const SpecialCatAllOfKindEnumTypeTransformer._(); - - String encode(SpecialCatAllOfKindEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a SpecialCatAllOfKindEnum. - /// - /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, - /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] - /// cannot be decoded successfully, then an [UnimplementedError] is thrown. - /// - /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, - /// and users are still using an old app with the old code. - SpecialCatAllOfKindEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'lions': return SpecialCatAllOfKindEnum.lions; - case r'tigers': return SpecialCatAllOfKindEnum.tigers; - case r'leopards': return SpecialCatAllOfKindEnum.leopards; - case r'jaguars': return SpecialCatAllOfKindEnum.jaguars; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SpecialCatAllOfKindEnumTypeTransformer] instance. - static SpecialCatAllOfKindEnumTypeTransformer? _instance; -} - - diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart deleted file mode 100644 index 2ca8cef1b58d..000000000000 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_all_of_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for SpecialCatAllOf -void main() { - // final instance = SpecialCatAllOf(); - - group('test SpecialCatAllOf', () { - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart deleted file mode 100644 index 160c16eb26e0..000000000000 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/test/special_cat_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -import 'package:openapi/api.dart'; -import 'package:test/test.dart'; - -// tests for SpecialCat -void main() { - // final instance = SpecialCat(); - - group('test SpecialCat', () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - // String kind - test('to test the property `kind`', () async { - // TODO - }); - - - }); - -} diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES index 1f8317f8ef82..c362f355b01b 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/FILES @@ -52,8 +52,6 @@ docs/Pet.md docs/PetApi.md docs/ReadOnlyFirst.md docs/SingleRefType.md -docs/SpecialCat.md -docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -118,8 +116,6 @@ petstore_api/models/outer_object_with_enum_property.py petstore_api/models/pet.py petstore_api/models/read_only_first.py petstore_api/models/single_ref_type.py -petstore_api/models/special_cat.py -petstore_api/models/special_cat_all_of.py petstore_api/models/special_model_name.py petstore_api/models/tag.py petstore_api/models/user.py diff --git a/samples/openapi3/client/petstore/python-legacy/README.md b/samples/openapi3/client/petstore/python-legacy/README.md index feeae38004cf..bee1d84445ef 100755 --- a/samples/openapi3/client/petstore/python-legacy/README.md +++ b/samples/openapi3/client/petstore/python-legacy/README.md @@ -171,8 +171,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SingleRefType](docs/SingleRefType.md) - - [SpecialCat](docs/SpecialCat.md) - - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md b/samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md deleted file mode 100644 index 202b38f6c4b7..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/SpecialCat.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialCat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md b/samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md deleted file mode 100644 index ad4913f6708e..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/docs/SpecialCatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialCatAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py index 3942680c70af..68ec54c6b79a 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/__init__.py @@ -80,8 +80,6 @@ from petstore_api.models.pet import Pet from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.single_ref_type import SingleRefType -from petstore_api.models.special_cat import SpecialCat -from petstore_api.models.special_cat_all_of import SpecialCatAllOf from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.tag import Tag from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py index 79fdeb5978ff..2b4432c9e36a 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/__init__.py @@ -59,8 +59,6 @@ from petstore_api.models.pet import Pet from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.single_ref_type import SingleRefType -from petstore_api.models.special_cat import SpecialCat -from petstore_api.models.special_cat_all_of import SpecialCatAllOf from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.tag import Tag from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py index 04a10d5f700e..d4a49534078d 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/animal.py @@ -47,8 +47,7 @@ class Animal(object): discriminator_value_class_map = { 'Cat': 'Cat', - 'Dog': 'Dog', - 'Special-Cat': 'SpecialCat' + 'Dog': 'Dog' } def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py deleted file mode 100644 index 83f8537424db..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SpecialCat(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """SpecialCat - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this SpecialCat. # noqa: E501 - - - :return: The kind of this SpecialCat. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this SpecialCat. - - - :param kind: The kind of this SpecialCat. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialCat): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SpecialCat): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py deleted file mode 100644 index be592e9b1566..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/models/special_cat_all_of.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -try: - from inspect import getfullargspec -except ImportError: - from inspect import getargspec as getfullargspec -import pprint -import re # noqa: F401 -import six - -from petstore_api.configuration import Configuration - - -class SpecialCatAllOf(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'kind': 'str' - } - - attribute_map = { - 'kind': 'kind' - } - - def __init__(self, kind=None, local_vars_configuration=None): # noqa: E501 - """SpecialCatAllOf - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration.get_default_copy() - self.local_vars_configuration = local_vars_configuration - - self._kind = None - self.discriminator = None - - if kind is not None: - self.kind = kind - - @property - def kind(self): - """Gets the kind of this SpecialCatAllOf. # noqa: E501 - - - :return: The kind of this SpecialCatAllOf. # noqa: E501 - :rtype: str - """ - return self._kind - - @kind.setter - def kind(self, kind): - """Sets the kind of this SpecialCatAllOf. - - - :param kind: The kind of this SpecialCatAllOf. # noqa: E501 - :type kind: str - """ - allowed_values = ["lions", "tigers", "leopards", "jaguars"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and kind not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `kind` ({0}), must be one of {1}" # noqa: E501 - .format(kind, allowed_values) - ) - - self._kind = kind - - def to_dict(self, serialize=False): - """Returns the model properties as a dict""" - result = {} - - def convert(x): - if hasattr(x, "to_dict"): - args = getfullargspec(x.to_dict).args - if len(args) == 1: - return x.to_dict() - else: - return x.to_dict(serialize) - else: - return x - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - attr = self.attribute_map.get(attr, attr) if serialize else attr - if isinstance(value, list): - result[attr] = list(map( - lambda x: convert(x), - value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], convert(item[1])), - value.items() - )) - else: - result[attr] = convert(value) - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialCatAllOf): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, SpecialCatAllOf): - return True - - return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py b/samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py deleted file mode 100644 index ba21e10630fc..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_special_cat.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.special_cat import SpecialCat # noqa: E501 -from petstore_api.rest import ApiException - -class TestSpecialCat(unittest.TestCase): - """SpecialCat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialCat(self): - """Test SpecialCat""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py b/samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py deleted file mode 100644 index 10e079016d52..000000000000 --- a/samples/openapi3/client/petstore/python-legacy/test/test_special_cat_all_of.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import datetime - -import petstore_api -from petstore_api.models.special_cat_all_of import SpecialCatAllOf # noqa: E501 -from petstore_api.rest import ApiException - -class TestSpecialCatAllOf(unittest.TestCase): - """SpecialCatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test SpecialCatAllOf - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # model = petstore_api.models.special_cat_all_of.SpecialCatAllOf() # noqa: E501 - if include_optional : - return SpecialCatAllOf( - kind = 'lions' - ) - else : - return SpecialCatAllOf( - ) - - def testSpecialCatAllOf(self): - """Test SpecialCatAllOf""" - inst_req_only = self.make_instance(include_optional=False) - inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/samples/schema/petstore/mysql/.openapi-generator/FILES b/samples/schema/petstore/mysql/.openapi-generator/FILES index 690ad833d234..84ef3294ab0f 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/FILES +++ b/samples/schema/petstore/mysql/.openapi-generator/FILES @@ -43,8 +43,6 @@ Model/Pet.sql Model/ReadOnlyFirst.sql Model/Return.sql Model/SingleRefType.sql -Model/SpecialCat.sql -Model/SpecialCatAllOf.sql Model/SpecialModelName.sql Model/Tag.sql Model/User.sql diff --git a/samples/schema/petstore/mysql/Model/SpecialCat.sql b/samples/schema/petstore/mysql/Model/SpecialCat.sql deleted file mode 100644 index eeed339468a7..000000000000 --- a/samples/schema/petstore/mysql/Model/SpecialCat.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- OpenAPI Petstore. --- Prepared SQL queries for 'Special-Cat' definition. --- - - --- --- SELECT template for table `Special-Cat` --- -SELECT `className`, `color`, `declawed`, `kind` FROM `Special-Cat` WHERE 1; - --- --- INSERT template for table `Special-Cat` --- -INSERT INTO `Special-Cat`(`className`, `color`, `declawed`, `kind`) VALUES (?, ?, ?, ?); - --- --- UPDATE template for table `Special-Cat` --- -UPDATE `Special-Cat` SET `className` = ?, `color` = ?, `declawed` = ?, `kind` = ? WHERE 1; - --- --- DELETE template for table `Special-Cat` --- -DELETE FROM `Special-Cat` WHERE 0; - diff --git a/samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql b/samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql deleted file mode 100644 index 7f2e6d37f8ac..000000000000 --- a/samples/schema/petstore/mysql/Model/SpecialCatAllOf.sql +++ /dev/null @@ -1,26 +0,0 @@ --- --- OpenAPI Petstore. --- Prepared SQL queries for 'Special_Cat_allOf' definition. --- - - --- --- SELECT template for table `Special_Cat_allOf` --- -SELECT `kind` FROM `Special_Cat_allOf` WHERE 1; - --- --- INSERT template for table `Special_Cat_allOf` --- -INSERT INTO `Special_Cat_allOf`(`kind`) VALUES (?); - --- --- UPDATE template for table `Special_Cat_allOf` --- -UPDATE `Special_Cat_allOf` SET `kind` = ? WHERE 1; - --- --- DELETE template for table `Special_Cat_allOf` --- -DELETE FROM `Special_Cat_allOf` WHERE 0; - diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index fba1265ebaf1..d22077b8d129 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -401,25 +401,6 @@ CREATE TABLE IF NOT EXISTS `Return` ( `return` INT DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Model for testing reserved words'; --- --- Table structure for table `Special-Cat` generated from model 'SpecialMinusCat' --- - -CREATE TABLE IF NOT EXISTS `Special-Cat` ( - `className` TEXT NOT NULL, - `color` TEXT, - `declawed` TINYINT(1) DEFAULT NULL, - `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- --- Table structure for table `Special_Cat_allOf` generated from model 'SpecialUnderscoreCatUnderscoreallOf' --- - -CREATE TABLE IF NOT EXISTS `Special_Cat_allOf` ( - `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -- -- Table structure for table `_special_model.name_` generated from model 'UnderscorespecialUnderscoremodelPeriodnameUnderscore' -- diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES b/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES index 9477844b02da..ab1dc1a7a752 100644 --- a/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES +++ b/samples/server/petstore/cpp-restbed/generated/3_0/.openapi-generator/FILES @@ -103,10 +103,6 @@ model/Return.cpp model/Return.h model/SingleRefType.cpp model/SingleRefType.h -model/Special_Cat.cpp -model/Special_Cat.h -model/Special_Cat_allOf.cpp -model/Special_Cat_allOf.h model/Tag.cpp model/Tag.h model/User.cpp diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp deleted file mode 100644 index ff878acb8934..000000000000 --- a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "Special_Cat.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "helpers.h" - -using boost::property_tree::ptree; -using boost::property_tree::read_json; -using boost::property_tree::write_json; - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -Special_Cat::Special_Cat(boost::property_tree::ptree const& pt) -{ - fromPropertyTree(pt); -} - - -std::string Special_Cat::toJsonString(bool prettyJson /* = false */) const -{ - std::stringstream ss; - write_json(ss, this->toPropertyTree(), prettyJson); - // workaround inspired by: https://stackoverflow.com/a/56395440 - std::regex reg("\\\"([0-9]+\\.{0,1}[0-9]*)\\\""); - std::string result = std::regex_replace(ss.str(), reg, "$1"); - return result; -} - -void Special_Cat::fromJsonString(std::string const& jsonString) -{ - std::stringstream ss(jsonString); - ptree pt; - read_json(ss,pt); - this->fromPropertyTree(pt); -} - -ptree Special_Cat::toPropertyTree() const -{ - ptree pt; - ptree tmp_node; - pt.put("className", m_ClassName); - pt.put("color", m_Color); - pt.put("declawed", m_Declawed); - pt.put("kind", m_Kind); - return pt; -} - -void Special_Cat::fromPropertyTree(ptree const &pt) -{ - ptree tmp_node; - m_ClassName = pt.get("className", ""); - m_Color = pt.get("color", "red"); - m_Declawed = pt.get("declawed", false); - setKind(pt.get("kind", "")); -} - -std::string Special_Cat::getClassName() const -{ - return m_ClassName; -} - -void Special_Cat::setClassName(std::string value) -{ - m_ClassName = value; -} - - -std::string Special_Cat::getColor() const -{ - return m_Color; -} - -void Special_Cat::setColor(std::string value) -{ - m_Color = value; -} - - -bool Special_Cat::isDeclawed() const -{ - return m_Declawed; -} - -void Special_Cat::setDeclawed(bool value) -{ - m_Declawed = value; -} - - -std::string Special_Cat::getKind() const -{ - return m_Kind; -} - -void Special_Cat::setKind(std::string value) -{ - static const std::array allowedValues = { - "lions", "tigers", "leopards", "jaguars" - }; - - if (std::find(allowedValues.begin(), allowedValues.end(), value) != allowedValues.end()) { - m_Kind = value; - } else { - throw std::runtime_error("Value " + boost::lexical_cast(value) + " not allowed"); - } -} - - - -std::vector createSpecial_CatVectorFromJsonString(const std::string& json) -{ - std::stringstream sstream(json); - boost::property_tree::ptree pt; - boost::property_tree::json_parser::read_json(sstream,pt); - - auto vec = std::vector(); - for (const auto& child: pt) { - vec.emplace_back(Special_Cat(child.second)); - } - - return vec; -} - -} -} -} -} - diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h deleted file mode 100644 index 9734629ebc1d..000000000000 --- a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat.h +++ /dev/null @@ -1,114 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Special_Cat.h - * - * - */ - -#ifndef Special_Cat_H_ -#define Special_Cat_H_ - - - -#include "Cat.h" -#include -#include -#include -#include -#include -#include "Cat.h" -#include "Special_Cat_allOf.h" -#include "helpers.h" - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -/// -/// -/// -class Special_Cat : public Cat, public Special_Cat_allOf -{ -public: - Special_Cat() = default; - explicit Special_Cat(boost::property_tree::ptree const& pt); - virtual ~Special_Cat() = default; - - Special_Cat(const Special_Cat& other) = default; // copy constructor - Special_Cat(Special_Cat&& other) noexcept = default; // move constructor - - Special_Cat& operator=(const Special_Cat& other) = default; // copy assignment - Special_Cat& operator=(Special_Cat&& other) noexcept = default; // move assignment - - std::string toJsonString(bool prettyJson = false) const; - void fromJsonString(std::string const& jsonString); - boost::property_tree::ptree toPropertyTree() const; - void fromPropertyTree(boost::property_tree::ptree const& pt); - - - ///////////////////////////////////////////// - /// Special_Cat members - - /// - /// - /// - std::string getClassName() const; - void setClassName(std::string value); - - /// - /// - /// - std::string getColor() const; - void setColor(std::string value); - - /// - /// - /// - bool isDeclawed() const; - void setDeclawed(bool value); - - /// - /// - /// - std::string getKind() const; - void setKind(std::string value); - -protected: - std::string m_ClassName = ""; - std::string m_Color = "red"; - bool m_Declawed = false; - std::string m_Kind = ""; -}; - -std::vector createSpecial_CatVectorFromJsonString(const std::string& json); - -template<> -inline boost::property_tree::ptree toPt(const Special_Cat& val) { - return val.toPropertyTree(); -} - -template<> -inline Special_Cat fromPt(const boost::property_tree::ptree& pt) { - Special_Cat ret; - ret.fromPropertyTree(pt); - return ret; -} - -} -} -} -} - -#endif /* Special_Cat_H_ */ diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp deleted file mode 100644 index bb1c7a42a958..000000000000 --- a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "Special_Cat_allOf.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "helpers.h" - -using boost::property_tree::ptree; -using boost::property_tree::read_json; -using boost::property_tree::write_json; - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -Special_Cat_allOf::Special_Cat_allOf(boost::property_tree::ptree const& pt) -{ - fromPropertyTree(pt); -} - - -std::string Special_Cat_allOf::toJsonString(bool prettyJson /* = false */) const -{ - std::stringstream ss; - write_json(ss, this->toPropertyTree(), prettyJson); - // workaround inspired by: https://stackoverflow.com/a/56395440 - std::regex reg("\\\"([0-9]+\\.{0,1}[0-9]*)\\\""); - std::string result = std::regex_replace(ss.str(), reg, "$1"); - return result; -} - -void Special_Cat_allOf::fromJsonString(std::string const& jsonString) -{ - std::stringstream ss(jsonString); - ptree pt; - read_json(ss,pt); - this->fromPropertyTree(pt); -} - -ptree Special_Cat_allOf::toPropertyTree() const -{ - ptree pt; - ptree tmp_node; - pt.put("kind", m_Kind); - return pt; -} - -void Special_Cat_allOf::fromPropertyTree(ptree const &pt) -{ - ptree tmp_node; - setKind(pt.get("kind", "")); -} - -std::string Special_Cat_allOf::getKind() const -{ - return m_Kind; -} - -void Special_Cat_allOf::setKind(std::string value) -{ - static const std::array allowedValues = { - "lions", "tigers", "leopards", "jaguars" - }; - - if (std::find(allowedValues.begin(), allowedValues.end(), value) != allowedValues.end()) { - m_Kind = value; - } else { - throw std::runtime_error("Value " + boost::lexical_cast(value) + " not allowed"); - } -} - - - -std::vector createSpecial_Cat_allOfVectorFromJsonString(const std::string& json) -{ - std::stringstream sstream(json); - boost::property_tree::ptree pt; - boost::property_tree::json_parser::read_json(sstream,pt); - - auto vec = std::vector(); - for (const auto& child: pt) { - vec.emplace_back(Special_Cat_allOf(child.second)); - } - - return vec; -} - -} -} -} -} - diff --git a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h b/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h deleted file mode 100644 index dd9c9a8b1ffa..000000000000 --- a/samples/server/petstore/cpp-restbed/generated/3_0/model/Special_Cat_allOf.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI-Generator 6.5.0-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Special_Cat_allOf.h - * - * - */ - -#ifndef Special_Cat_allOf_H_ -#define Special_Cat_allOf_H_ - - - -#include -#include -#include -#include -#include -#include "helpers.h" - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -/// -/// -/// -class Special_Cat_allOf -{ -public: - Special_Cat_allOf() = default; - explicit Special_Cat_allOf(boost::property_tree::ptree const& pt); - virtual ~Special_Cat_allOf() = default; - - Special_Cat_allOf(const Special_Cat_allOf& other) = default; // copy constructor - Special_Cat_allOf(Special_Cat_allOf&& other) noexcept = default; // move constructor - - Special_Cat_allOf& operator=(const Special_Cat_allOf& other) = default; // copy assignment - Special_Cat_allOf& operator=(Special_Cat_allOf&& other) noexcept = default; // move assignment - - std::string toJsonString(bool prettyJson = false) const; - void fromJsonString(std::string const& jsonString); - boost::property_tree::ptree toPropertyTree() const; - void fromPropertyTree(boost::property_tree::ptree const& pt); - - - ///////////////////////////////////////////// - /// Special_Cat_allOf members - - /// - /// - /// - std::string getKind() const; - void setKind(std::string value); - -protected: - std::string m_Kind = ""; -}; - -std::vector createSpecial_Cat_allOfVectorFromJsonString(const std::string& json); - -template<> -inline boost::property_tree::ptree toPt(const Special_Cat_allOf& val) { - return val.toPropertyTree(); -} - -template<> -inline Special_Cat_allOf fromPt(const boost::property_tree::ptree& pt) { - Special_Cat_allOf ret; - ret.fromPropertyTree(pt); - return ret; -} - -} -} -} -} - -#endif /* Special_Cat_allOf_H_ */ diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES index 25a20158699d..9fdbc1aebe2c 100644 --- a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES @@ -62,8 +62,6 @@ src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/server/model/Pet.java src/main/java/org/openapitools/server/model/ReadOnlyFirst.java src/main/java/org/openapitools/server/model/SingleRefType.java -src/main/java/org/openapitools/server/model/SpecialCat.java -src/main/java/org/openapitools/server/model/SpecialCatAllOf.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java index 0cd3f029a7d4..da9c02ed0c39 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Cat; import org.openapitools.server.model.Dog; -import org.openapitools.server.model.SpecialCat; import jakarta.validation.constraints.*; import jakarta.validation.Valid; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java index e742daf6765b..78534303e0ff 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; -import org.openapitools.server.model.SpecialCat; import jakarta.validation.constraints.*; import jakarta.validation.Valid; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java deleted file mode 100644 index 7a42d59ad41c..000000000000 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCat.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.server.model.Cat; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; - - -public class SpecialCat extends Cat { - -public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - - private String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - /** - * Convert a String into String, as specified in the - * See JAX RS 2.0 Specification, section 3.2, p. 12 - */ - public static KindEnum fromString(String s) { - for (KindEnum b : KindEnum.values()) { - // using Objects.toString() to be safe if value type non-object type - // because types like 'int' etc. will be auto-boxed - if (java.util.Objects.toString(b.value).equals(s)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected string value '" + s + "'"); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - - private KindEnum kind; - - /** - * Get kind - * @return kind - **/ - public KindEnum getKind() { - return kind; - } - - /** - * Set kind - **/ - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public SpecialCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java deleted file mode 100644 index b5819113c3bb..000000000000 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; - - -public class SpecialCatAllOf { - -public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - - private String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - /** - * Convert a String into String, as specified in the - * See JAX RS 2.0 Specification, section 3.2, p. 12 - */ - public static KindEnum fromString(String s) { - for (KindEnum b : KindEnum.values()) { - // using Objects.toString() to be safe if value type non-object type - // because types like 'int' etc. will be auto-boxed - if (java.util.Objects.toString(b.value).equals(s)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected string value '" + s + "'"); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - - private KindEnum kind; - - /** - * Get kind - * @return kind - **/ - public KindEnum getKind() { - return kind; - } - - /** - * Set kind - **/ - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public SpecialCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml index 536a7cadf78f..6667e32d34cb 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -1505,10 +1505,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2144,17 +2140,6 @@ components: type: boolean type: object example: null - Special_Cat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java deleted file mode 100644 index 6980c1bf5d6b..000000000000 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java deleted file mode 100644 index 8d2829c0247c..000000000000 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialCatTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.server.model.Cat; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES index 300a5134d43e..93bbc6b3b013 100644 --- a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES @@ -63,8 +63,6 @@ src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java src/main/java/org/openapitools/server/model/Pet.java src/main/java/org/openapitools/server/model/ReadOnlyFirst.java src/main/java/org/openapitools/server/model/SingleRefType.java -src/main/java/org/openapitools/server/model/SpecialCat.java -src/main/java/org/openapitools/server/model/SpecialCatAllOf.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java index b2ed9adc471b..72fd34477f82 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Cat; import org.openapitools.server.model.Dog; -import org.openapitools.server.model.SpecialCat; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java index a6eaae636b93..663f2a85183a 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; -import org.openapitools.server.model.SpecialCat; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java deleted file mode 100644 index 6d50414bd48a..000000000000 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCat.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.server.model.Cat; - - - -public class SpecialCat extends Cat { - - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - TIGERS("tigers"), - LEOPARDS("leopards"), - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static KindEnum fromValue(String text) { - for (KindEnum b : KindEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private KindEnum kind; - - /** - * Default constructor. - */ - public SpecialCat() { - // JSON-B / Jackson - } - - /** - * Create SpecialCat. - * - * @param kind kind - */ - public SpecialCat( - KindEnum kind - ) { - this.kind = kind; - } - - - - /** - * Get kind - * @return kind - */ - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java deleted file mode 100644 index fc16dc538c9b..000000000000 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialCatAllOf.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; - - - -public class SpecialCatAllOf { - - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - TIGERS("tigers"), - LEOPARDS("leopards"), - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static KindEnum fromValue(String text) { - for (KindEnum b : KindEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private KindEnum kind; - - /** - * Default constructor. - */ - public SpecialCatAllOf() { - // JSON-B / Jackson - } - - /** - * Create SpecialCatAllOf. - * - * @param kind kind - */ - public SpecialCatAllOf( - KindEnum kind - ) { - this.kind = kind; - } - - - - /** - * Get kind - * @return kind - */ - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml index 536a7cadf78f..6667e32d34cb 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -1505,10 +1505,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - Special-Cat: - allOf: - - $ref: '#/definitions/Cat' - - $ref: '#/components/schemas/Special_Cat_allOf' Animal: discriminator: propertyName: className @@ -2144,17 +2140,6 @@ components: type: boolean type: object example: null - Special_Cat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java deleted file mode 100644 index 6980c1bf5d6b..000000000000 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatAllOfTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCatAllOf - */ -public class SpecialCatAllOfTest { - private final SpecialCatAllOf model = new SpecialCatAllOf(); - - /** - * Model tests for SpecialCatAllOf - */ - @Test - public void testSpecialCatAllOf() { - // TODO: test SpecialCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java deleted file mode 100644 index 8d2829c0247c..000000000000 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialCatTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.server.model.Cat; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialCat - */ -public class SpecialCatTest { - private final SpecialCat model = new SpecialCat(); - - /** - * Model tests for SpecialCat - */ - @Test - public void testSpecialCat() { - // TODO: test SpecialCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES index 199ffbd9c490..463e9366b2c2 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES @@ -66,8 +66,6 @@ src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java src/gen/java/org/openapitools/model/Pet.java src/gen/java/org/openapitools/model/ReadOnlyFirst.java src/gen/java/org/openapitools/model/SingleRefType.java -src/gen/java/org/openapitools/model/SpecialCat.java -src/gen/java/org/openapitools/model/SpecialCatAllOf.java src/gen/java/org/openapitools/model/SpecialModelName.java src/gen/java/org/openapitools/model/Tag.java src/gen/java/org/openapitools/model/User.java diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java index a0eaa1f43555..a5eae51787ce 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java @@ -36,7 +36,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java deleted file mode 100644 index 4ca258e22490..000000000000 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCat.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Cat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * SpecialCat - */ -@JsonPropertyOrder({ - SpecialCat.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") -public class SpecialCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - @JsonProperty(JSON_PROPERTY_KIND) - private KindEnum kind; - - public SpecialCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @JsonProperty(value = "kind") - @ApiModelProperty(value = "") - - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCat specialCat = (SpecialCat) o; - return Objects.equals(this.kind, specialCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java deleted file mode 100644 index 6f87f6763607..000000000000 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialCatAllOf.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * SpecialCatAllOf - */ -@JsonPropertyOrder({ - SpecialCatAllOf.JSON_PROPERTY_KIND -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen") -public class SpecialCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - @JsonProperty(JSON_PROPERTY_KIND) - private KindEnum kind; - - public SpecialCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @JsonProperty(value = "kind") - @ApiModelProperty(value = "") - - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; - return Objects.equals(this.kind, specialCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialCatAllOf {\n"); - - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/php-laravel/.openapi-generator/FILES b/samples/server/petstore/php-laravel/.openapi-generator/FILES index 9becd67ee3a0..eb2e7313fb42 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/FILES +++ b/samples/server/petstore/php-laravel/.openapi-generator/FILES @@ -67,8 +67,6 @@ lib/app/Models/OuterObjectWithEnumProperty.php lib/app/Models/Pet.php lib/app/Models/ReadOnlyFirst.php lib/app/Models/SingleRefType.php -lib/app/Models/SpecialCat.php -lib/app/Models/SpecialCatAllOf.php lib/app/Models/SpecialModelName.php lib/app/Models/Tag.php lib/app/Models/User.php diff --git a/samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php b/samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php deleted file mode 100644 index 6522248c97be..000000000000 --- a/samples/server/petstore/php-laravel/lib/app/Models/SpecialCat.php +++ /dev/null @@ -1,24 +0,0 @@ - Date: Mon, 6 Mar 2023 13:59:52 +1000 Subject: [PATCH 4/4] Add sample scenario and test for jackson serialization and deserialization --- ...odels-for-testing-with-http-signature.yaml | 8 + .../native-async/.openapi-generator/FILES | 6 + .../petstore/java/native-async/README.md | 2 + .../java/native-async/api/openapi.yaml | 15 ++ .../java/native-async/docs/SpecialCat.md | 24 ++ .../java/native-async/docs/SpecialCatAllOf.md | 24 ++ .../org/openapitools/client/model/Animal.java | 3 + .../org/openapitools/client/model/Cat.java | 5 + .../openapitools/client/model/SpecialCat.java | 223 ++++++++++++++++++ .../client/model/SpecialCatAllOf.java | 189 +++++++++++++++ .../client/model/SpecialCatAllOfTest.java | 48 ++++ .../client/model/SpecialCatTest.java | 76 ++++++ .../java/native/.openapi-generator/FILES | 6 + samples/client/petstore/java/native/README.md | 2 + .../petstore/java/native/api/openapi.yaml | 15 ++ .../petstore/java/native/docs/SpecialCat.md | 24 ++ .../java/native/docs/SpecialCatAllOf.md | 24 ++ .../org/openapitools/client/model/Animal.java | 3 + .../org/openapitools/client/model/Cat.java | 5 + .../openapitools/client/model/SpecialCat.java | 223 ++++++++++++++++++ .../client/model/SpecialCatAllOf.java | 189 +++++++++++++++ .../client/model/SpecialCatAllOfTest.java | 48 ++++ .../client/model/SpecialCatJacksonTest.java | 35 +++ .../client/model/SpecialCatTest.java | 76 ++++++ 24 files changed, 1273 insertions(+) create mode 100644 samples/client/petstore/java/native-async/docs/SpecialCat.md create mode 100644 samples/client/petstore/java/native-async/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatTest.java create mode 100644 samples/client/petstore/java/native/docs/SpecialCat.md create mode 100644 samples/client/petstore/java/native/docs/SpecialCatAllOf.md create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCat.java create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatTest.java diff --git a/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index b5848df635f9..418babcb2420 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1424,6 +1424,14 @@ components: properties: declawed: type: boolean + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - type: object + properties: + kind: + type: string + enum: [lions, tigers, leopards, jaguars] Address: type: object additionalProperties: diff --git a/samples/client/petstore/java/native-async/.openapi-generator/FILES b/samples/client/petstore/java/native-async/.openapi-generator/FILES index a1bc5339f0d4..9c2d0d7969ac 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-async/.openapi-generator/FILES @@ -79,6 +79,8 @@ docs/Shape.md docs/ShapeInterface.md docs/ShapeOrNull.md docs/SimpleQuadrilateral.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -183,6 +185,8 @@ src/main/java/org/openapitools/client/model/Shape.java src/main/java/org/openapitools/client/model/ShapeInterface.java src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/Triangle.java @@ -190,3 +194,5 @@ src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java src/main/java/org/openapitools/client/model/Whale.java src/main/java/org/openapitools/client/model/Zebra.java +src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +src/test/java/org/openapitools/client/model/SpecialCatTest.java diff --git a/samples/client/petstore/java/native-async/README.md b/samples/client/petstore/java/native-async/README.md index cf4e76b2e591..0ce54bf1c58f 100644 --- a/samples/client/petstore/java/native-async/README.md +++ b/samples/client/petstore/java/native-async/README.md @@ -257,6 +257,8 @@ Class | Method | HTTP request | Description - [ShapeInterface](docs/ShapeInterface.md) - [ShapeOrNull](docs/ShapeOrNull.md) - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialCat](docs/SpecialCat.md) + - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [Triangle](docs/Triangle.md) diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index 837330cd6c9f..694e216cbfd4 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Address' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Address: additionalProperties: type: integer @@ -2291,6 +2295,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null ChildCat_allOf: properties: name: diff --git a/samples/client/petstore/java/native-async/docs/SpecialCat.md b/samples/client/petstore/java/native-async/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/native-async/docs/SpecialCatAllOf.md b/samples/client/petstore/java/native-async/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java index cffa1c6286ac..554b56702a5b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java @@ -30,6 +30,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,6 +51,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { @@ -203,6 +205,7 @@ public String toUrlQueryString(String prefix) { Map> mappings = new HashMap>(); mappings.put("Cat", Cat.class); mappings.put("Dog", Dog.class); + mappings.put("Special-Cat", SpecialCat.class); mappings.put("Animal", Animal.class); JSON.registerDiscriminator(Animal.class, "className", mappings); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java index 8b85a7bb1088..5d293b0babc7 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -45,6 +46,9 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; @@ -172,6 +176,7 @@ public String toUrlQueryString(String prefix) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); + mappings.put("Special-Cat", SpecialCat.class); mappings.put("Cat", Cat.class); JSON.registerDiscriminator(Cat.class, "className", mappings); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..c661da6bdc26 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,223 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCat() { + } + + public SpecialCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + /** + * Return true if this Special-Cat object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `declawed` to the URL query string + if (getDeclawed() != null) { + joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `kind` to the URL query string + if (getKind() != null) { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Special-Cat", SpecialCat.class); + JSON.registerDiscriminator(SpecialCat.class, "className", mappings); +} +} + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..a7fd1dec309f --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,189 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCatAllOf() { + } + + public SpecialCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + /** + * Return true if this Special_Cat_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `kind` to the URL query string + if (getKind() != null) { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..947c778e233f --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..8252e2d02f8a --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native/.openapi-generator/FILES b/samples/client/petstore/java/native/.openapi-generator/FILES index a1bc5339f0d4..9c2d0d7969ac 100644 --- a/samples/client/petstore/java/native/.openapi-generator/FILES +++ b/samples/client/petstore/java/native/.openapi-generator/FILES @@ -79,6 +79,8 @@ docs/Shape.md docs/ShapeInterface.md docs/ShapeOrNull.md docs/SimpleQuadrilateral.md +docs/SpecialCat.md +docs/SpecialCatAllOf.md docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md @@ -183,6 +185,8 @@ src/main/java/org/openapitools/client/model/Shape.java src/main/java/org/openapitools/client/model/ShapeInterface.java src/main/java/org/openapitools/client/model/ShapeOrNull.java src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +src/main/java/org/openapitools/client/model/SpecialCat.java +src/main/java/org/openapitools/client/model/SpecialCatAllOf.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/Triangle.java @@ -190,3 +194,5 @@ src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java src/main/java/org/openapitools/client/model/Whale.java src/main/java/org/openapitools/client/model/Zebra.java +src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java +src/test/java/org/openapitools/client/model/SpecialCatTest.java diff --git a/samples/client/petstore/java/native/README.md b/samples/client/petstore/java/native/README.md index 9bb58bc15eb6..8a4bf4ea70de 100644 --- a/samples/client/petstore/java/native/README.md +++ b/samples/client/petstore/java/native/README.md @@ -256,6 +256,8 @@ Class | Method | HTTP request | Description - [ShapeInterface](docs/ShapeInterface.md) - [ShapeOrNull](docs/ShapeOrNull.md) - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialCat](docs/SpecialCat.md) + - [SpecialCatAllOf](docs/SpecialCatAllOf.md) - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [Triangle](docs/Triangle.md) diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index 837330cd6c9f..694e216cbfd4 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Address' - $ref: '#/components/schemas/Cat_allOf' + Special-Cat: + allOf: + - $ref: '#/definitions/Cat' + - $ref: '#/components/schemas/Special_Cat_allOf' Address: additionalProperties: type: integer @@ -2291,6 +2295,17 @@ components: type: boolean type: object example: null + Special_Cat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + example: null ChildCat_allOf: properties: name: diff --git a/samples/client/petstore/java/native/docs/SpecialCat.md b/samples/client/petstore/java/native/docs/SpecialCat.md new file mode 100644 index 000000000000..1e1781c92cd7 --- /dev/null +++ b/samples/client/petstore/java/native/docs/SpecialCat.md @@ -0,0 +1,24 @@ + + +# SpecialCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/native/docs/SpecialCatAllOf.md b/samples/client/petstore/java/native/docs/SpecialCatAllOf.md new file mode 100644 index 000000000000..60aeeb4fdc4f --- /dev/null +++ b/samples/client/petstore/java/native/docs/SpecialCatAllOf.md @@ -0,0 +1,24 @@ + + +# SpecialCatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| LIONS | "lions" | +| TIGERS | "tigers" | +| LEOPARDS | "leopards" | +| JAGUARS | "jaguars" | + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index cffa1c6286ac..554b56702a5b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -30,6 +30,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,6 +51,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), }) public class Animal { @@ -203,6 +205,7 @@ public String toUrlQueryString(String prefix) { Map> mappings = new HashMap>(); mappings.put("Cat", Cat.class); mappings.put("Dog", Dog.class); + mappings.put("Special-Cat", SpecialCat.class); mappings.put("Animal", Animal.class); JSON.registerDiscriminator(Animal.class, "className", mappings); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index 8b85a7bb1088..5d293b0babc7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; +import org.openapitools.client.model.SpecialCat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -45,6 +46,9 @@ allowSetters = true // allows the className to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpecialCat.class, name = "Special-Cat"), +}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; @@ -172,6 +176,7 @@ public String toUrlQueryString(String prefix) { static { // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); + mappings.put("Special-Cat", SpecialCat.class); mappings.put("Cat", Cat.class); JSON.registerDiscriminator(Cat.class, "className", mappings); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCat.java new file mode 100644 index 000000000000..c661da6bdc26 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCat.java @@ -0,0 +1,223 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +/** + * SpecialCat + */ +@JsonPropertyOrder({ + SpecialCat.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class SpecialCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCat() { + } + + public SpecialCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + /** + * Return true if this Special-Cat object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCat specialCat = (SpecialCat) o; + return Objects.equals(this.kind, specialCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `declawed` to the URL query string + if (getDeclawed() != null) { + joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `kind` to the URL query string + if (getKind() != null) { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Special-Cat", SpecialCat.class); + JSON.registerDiscriminator(SpecialCat.class, "className", mappings); +} +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java new file mode 100644 index 000000000000..a7fd1dec309f --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialCatAllOf.java @@ -0,0 +1,189 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * SpecialCatAllOf + */ +@JsonPropertyOrder({ + SpecialCatAllOf.JSON_PROPERTY_KIND +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public SpecialCatAllOf() { + } + + public SpecialCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + /** + * Return true if this Special_Cat_allOf object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialCatAllOf specialCatAllOf = (SpecialCatAllOf) o; + return Objects.equals(this.kind, specialCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `kind` to the URL query string + if (getKind() != null) { + joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java new file mode 100644 index 000000000000..947c778e233f --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatAllOfTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCatAllOf + */ +public class SpecialCatAllOfTest { + private final SpecialCatAllOf model = new SpecialCatAllOf(); + + /** + * Model tests for SpecialCatAllOf + */ + @Test + public void testSpecialCatAllOf() { + // TODO: test SpecialCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java new file mode 100644 index 000000000000..4154350c3dca --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatJacksonTest.java @@ -0,0 +1,35 @@ +package org.openapitools.client.model; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +public class SpecialCatJacksonTest { + + private final ObjectMapper objectMapper = new ObjectMapper(); + + @Test + public void shouldSerializeAndDeserializeModel() throws JsonProcessingException { + String color = "yellow-gold"; + Animal model = new SpecialCat().kind(SpecialCat.KindEnum.LIONS).declawed(false).color(color); + + String json = objectMapper.writeValueAsString(model); + + assertThat(json, containsString("\"className\":\"Special-Cat\"")); + + Animal result = objectMapper.readValue(json, Animal.class); + + assertThat(result, instanceOf(SpecialCat.class)); + + SpecialCat specialCat = (SpecialCat) result; + assertThat(specialCat.getColor(), is(color)); + assertThat(specialCat.getDeclawed(), is(false)); + assertThat(specialCat.getKind(), is(SpecialCat.KindEnum.LIONS)); + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatTest.java new file mode 100644 index 000000000000..8252e2d02f8a --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialCatTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialCat + */ +public class SpecialCatTest { + private final SpecialCat model = new SpecialCat(); + + /** + * Model tests for SpecialCat + */ + @Test + public void testSpecialCat() { + // TODO: test SpecialCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +}