From d11d6b7a9fd68346201c7b0e1e7447fd1ef9277a Mon Sep 17 00:00:00 2001 From: Luke Marlin Date: Fri, 3 Jul 2020 20:52:30 +0200 Subject: [PATCH 1/3] Fix isEnum for referenced enums Fixes #5676 Referenced enums are now properly marked as isEnum = true --- .../openapitools/codegen/DefaultCodegen.java | 1 + .../languages/HaskellHttpClientCodegen.java | 21 +- .../languages/KotlinSpringServerCodegen.java | 9 +- .../kotlin-spring/dataClass.mustache | 4 +- .../kotlin-spring/dataClassOptVar.mustache | 2 +- .../kotlin-spring/dataClassReqVar.mustache | 2 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 2 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 2 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 2 +- .../lib/OpenAPIPetstore/Model.hs | 2 +- .../lib/OpenAPIPetstore/ModelLens.hs | 2 +- .../haskell-http-client/tests/Instances.hs | 2 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../java/google-api-client/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../petstore/java/jersey1/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../java/jersey2-java8/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../java/native-async/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../petstore/java/native/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 59 +++++- .../java/okhttp-gson/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 57 +++++- .../rest-assured-jackson/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../java/rest-assured/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 57 +++++- .../petstore/java/resteasy/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../resttemplate-withXml/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../java/resttemplate/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../java/retrofit2-play26/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../petstore/java/retrofit2/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 57 +++++- .../java/retrofit2rx2/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 57 +++++- .../java/retrofit2rx3/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 57 +++++- .../petstore/java/vertx/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../petstore/java/webclient/docs/EnumTest.md | 12 +- .../openapitools/client/model/EnumTest.java | 45 ++++- .../petstore/javascript-es6/docs/EnumTest.md | 52 +++++ .../javascript-es6/src/model/EnumTest.js | 116 ++++++++++- .../javascript-promise-es6/docs/EnumTest.md | 52 +++++ .../src/model/EnumTest.js | 116 ++++++++++- .../OpenAPIClient-php/lib/Model/EnumTest.php | 136 +++++++++++++ .../petstore_api/models/enum_test.py | 6 + .../petstore_api/models/enum_test.py | 6 + .../python/petstore_api/models/enum_test.py | 6 + .../lib/petstore/models/enum_test.rb | 48 +++++ .../ruby/lib/petstore/models/enum_test.rb | 48 +++++ .../builds/default/.openapi-generator/FILES | 12 +- .../builds/with-npm/.openapi-generator/FILES | 12 +- .../builds/default/.openapi-generator/FILES | 12 +- .../builds/with-npm/.openapi-generator/FILES | 12 +- .../builds/default/.openapi-generator/FILES | 12 +- .../builds/with-npm/.openapi-generator/FILES | 12 +- .../builds/default/.openapi-generator/FILES | 12 +- .../builds/with-npm/.openapi-generator/FILES | 12 +- .../.openapi-generator/FILES | 12 +- .../builds/with-npm/.openapi-generator/FILES | 12 +- .../.openapi-generator/FILES | 12 +- .../default/.openapi-generator/FILES | 12 +- .../npm/.openapi-generator/FILES | 12 +- samples/openapi3/client/elm/src/Api/Data.elm | 61 +++++- .../go-petstore/docs/EnumTest.md | 2 +- .../go-petstore/model_enum_test_.go | 4 +- .../java/jersey2-java8/docs/EnumTest.md | 48 ++++- .../openapitools/client/model/EnumTest.java | 188 ++++++++++++++++-- .../petstore_api/model/array_of_enums.py | 5 + .../python/petstore_api/models/enum_test.py | 24 +++ .../java/org/openapitools/model/EnumTest.java | 41 +++- .../app/apimodels/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 43 +++- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 164 +++++++++++++-- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../java/org/openapitools/model/EnumTest.java | 41 +++- .../.openapi-generator/FILES | 46 ++--- .../src/models.rs | 1 + .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- .../virtualan/model/EnumTest.java | 45 ++++- .../java/org/openapitools/model/EnumTest.java | 45 ++++- 103 files changed, 3032 insertions(+), 356 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a331c1a126a2..ea1dd54ef4c1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -3168,6 +3168,7 @@ public CodegenProperty fromProperty(String name, Schema p) { if (referencedSchema.getEnum() != null && !referencedSchema.getEnum().isEmpty()) { List _enum = referencedSchema.getEnum(); + property.isEnum = true; Map allowableValues = new HashMap(); allowableValues.put("values", _enum); if (allowableValues.size() > 0) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 00fc4e981756..b6977acca7e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -1339,18 +1339,19 @@ public String toEnumName(CodegenProperty var) { return toEnumName(var.items); } String paramNameType = "E'" + toTypeName("", var.name); - String enumValues = var._enum.toString(); + if (var._enum != null) { + String enumValues = var._enum.toString(); - Pair duplicateEnum = isDuplicateEnumValues(enumValues); - if (duplicateEnum.getLeft()) { - paramNameType = duplicateEnum.getRight(); - } else { - paramNameType = toDedupedModelName(paramNameType, enumValues, false); - var.datatypeWithEnum = paramNameType; - updateCodegenPropertyEnum(var); - addEnumToUniques(paramNameType, var.dataType, enumValues, var.allowableValues, var.description); + Pair duplicateEnum = isDuplicateEnumValues(enumValues); + if (duplicateEnum.getLeft()) { + paramNameType = duplicateEnum.getRight(); + } else { + paramNameType = toDedupedModelName(paramNameType, enumValues, false); + var.datatypeWithEnum = paramNameType; + updateCodegenPropertyEnum(var); + addEnumToUniques(paramNameType, var.dataType, enumValues, var.allowableValues, var.description); + } } - return paramNameType; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 909c1f59cf20..beed3b433c31 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -518,7 +518,14 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert if (!Boolean.TRUE.equals(model.isEnum)) { model.imports.add("JsonProperty"); if (Boolean.TRUE.equals(model.hasEnums)) { - model.imports.add("JsonValue"); + //Loop through properties to check if one is an embedded enum + for (CodegenProperty prop : model.allVars) { + //If a property is an enum and a primitive type, it is an embedded enum + if (prop.isEnum && prop.isPrimitiveType) { + model.imports.add("JsonValue"); + break; + } + } } } else { //Needed imports for Jackson's JsonCreator diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index a06f6689bba4..9f56165ea142 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -20,7 +20,7 @@ {{>interfaceOptVar}} {{/optionalVars}} {{/discriminator}} -{{#hasEnums}}{{#vars}}{{#isEnum}} +{{#hasEnums}}{{#vars}}{{#isEnum}}{{#isPrimitiveType}} /** * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} @@ -30,5 +30,5 @@ @JsonProperty({{{value}}}) {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}}{{/allowableValues}} } -{{/isEnum}}{{/vars}}{{/hasEnums}} +{{/isPrimitiveType}}{{/isEnum}}{{/vars}}{{/hasEnums}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index 43ce48eb56ca..9ddef46eb9f0 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -2,4 +2,4 @@ {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}} - @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file + @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{^isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isPrimitiveType}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 18bc12c7e411..df17a218e84a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,4 +1,4 @@ {{#useBeanValidation}}{{#required}} {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}} - @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}{{/isReadOnly}} \ No newline at end of file + @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{^isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isPrimitiveType}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}{{/isReadOnly}} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index eb028bacfb5b..8935a5a5c332 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -159,7 +159,7 @@ protected EnumTest() { } /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnumEnum? outerEnum = default(OuterEnumEnum?)) { this.EnumStringRequired = enumStringRequired; this.EnumString = enumString; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs index eb028bacfb5b..8935a5a5c332 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -159,7 +159,7 @@ protected EnumTest() { } /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnumEnum? outerEnum = default(OuterEnumEnum?)) { this.EnumStringRequired = enumStringRequired; this.EnumString = enumString; diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index fe1b1e00aa1a..b4c5508d27b2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -157,7 +157,7 @@ protected EnumTest() { } /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnumEnum? outerEnum = default(OuterEnumEnum?)) { // to ensure "enumStringRequired" is required (not null) if (enumStringRequired == null) diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 53327dc686a3..187402d66919 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -1029,7 +1029,7 @@ data EnumTest = EnumTest , enumTestEnumStringRequired :: !(E'EnumString) -- ^ /Required/ "enum_string_required" , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" - , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + , enumTestOuterEnum :: !(Maybe E'OuterEnum) -- ^ "outerEnum" } deriving (P.Show, P.Eq, P.Typeable) -- | FromJSON EnumTest diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 32c3b2159809..f0d3a8242003 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -424,7 +424,7 @@ enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTest {-# INLINE enumTestEnumNumberL #-} -- | 'enumTestOuterEnum' Lens -enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) +enumTestOuterEnumL :: Lens_' EnumTest (Maybe E'OuterEnum) enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum {-# INLINE enumTestOuterEnumL #-} diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index bb674c55b3a4..11b649916187 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -335,7 +335,7 @@ genEnumTest n = <*> arbitrary -- enumTestEnumStringRequired :: E'EnumString <*> arbitraryReducedMaybe n -- enumTestEnumInteger :: Maybe E'EnumInteger <*> arbitraryReducedMaybe n -- enumTestEnumNumber :: Maybe E'EnumNumber - <*> arbitraryReducedMaybe n -- enumTestOuterEnum :: Maybe OuterEnum + <*> arbitraryReducedMaybe n -- enumTestOuterEnum :: Maybe E'OuterEnum instance Arbitrary File where arbitrary = sized genFile 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/google-api-client/docs/EnumTest.md b/samples/client/petstore/java/google-api-client/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/google-api-client/docs/EnumTest.md +++ b/samples/client/petstore/java/google-api-client/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey1/docs/EnumTest.md b/samples/client/petstore/java/jersey1/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/jersey1/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey1/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 9449a2c904fc..80b62f7f587b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -196,8 +196,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -309,12 +346,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/native-async/docs/EnumTest.md b/samples/client/petstore/java/native-async/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/native-async/docs/EnumTest.md +++ b/samples/client/petstore/java/native-async/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index c0d90a44a474..b20e4eceac10 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/native/docs/EnumTest.md b/samples/client/petstore/java/native/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/native/docs/EnumTest.md +++ b/samples/client/petstore/java/native/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index c0d90a44a474..b20e4eceac10 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md index d97f8dba04b5..b5119dba94b6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -51,6 +51,16 @@ NUMBER_1_DOT_1 | 1.1 NUMBER_MINUS_1_DOT_2 | -1.2 + +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + ## Implemented Interfaces * Parcelable diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index ec8f394f2388..e9651f1bfb83 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -240,9 +240,58 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + @JsonAdapter(OuterEnumEnum.Adapter.class) + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumEnum read(final JsonReader jsonReader) throws IOException { + OuterEnum value = jsonReader.nextOuterEnum(); + return OuterEnumEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest() { } @@ -338,7 +387,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -351,12 +400,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } @@ -421,7 +470,7 @@ public void writeToParcel(Parcel out, int flags) { enumStringRequired = (EnumStringRequiredEnum)in.readValue(null); enumInteger = (EnumIntegerEnum)in.readValue(null); enumNumber = (EnumNumberEnum)in.readValue(null); - outerEnum = (OuterEnum)in.readValue(OuterEnum.class.getClassLoader()); + outerEnum = (OuterEnumEnum)in.readValue(OuterEnum.class.getClassLoader()); } public int describeContents() { diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index a25f521079b8..8e565012f605 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -238,9 +238,58 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + @JsonAdapter(OuterEnumEnum.Adapter.class) + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumEnum read(final JsonReader jsonReader) throws IOException { + OuterEnum value = jsonReader.nextOuterEnum(); + return OuterEnumEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -334,7 +383,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -347,12 +396,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md b/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 63d5d87e8680..99d858ca2207 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 @@ -195,8 +195,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -299,7 +336,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -315,12 +352,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/rest-assured/docs/EnumTest.md b/samples/client/petstore/java/rest-assured/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/rest-assured/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index d266824bf428..6203868a47cc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -241,9 +241,58 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + @JsonAdapter(OuterEnumEnum.Adapter.class) + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumEnum read(final JsonReader jsonReader) throws IOException { + OuterEnum value = jsonReader.nextOuterEnum(); + return OuterEnumEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -338,7 +387,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -352,12 +401,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/resteasy/docs/EnumTest.md b/samples/client/petstore/java/resteasy/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/resteasy/docs/EnumTest.md +++ b/samples/client/petstore/java/resteasy/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 87d2cf3265d5..4265405d0cff 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 @@ -201,9 +201,46 @@ public static EnumNumberEnum fromValue(Double value) { @XmlElement(name = "enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @XmlElement(name = "outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -309,7 +346,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -325,12 +362,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @JacksonXmlProperty(localName = "outerEnum") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/resttemplate/docs/EnumTest.md b/samples/client/petstore/java/resttemplate/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/resttemplate/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 ac65d1c25e43..9a55e3877c5e 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 @@ -194,8 +194,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -298,7 +335,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -314,12 +351,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index a25f521079b8..8e565012f605 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -238,9 +238,58 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + @JsonAdapter(OuterEnumEnum.Adapter.class) + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumEnum read(final JsonReader jsonReader) throws IOException { + OuterEnum value = jsonReader.nextOuterEnum(); + return OuterEnumEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -334,7 +383,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -347,12 +396,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index a25f521079b8..8e565012f605 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -238,9 +238,58 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + @JsonAdapter(OuterEnumEnum.Adapter.class) + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumEnum read(final JsonReader jsonReader) throws IOException { + OuterEnum value = jsonReader.nextOuterEnum(); + return OuterEnumEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -334,7 +383,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -347,12 +396,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index a25f521079b8..8e565012f605 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -238,9 +238,58 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + @JsonAdapter(OuterEnumEnum.Adapter.class) + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumEnum read(final JsonReader jsonReader) throws IOException { + OuterEnum value = jsonReader.nextOuterEnum(); + return OuterEnumEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; @SerializedName(SERIALIZED_NAME_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -334,7 +383,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -347,12 +396,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/vertx/docs/EnumTest.md b/samples/client/petstore/java/vertx/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/vertx/docs/EnumTest.md +++ b/samples/client/petstore/java/vertx/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/webclient/docs/EnumTest.md b/samples/client/petstore/java/webclient/docs/EnumTest.md index 61eb95f22fe9..d768f5c13d9b 100644 --- a/samples/client/petstore/java/webclient/docs/EnumTest.md +++ b/samples/client/petstore/java/webclient/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] @@ -52,3 +52,13 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + 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 75f53d11450c..2af44d4d4836 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 @@ -192,8 +192,45 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -295,7 +332,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; @@ -310,12 +347,12 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/javascript-es6/docs/EnumTest.md b/samples/client/petstore/javascript-es6/docs/EnumTest.md index b56c3c4cef63..a627ae908845 100644 --- a/samples/client/petstore/javascript-es6/docs/EnumTest.md +++ b/samples/client/petstore/javascript-es6/docs/EnumTest.md @@ -62,3 +62,55 @@ Name | Type | Description | Notes + +## Enum: OuterEnumEnum + + +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + + + + + +## Enum: OuterEnumIntegerEnum + + +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + + + + + +## Enum: OuterEnumDefaultValueEnum + + +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + + + + + +## Enum: OuterEnumIntegerDefaultValueEnum + + +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + + + + diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index dc684b7c26b1..471f8ef59dcf 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -105,22 +105,22 @@ EnumTest.prototype['enum_integer'] = undefined; EnumTest.prototype['enum_number'] = undefined; /** - * @member {module:model/OuterEnum} outerEnum + * @member {module:model/EnumTest.OuterEnumEnum} outerEnum */ EnumTest.prototype['outerEnum'] = undefined; /** - * @member {module:model/OuterEnumInteger} outerEnumInteger + * @member {module:model/EnumTest.OuterEnumIntegerEnum} outerEnumInteger */ EnumTest.prototype['outerEnumInteger'] = undefined; /** - * @member {module:model/OuterEnumDefaultValue} outerEnumDefaultValue + * @member {module:model/EnumTest.OuterEnumDefaultValueEnum} outerEnumDefaultValue */ EnumTest.prototype['outerEnumDefaultValue'] = undefined; /** - * @member {module:model/OuterEnumIntegerDefaultValue} outerEnumIntegerDefaultValue + * @member {module:model/EnumTest.OuterEnumIntegerDefaultValueEnum} outerEnumIntegerDefaultValue */ EnumTest.prototype['outerEnumIntegerDefaultValue'] = undefined; @@ -224,6 +224,114 @@ EnumTest['EnumNumberEnum'] = { }; +/** + * Allowed values for the outerEnum property. + * @enum {OuterEnum} + * @readonly + */ +EnumTest['OuterEnumEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + +/** + * Allowed values for the outerEnumInteger property. + * @enum {OuterEnumInteger} + * @readonly + */ +EnumTest['OuterEnumIntegerEnum'] = { + + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 +}; + + +/** + * Allowed values for the outerEnumDefaultValue property. + * @enum {OuterEnumDefaultValue} + * @readonly + */ +EnumTest['OuterEnumDefaultValueEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + +/** + * Allowed values for the outerEnumIntegerDefaultValue property. + * @enum {OuterEnumIntegerDefaultValue} + * @readonly + */ +EnumTest['OuterEnumIntegerDefaultValueEnum'] = { + + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 +}; + + export default EnumTest; diff --git a/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md b/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md index b56c3c4cef63..a627ae908845 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md +++ b/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md @@ -62,3 +62,55 @@ Name | Type | Description | Notes + +## Enum: OuterEnumEnum + + +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + + + + + +## Enum: OuterEnumIntegerEnum + + +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + + + + + +## Enum: OuterEnumDefaultValueEnum + + +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + + + + + +## Enum: OuterEnumIntegerDefaultValueEnum + + +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + + + + diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index dc684b7c26b1..471f8ef59dcf 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -105,22 +105,22 @@ EnumTest.prototype['enum_integer'] = undefined; EnumTest.prototype['enum_number'] = undefined; /** - * @member {module:model/OuterEnum} outerEnum + * @member {module:model/EnumTest.OuterEnumEnum} outerEnum */ EnumTest.prototype['outerEnum'] = undefined; /** - * @member {module:model/OuterEnumInteger} outerEnumInteger + * @member {module:model/EnumTest.OuterEnumIntegerEnum} outerEnumInteger */ EnumTest.prototype['outerEnumInteger'] = undefined; /** - * @member {module:model/OuterEnumDefaultValue} outerEnumDefaultValue + * @member {module:model/EnumTest.OuterEnumDefaultValueEnum} outerEnumDefaultValue */ EnumTest.prototype['outerEnumDefaultValue'] = undefined; /** - * @member {module:model/OuterEnumIntegerDefaultValue} outerEnumIntegerDefaultValue + * @member {module:model/EnumTest.OuterEnumIntegerDefaultValueEnum} outerEnumIntegerDefaultValue */ EnumTest.prototype['outerEnumIntegerDefaultValue'] = undefined; @@ -224,6 +224,114 @@ EnumTest['EnumNumberEnum'] = { }; +/** + * Allowed values for the outerEnum property. + * @enum {OuterEnum} + * @readonly + */ +EnumTest['OuterEnumEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + +/** + * Allowed values for the outerEnumInteger property. + * @enum {OuterEnumInteger} + * @readonly + */ +EnumTest['OuterEnumIntegerEnum'] = { + + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 +}; + + +/** + * Allowed values for the outerEnumDefaultValue property. + * @enum {OuterEnumDefaultValue} + * @readonly + */ +EnumTest['OuterEnumDefaultValueEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + +/** + * Allowed values for the outerEnumIntegerDefaultValue property. + * @enum {OuterEnumIntegerDefaultValue} + * @readonly + */ +EnumTest['OuterEnumIntegerDefaultValueEnum'] = { + + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 +}; + + export default EnumTest; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 005a3fea0b3c..e5c12380340c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -203,6 +203,18 @@ public function getModelName() const ENUM_INTEGER_MINUS_1 = -1; const ENUM_NUMBER_1_DOT_1 = 1.1; const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; + const OUTER_ENUM_PLACED = 'placed'; + const OUTER_ENUM_APPROVED = 'approved'; + const OUTER_ENUM_DELIVERED = 'delivered'; + const OUTER_ENUM_INTEGER__0 = '0'; + const OUTER_ENUM_INTEGER__1 = '1'; + const OUTER_ENUM_INTEGER__2 = '2'; + const OUTER_ENUM_DEFAULT_VALUE_PLACED = 'placed'; + const OUTER_ENUM_DEFAULT_VALUE_APPROVED = 'approved'; + const OUTER_ENUM_DEFAULT_VALUE_DELIVERED = 'delivered'; + const OUTER_ENUM_INTEGER_DEFAULT_VALUE__0 = '0'; + const OUTER_ENUM_INTEGER_DEFAULT_VALUE__1 = '1'; + const OUTER_ENUM_INTEGER_DEFAULT_VALUE__2 = '2'; @@ -260,6 +272,62 @@ public function getEnumNumberAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOuterEnumAllowableValues() + { + return [ + self::OUTER_ENUM_PLACED, + self::OUTER_ENUM_APPROVED, + self::OUTER_ENUM_DELIVERED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOuterEnumIntegerAllowableValues() + { + return [ + self::OUTER_ENUM_INTEGER__0, + self::OUTER_ENUM_INTEGER__1, + self::OUTER_ENUM_INTEGER__2, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOuterEnumDefaultValueAllowableValues() + { + return [ + self::OUTER_ENUM_DEFAULT_VALUE_PLACED, + self::OUTER_ENUM_DEFAULT_VALUE_APPROVED, + self::OUTER_ENUM_DEFAULT_VALUE_DELIVERED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOuterEnumIntegerDefaultValueAllowableValues() + { + return [ + self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__0, + self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__1, + self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__2, + ]; + } + /** * Associative array for storing property values @@ -330,6 +398,38 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getOuterEnumAllowableValues(); + if (!is_null($this->container['outer_enum']) && !in_array($this->container['outer_enum'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'outer_enum', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getOuterEnumIntegerAllowableValues(); + if (!is_null($this->container['outer_enum_integer']) && !in_array($this->container['outer_enum_integer'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'outer_enum_integer', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getOuterEnumDefaultValueAllowableValues(); + if (!is_null($this->container['outer_enum_default_value']) && !in_array($this->container['outer_enum_default_value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'outer_enum_default_value', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getOuterEnumIntegerDefaultValueAllowableValues(); + if (!is_null($this->container['outer_enum_integer_default_value']) && !in_array($this->container['outer_enum_integer_default_value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'outer_enum_integer_default_value', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -496,6 +596,15 @@ public function getOuterEnum() */ public function setOuterEnum($outer_enum) { + $allowedValues = $this->getOuterEnumAllowableValues(); + if (!is_null($outer_enum) && !in_array($outer_enum, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'outer_enum', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } $this->container['outer_enum'] = $outer_enum; return $this; @@ -520,6 +629,15 @@ public function getOuterEnumInteger() */ public function setOuterEnumInteger($outer_enum_integer) { + $allowedValues = $this->getOuterEnumIntegerAllowableValues(); + if (!is_null($outer_enum_integer) && !in_array($outer_enum_integer, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'outer_enum_integer', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } $this->container['outer_enum_integer'] = $outer_enum_integer; return $this; @@ -544,6 +662,15 @@ public function getOuterEnumDefaultValue() */ public function setOuterEnumDefaultValue($outer_enum_default_value) { + $allowedValues = $this->getOuterEnumDefaultValueAllowableValues(); + if (!is_null($outer_enum_default_value) && !in_array($outer_enum_default_value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'outer_enum_default_value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } $this->container['outer_enum_default_value'] = $outer_enum_default_value; return $this; @@ -568,6 +695,15 @@ public function getOuterEnumIntegerDefaultValue() */ public function setOuterEnumIntegerDefaultValue($outer_enum_integer_default_value) { + $allowedValues = $this->getOuterEnumIntegerDefaultValueAllowableValues(); + if (!is_null($outer_enum_integer_default_value) && !in_array($outer_enum_integer_default_value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'outer_enum_integer_default_value', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } $this->container['outer_enum_integer_default_value'] = $outer_enum_integer_default_value; return $this; diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py index e9872c4d005a..f1706b127fe5 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/enum_test.py @@ -199,6 +199,12 @@ def outer_enum(self, outer_enum): :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 :type outer_enum: OuterEnum """ + allowed_values = [placed, approved, delivered] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum, allowed_values) + ) self._outer_enum = outer_enum diff --git a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py index e9872c4d005a..f1706b127fe5 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/enum_test.py @@ -199,6 +199,12 @@ def outer_enum(self, outer_enum): :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 :type outer_enum: OuterEnum """ + allowed_values = [placed, approved, delivered] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum, allowed_values) + ) self._outer_enum = outer_enum diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index e9872c4d005a..f1706b127fe5 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -199,6 +199,12 @@ def outer_enum(self, outer_enum): :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 :type outer_enum: OuterEnum """ + allowed_values = [placed, approved, delivered] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum, allowed_values) + ) self._outer_enum = outer_enum diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 473d7994ad6d..8dbb710e14ab 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -158,6 +158,14 @@ def valid? return false unless enum_integer_validator.valid?(@enum_integer) enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) + outer_enum_validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + return false unless outer_enum_validator.valid?(@outer_enum) + outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + return false unless outer_enum_integer_validator.valid?(@outer_enum_integer) + outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + return false unless outer_enum_default_value_validator.valid?(@outer_enum_default_value) + outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + return false unless outer_enum_integer_default_value_validator.valid?(@outer_enum_integer_default_value) true end @@ -201,6 +209,46 @@ def enum_number=(enum_number) @enum_number = enum_number end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum Object to be assigned + def outer_enum=(outer_enum) + validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + unless validator.valid?(outer_enum) + fail ArgumentError, "invalid value for \"outer_enum\", must be one of #{validator.allowable_values}." + end + @outer_enum = outer_enum + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum_integer Object to be assigned + def outer_enum_integer=(outer_enum_integer) + validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + unless validator.valid?(outer_enum_integer) + fail ArgumentError, "invalid value for \"outer_enum_integer\", must be one of #{validator.allowable_values}." + end + @outer_enum_integer = outer_enum_integer + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum_default_value Object to be assigned + def outer_enum_default_value=(outer_enum_default_value) + validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + unless validator.valid?(outer_enum_default_value) + fail ArgumentError, "invalid value for \"outer_enum_default_value\", must be one of #{validator.allowable_values}." + end + @outer_enum_default_value = outer_enum_default_value + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum_integer_default_value Object to be assigned + def outer_enum_integer_default_value=(outer_enum_integer_default_value) + validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + unless validator.valid?(outer_enum_integer_default_value) + fail ArgumentError, "invalid value for \"outer_enum_integer_default_value\", must be one of #{validator.allowable_values}." + end + @outer_enum_integer_default_value = outer_enum_integer_default_value + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 473d7994ad6d..8dbb710e14ab 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -158,6 +158,14 @@ def valid? return false unless enum_integer_validator.valid?(@enum_integer) enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) + outer_enum_validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + return false unless outer_enum_validator.valid?(@outer_enum) + outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + return false unless outer_enum_integer_validator.valid?(@outer_enum_integer) + outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + return false unless outer_enum_default_value_validator.valid?(@outer_enum_default_value) + outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + return false unless outer_enum_integer_default_value_validator.valid?(@outer_enum_integer_default_value) true end @@ -201,6 +209,46 @@ def enum_number=(enum_number) @enum_number = enum_number end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum Object to be assigned + def outer_enum=(outer_enum) + validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + unless validator.valid?(outer_enum) + fail ArgumentError, "invalid value for \"outer_enum\", must be one of #{validator.allowable_values}." + end + @outer_enum = outer_enum + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum_integer Object to be assigned + def outer_enum_integer=(outer_enum_integer) + validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + unless validator.valid?(outer_enum_integer) + fail ArgumentError, "invalid value for \"outer_enum_integer\", must be one of #{validator.allowable_values}." + end + @outer_enum_integer = outer_enum_integer + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum_default_value Object to be assigned + def outer_enum_default_value=(outer_enum_default_value) + validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + unless validator.valid?(outer_enum_default_value) + fail ArgumentError, "invalid value for \"outer_enum_default_value\", must be one of #{validator.allowable_values}." + end + @outer_enum_default_value = outer_enum_default_value + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] outer_enum_integer_default_value Object to be assigned + def outer_enum_integer_default_value=(outer_enum_integer_default_value) + validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + unless validator.valid?(outer_enum_integer_default_value) + fail ArgumentError, "invalid value for \"outer_enum_integer_default_value\", must be one of #{validator.allowable_values}." + end + @outer_enum_integer_default_value = outer_enum_integer_default_value + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES index c4f1df469e4b..ff52c7c5b2b8 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES @@ -5,10 +5,10 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES index 914f5ced854a..d24a1934784b 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES @@ -5,12 +5,12 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts package.json tsconfig.json diff --git a/samples/openapi3/client/elm/src/Api/Data.elm b/samples/openapi3/client/elm/src/Api/Data.elm index df7113ce37b7..78cab488dbd4 100644 --- a/samples/openapi3/client/elm/src/Api/Data.elm +++ b/samples/openapi3/client/elm/src/Api/Data.elm @@ -15,7 +15,7 @@ module Api.Data exposing ( Absent - , Array + , Array, ArrayArrayOfEnum(..), arrayArrayOfEnumVariants , Composed , ComposedBase , Discriminated(..) @@ -92,10 +92,24 @@ type alias Array = { array : List (String) , arrayOfArray : List (List (String)) , arrayOfPrimitve : Maybe (List (Primitive)) - , arrayOfEnum : Maybe (List (Enum)) + , arrayOfEnum : Maybe (List ArrayArrayOfEnum) } +type ArrayArrayOfEnum + = ArrayArrayOfEnumFoo + | ArrayArrayOfEnumBar + | ArrayArrayOfEnumBaz + + +arrayArrayOfEnumVariants : List ArrayArrayOfEnum +arrayArrayOfEnumVariants = + [ ArrayArrayOfEnumFoo + , ArrayArrayOfEnumBar + , ArrayArrayOfEnumBaz + ] + + {-| Composed model -} type alias Composed = @@ -298,11 +312,29 @@ encodeArrayPairs model = [ encode "array" (Json.Encode.list Json.Encode.string) model.array , encode "arrayOfArray" (Json.Encode.list (Json.Encode.list Json.Encode.string)) model.arrayOfArray , maybeEncode "arrayOfPrimitve" (Json.Encode.list encodePrimitive) model.arrayOfPrimitve - , maybeEncode "arrayOfEnum" (Json.Encode.list encodeEnum) model.arrayOfEnum + , maybeEncode "arrayOfEnum" (Json.Encode.list encodeArrayArrayOfEnum) model.arrayOfEnum ] in pairs +stringFromArrayArrayOfEnum : ArrayArrayOfEnum -> String +stringFromArrayArrayOfEnum model = + case model of + ArrayArrayOfEnumFoo -> + "foo" + + ArrayArrayOfEnumBar -> + "bar" + + ArrayArrayOfEnumBaz -> + "baz" + + +encodeArrayArrayOfEnum : ArrayArrayOfEnum -> Json.Encode.Value +encodeArrayArrayOfEnum = + Json.Encode.int << intFromArrayArrayOfEnum + + encodeComposed : Composed -> Json.Encode.Value encodeComposed = @@ -647,7 +679,28 @@ arrayDecoder = |> decode "array" (Json.Decode.list Json.Decode.string) |> decode "arrayOfArray" (Json.Decode.list (Json.Decode.list Json.Decode.string)) |> maybeDecode "arrayOfPrimitve" (Json.Decode.list primitiveDecoder) Nothing - |> maybeDecode "arrayOfEnum" (Json.Decode.list enumDecoder) Nothing + |> maybeDecode "arrayOfEnum" (Json.Decode.list arrayArrayOfEnumDecoder) Nothing + + +arrayArrayOfEnumDecoder : Json.Decode.Decoder ArrayArrayOfEnum +arrayArrayOfEnumDecoder = + Json.Decode.int + |> Json.Decode.andThen + (\value -> + case value of + "foo" -> + Json.Decode.succeed ArrayArrayOfEnumFoo + + "bar" -> + Json.Decode.succeed ArrayArrayOfEnumBar + + "baz" -> + Json.Decode.succeed ArrayArrayOfEnumBaz + + other -> + Json.Decode.fail <| "Unknown type: " ++ String.fromInt other + ) + composedDecoder : Json.Decode.Decoder Composed diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md index a1761a7cd725..d1933cab337f 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **OuterEnum** | Pointer to [**NullableOuterEnum**](OuterEnum.md) | | [optional] **OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to "placed"] -**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OUTERENUMINTEGERDEFAULTVALUE__0] +**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to 0] ## Methods diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go index d6da2e58bf99..cc669fca8c7c 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -34,7 +34,7 @@ func NewEnumTest(enumStringRequired string, ) *EnumTest { this.EnumStringRequired = enumStringRequired var outerEnumDefaultValue OuterEnumDefaultValue = "placed" this.OuterEnumDefaultValue = &outerEnumDefaultValue - var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 + var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = 0 this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue return &this } @@ -46,7 +46,7 @@ func NewEnumTestWithDefaults() *EnumTest { this := EnumTest{} var outerEnumDefaultValue OuterEnumDefaultValue = "placed" this.OuterEnumDefaultValue = &outerEnumDefaultValue - var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 + var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = 0 this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue return &this } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md index 1692bd664d04..46c00a8ecc72 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -10,10 +10,10 @@ Name | Type | Description | Notes **enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**outerEnum** | [**OuterEnumEnum**](#OuterEnumEnum) | | [optional] +**outerEnumInteger** | [**OuterEnumIntegerEnum**](#OuterEnumIntegerEnum) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValueEnum**](#OuterEnumDefaultValueEnum) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValueEnum**](#OuterEnumIntegerDefaultValueEnum) | | [optional] @@ -55,3 +55,43 @@ NUMBER_MINUS_1_DOT_2 | -1.2 +## Enum: OuterEnumEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + +## Enum: OuterEnumIntegerEnum + +Name | Value +---- | ----- +NUMBER_0 | 0 +NUMBER_1 | 1 +NUMBER_2 | 2 + + + +## Enum: OuterEnumDefaultValueEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + +## Enum: OuterEnumIntegerDefaultValueEnum + +Name | Value +---- | ----- +NUMBER_0 | 0 +NUMBER_1 | 1 +NUMBER_2 | 2 + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 631def3aa1a8..4864ee71687a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -205,17 +205,165 @@ public static EnumNumberEnum fromValue(Double value) { public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private JsonNullable outerEnum = JsonNullable.undefined(); + private JsonNullable outerEnum = JsonNullable.undefined(); + + /** + * Gets or Sets outerEnumInteger + */ + public enum OuterEnumIntegerEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private OuterEnumInteger value; + + OuterEnumIntegerEnum(OuterEnumInteger value) { + this.value = value; + } + + @JsonValue + public OuterEnumInteger getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerEnum fromValue(OuterEnumInteger value) { + for (OuterEnumIntegerEnum b : OuterEnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; - private OuterEnumInteger outerEnumInteger; + private OuterEnumIntegerEnum outerEnumInteger; + + /** + * Gets or Sets outerEnumDefaultValue + */ + public enum OuterEnumDefaultValueEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnumDefaultValue value; + + OuterEnumDefaultValueEnum(OuterEnumDefaultValue value) { + this.value = value; + } + + @JsonValue + public OuterEnumDefaultValue getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValueEnum fromValue(OuterEnumDefaultValue value) { + for (OuterEnumDefaultValueEnum b : OuterEnumDefaultValueEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; - private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumDefaultValueEnum outerEnumDefaultValue = OuterEnumDefaultValueEnum.PLACED; + + /** + * Gets or Sets outerEnumIntegerDefaultValue + */ + public enum OuterEnumIntegerDefaultValueEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private OuterEnumIntegerDefaultValue value; + + OuterEnumIntegerDefaultValueEnum(OuterEnumIntegerDefaultValue value) { + this.value = value; + } + + @JsonValue + public OuterEnumIntegerDefaultValue getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValueEnum fromValue(OuterEnumIntegerDefaultValue value) { + for (OuterEnumIntegerDefaultValueEnum b : OuterEnumIntegerDefaultValueEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; - private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueEnum.NUMBER_0; public EnumTest enumString(EnumStringEnum enumString) { @@ -313,8 +461,8 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { } - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = JsonNullable.of(outerEnum); + public EnumTest outerEnum(OuterEnumEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); return this; } @@ -326,28 +474,28 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @ApiModelProperty(value = "") @JsonIgnore - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum.orElse(null); } @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getOuterEnum_JsonNullable() { + public JsonNullable getOuterEnum_JsonNullable() { return outerEnum; } @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { + public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { this.outerEnum = outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = JsonNullable.of(outerEnum); + public void setOuterEnum(OuterEnumEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + public EnumTest outerEnumInteger(OuterEnumIntegerEnum outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; return this; } @@ -361,17 +509,17 @@ public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumInteger getOuterEnumInteger() { + public OuterEnumIntegerEnum getOuterEnumInteger() { return outerEnumInteger; } - public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + public void setOuterEnumInteger(OuterEnumIntegerEnum outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValueEnum outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; return this; } @@ -385,17 +533,17 @@ public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValu @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumDefaultValue getOuterEnumDefaultValue() { + public OuterEnumDefaultValueEnum getOuterEnumDefaultValue() { return outerEnumDefaultValue; } - public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + public void setOuterEnumDefaultValue(OuterEnumDefaultValueEnum outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; return this; } @@ -409,12 +557,12 @@ public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerE @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + public OuterEnumIntegerDefaultValueEnum getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; } - public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 302cc30d9798..4640ae87e326 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -61,6 +61,11 @@ class ArrayOfEnums(ModelSimple): """ allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, } validations = { diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py index 8af01fd85cc1..ed41ef719e2f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py @@ -213,6 +213,12 @@ def outer_enum(self, outer_enum): :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 :type outer_enum: OuterEnum """ + allowed_values = [None,placed, approved, delivered] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum, allowed_values) + ) self._outer_enum = outer_enum @@ -234,6 +240,12 @@ def outer_enum_integer(self, outer_enum_integer): :param outer_enum_integer: The outer_enum_integer of this EnumTest. # noqa: E501 :type outer_enum_integer: OuterEnumInteger """ + allowed_values = [0, 1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum_integer not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum_integer` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum_integer, allowed_values) + ) self._outer_enum_integer = outer_enum_integer @@ -255,6 +267,12 @@ def outer_enum_default_value(self, outer_enum_default_value): :param outer_enum_default_value: The outer_enum_default_value of this EnumTest. # noqa: E501 :type outer_enum_default_value: OuterEnumDefaultValue """ + allowed_values = [placed, approved, delivered] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum_default_value not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum_default_value` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum_default_value, allowed_values) + ) self._outer_enum_default_value = outer_enum_default_value @@ -276,6 +294,12 @@ def outer_enum_integer_default_value(self, outer_enum_integer_default_value): :param outer_enum_integer_default_value: The outer_enum_integer_default_value of this EnumTest. # noqa: E501 :type outer_enum_integer_default_value: OuterEnumIntegerDefaultValue """ + allowed_values = [0, 1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and outer_enum_integer_default_value not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `outer_enum_integer_default_value` ({0}), must be one of {1}" # noqa: E501 + .format(outer_enum_integer_default_value, allowed_values) + ) self._outer_enum_integer_default_value = outer_enum_integer_default_value diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java index 91fde1cca859..993b88ddb8b3 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java @@ -153,8 +153,41 @@ public static EnumNumberEnum fromValue(String text) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(String text) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -228,7 +261,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -238,11 +271,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * @return outerEnum **/ @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index 494916f5d250..9c22c0023937 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -152,8 +152,41 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -224,7 +257,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -234,11 +267,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * @return outerEnum **/ @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java index c50bae5b58fc..d0271a254ec3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java @@ -156,9 +156,41 @@ public static EnumNumberEnum fromValue(Double value) { @ApiModelProperty(value = "") private EnumNumberEnum enumNumber; +@XmlType(name="OuterEnumEnum") +@XmlEnum(OuterEnum.class) +public enum OuterEnumEnum { + +@XmlEnumValue("placed") PLACED(OuterEnum.valueOf("placed")), @XmlEnumValue("approved") APPROVED(OuterEnum.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(OuterEnum.valueOf("delivered")); + + + private OuterEnum value; + + OuterEnumEnum (OuterEnum v) { + value = v; + } + + public OuterEnum value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + @ApiModelProperty(value = "") @Valid - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; /** * Get enumString * @return enumString @@ -250,14 +282,17 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { **/ @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { - return outerEnum; + if (outerEnum == null) { + return null; + } + return outerEnum.value(); } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index 7dcca8375c27..c3df6cc3f5f2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -181,9 +181,42 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -265,7 +298,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -277,11 +310,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty("outerEnum") @ApiModelProperty(value = "") @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index afec49e3a591..2a5ec001fbb8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -186,21 +186,153 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; + + /** + * Gets or Sets outerEnumInteger + */ + public enum OuterEnumIntegerEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private OuterEnumInteger value; + + OuterEnumIntegerEnum(OuterEnumInteger value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerEnum fromValue(OuterEnumInteger value) { + for (OuterEnumIntegerEnum b : OuterEnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) - private OuterEnumInteger outerEnumInteger; + private OuterEnumIntegerEnum outerEnumInteger; + + /** + * Gets or Sets outerEnumDefaultValue + */ + public enum OuterEnumDefaultValueEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnumDefaultValue value; + + OuterEnumDefaultValueEnum(OuterEnumDefaultValue value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValueEnum fromValue(OuterEnumDefaultValue value) { + for (OuterEnumDefaultValueEnum b : OuterEnumDefaultValueEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) - private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumDefaultValueEnum outerEnumDefaultValue = OuterEnumDefaultValueEnum.PLACED; + + /** + * Gets or Sets outerEnumIntegerDefaultValue + */ + public enum OuterEnumIntegerDefaultValueEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private OuterEnumIntegerDefaultValue value; + + OuterEnumIntegerDefaultValueEnum(OuterEnumIntegerDefaultValue value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValueEnum fromValue(OuterEnumIntegerDefaultValue value) { + for (OuterEnumIntegerDefaultValueEnum b : OuterEnumIntegerDefaultValueEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) - private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueEnum.NUMBER_0; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -282,7 +414,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -294,15 +426,15 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty("outerEnum") @ApiModelProperty(value = "") @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + public EnumTest outerEnumInteger(OuterEnumIntegerEnum outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; return this; } @@ -314,15 +446,15 @@ public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { @JsonProperty("outerEnumInteger") @ApiModelProperty(value = "") @Valid - public OuterEnumInteger getOuterEnumInteger() { + public OuterEnumIntegerEnum getOuterEnumInteger() { return outerEnumInteger; } - public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + public void setOuterEnumInteger(OuterEnumIntegerEnum outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValueEnum outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; return this; } @@ -334,15 +466,15 @@ public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValu @JsonProperty("outerEnumDefaultValue") @ApiModelProperty(value = "") @Valid - public OuterEnumDefaultValue getOuterEnumDefaultValue() { + public OuterEnumDefaultValueEnum getOuterEnumDefaultValue() { return outerEnumDefaultValue; } - public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + public void setOuterEnumDefaultValue(OuterEnumDefaultValueEnum outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; return this; } @@ -354,11 +486,11 @@ public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerE @JsonProperty("outerEnumIntegerDefaultValue") @ApiModelProperty(value = "") @Valid - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + public OuterEnumIntegerDefaultValueEnum getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; } - public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java index b1148724a627..c6dbbb2d1d94 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java @@ -153,7 +153,40 @@ public static EnumNumberEnum fromValue(Double value) { } private @Valid EnumNumberEnum enumNumber; - private @Valid OuterEnum outerEnum; + +public enum OuterEnumEnum { + + PLACED(OuterEnum.valueOf("placed")), APPROVED(OuterEnum.valueOf("approved")), DELIVERED(OuterEnum.valueOf("delivered")); + + + private OuterEnum value; + + OuterEnumEnum (OuterEnum v) { + value = v; + } + + public OuterEnum value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid OuterEnumEnum outerEnum; /** **/ @@ -230,7 +263,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; }/** **/ - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -240,11 +273,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @ApiModelProperty(value = "") @JsonProperty("outerEnum") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index b1148724a627..c6dbbb2d1d94 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -153,7 +153,40 @@ public static EnumNumberEnum fromValue(Double value) { } private @Valid EnumNumberEnum enumNumber; - private @Valid OuterEnum outerEnum; + +public enum OuterEnumEnum { + + PLACED(OuterEnum.valueOf("placed")), APPROVED(OuterEnum.valueOf("approved")), DELIVERED(OuterEnum.valueOf("delivered")); + + + private OuterEnum value; + + OuterEnumEnum (OuterEnum v) { + value = v; + } + + public OuterEnum value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid OuterEnumEnum outerEnum; /** **/ @@ -230,7 +263,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; }/** **/ - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -240,11 +273,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @ApiModelProperty(value = "") @JsonProperty("outerEnum") - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index fde7f90b40be..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -180,9 +180,42 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -264,7 +297,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -276,11 +309,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty("outerEnum") @ApiModelProperty(value = "") @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index fde7f90b40be..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -180,9 +180,42 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -264,7 +297,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -276,11 +309,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty("outerEnum") @ApiModelProperty(value = "") @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index fde7f90b40be..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -180,9 +180,42 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -264,7 +297,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -276,11 +309,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty("outerEnum") @ApiModelProperty(value = "") @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index fde7f90b40be..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -180,9 +180,42 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -264,7 +297,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -276,11 +309,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @JsonProperty("outerEnum") @ApiModelProperty(value = "") @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES index b00a0510b77f..8c41d6e8cf56 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES @@ -1,26 +1,26 @@ -./Api/ApiServer.php -./Api/PetApiInterface.php -./Api/StoreApiInterface.php -./Api/UserApiInterface.php -./Controller/Controller.php -./Controller/PetController.php -./Controller/StoreController.php -./Controller/UserController.php -./Model/ApiResponse.php -./Model/Category.php -./Model/Order.php -./Model/Pet.php -./Model/Tag.php -./Model/User.php -./Service/JmsSerializer.php -./Service/SerializerInterface.php -./Service/StrictJsonDeserializationVisitor.php -./Service/SymfonyValidator.php -./Service/TypeMismatchException.php -./Service/ValidatorInterface.php -./Tests/AppKernel.php -./Tests/Controller/ControllerTest.php -./Tests/test_config.yml +Api/ApiServer.php +Api/PetApiInterface.php +Api/StoreApiInterface.php +Api/UserApiInterface.php +Controller/Controller.php +Controller/PetController.php +Controller/StoreController.php +Controller/UserController.php +Model/ApiResponse.php +Model/Category.php +Model/Order.php +Model/Pet.php +Model/Tag.php +Model/User.php +Service/JmsSerializer.php +Service/SerializerInterface.php +Service/StrictJsonDeserializationVisitor.php +Service/SymfonyValidator.php +Service/TypeMismatchException.php +Service/ValidatorInterface.php +Tests/AppKernel.php +Tests/Controller/ControllerTest.php +Tests/test_config.yml .coveralls.yml .gitignore .php_cs.dist diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index 12dd045e2160..146db762f542 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -2367,6 +2367,7 @@ pub struct EnumTest { #[serde(skip_serializing_if="Option::is_none")] pub enum_number: Option, + // Note: inline enums are not fully supported by openapi-generator #[serde(rename = "outerEnum")] #[serde(skip_serializing_if="Option::is_none")] pub outer_enum: Option, diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 9e9ebbeee36a..49566a8f77c6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index 36de994dfa0f..135388b9fba1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -172,8 +172,45 @@ public static EnumNumberEnum fromValue(Double value) { @JsonProperty("enum_number") private EnumNumberEnum enumNumber; + /** + * Gets or Sets outerEnum + */ + public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private OuterEnum value; + + OuterEnumEnum(OuterEnum value) { + this.value = value; + } + + @JsonValue + public OuterEnum getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumEnum fromValue(OuterEnum value) { + for (OuterEnumEnum b : OuterEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnumEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -256,7 +293,7 @@ public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { + public EnumTest outerEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -269,11 +306,11 @@ public EnumTest outerEnum(OuterEnum outerEnum) { @Valid - public OuterEnum getOuterEnum() { + public OuterEnumEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { + public void setOuterEnum(OuterEnumEnum outerEnum) { this.outerEnum = outerEnum; } From 24306194feb5d26cf25b71f333d3f5745c31a165 Mon Sep 17 00:00:00 2001 From: Luke Marlin Date: Fri, 3 Jul 2020 22:28:35 +0200 Subject: [PATCH 2/3] Keep backward compatible behaviour --- .../openapitools/codegen/DefaultCodegen.java | 11 +-- .../languages/HaskellHttpClientCodegen.java | 2 +- .../lib/OpenAPIPetstore/Model.hs | 71 ++----------------- .../openapitools/client/model/EnumTest.java | 5 -- .../java/google-api-client/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/java/jersey1/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/jersey2-java8/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/native-async/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/java/native/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/okhttp-gson/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../rest-assured-jackson/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/rest-assured/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/java/resteasy/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../resttemplate-withXml/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/resttemplate/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/retrofit2-play26/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/java/retrofit2/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/retrofit2rx2/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../java/retrofit2rx3/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/java/vertx/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/java/webclient/docs/EnumTest.md | 3 - .../openapitools/client/model/EnumTest.java | 5 -- .../petstore/javascript-es6/docs/EnumTest.md | 24 ------- .../javascript-es6/src/model/EnumTest.js | 68 ------------------ .../javascript-promise-es6/docs/EnumTest.md | 24 ------- .../src/model/EnumTest.js | 68 ------------------ .../OpenAPIClient-php/lib/Model/EnumTest.php | 28 ++------ .../lib/petstore/models/enum_test.rb | 16 ++--- .../ruby/lib/petstore/models/enum_test.rb | 16 ++--- samples/openapi3/client/elm/src/Api/Data.elm | 24 ------- .../java/jersey2-java8/docs/EnumTest.md | 12 ---- .../openapitools/client/model/EnumTest.java | 24 +------ .../java/org/openapitools/model/EnumTest.java | 5 -- .../app/apimodels/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 24 +------ .../java/org/openapitools/model/EnumTest.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- .../virtualan/model/EnumTest.java | 5 -- .../java/org/openapitools/model/EnumTest.java | 5 -- 72 files changed, 42 insertions(+), 615 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index ea1dd54ef4c1..38413887117e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4594,13 +4594,13 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera * of the 'additionalProperties' keyword. Some language generator use class inheritance * to implement additional properties. For example, in Java the generated model class * has 'extends HashMap' to represent the additional properties. - * + * * TODO: it's not a good idea to use single class inheritance to implement * additionalProperties. That may work for non-composed schemas, but that does not * work for composed 'allOf' schemas. For example, in Java, if additionalProperties * is set to true (which it should be by default, per OAS spec), then the generated * code has extends HashMap. That wouldn't work for composed 'allOf' schemas. - * + * * @param model the codegen representation of the OAS schema. * @param name the name of the model. * @param schema the input OAS schema. @@ -5258,6 +5258,9 @@ public void setParameterBooleanFlagWithCodegenProperty(CodegenParameter paramete * @param var list of CodegenProperty */ public void updateCodegenPropertyEnum(CodegenProperty var) { + if (!var.isPrimitiveType) { + return; + } Map allowableValues = var.allowableValues; // handle array @@ -6455,7 +6458,7 @@ protected boolean isFreeFormObject(Schema schema) { /** * Returns the additionalProperties Schema for the specified input schema. - * + * * The additionalProperties keyword is used to control the handling of additional, undeclared * properties, that is, properties whose names are not listed in the properties keyword. * The additionalProperties keyword may be either a boolean or an object. @@ -6463,7 +6466,7 @@ protected boolean isFreeFormObject(Schema schema) { * By default when the additionalProperties keyword is not specified in the input schema, * any additional properties are allowed. This is equivalent to setting additionalProperties * to the boolean value True or setting additionalProperties: {} - * + * * @param schema the input schema that may or may not have the additionalProperties keyword. * @return the Schema of the additionalProperties. The null value is returned if no additional * properties are allowed. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index b6977acca7e1..451e3cc89ee9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -1373,7 +1373,7 @@ public void updateCodegenPropertyEnumValues(CodegenProperty var, String paramNam } private void updateAllowableValuesNames(String paramNameType, Map allowableValues) { - if (allowableValues == null) { + if (allowableValues == null || allowableValues.get("enumVars") == null) { return; } for (Map enumVar : (List>) allowableValues.get("enumVars")) { diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 187402d66919..81f06f28aa7a 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -2101,9 +2101,7 @@ toE'EnumFormStringArray = \case -- | Enum of 'Int' data E'EnumInteger - = E'EnumInteger'Num1 -- ^ @1@ - | E'EnumInteger'NumMinus_1 -- ^ @-1@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o @@ -2114,14 +2112,10 @@ instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mim -- | unwrap 'E'EnumInteger' enum fromE'EnumInteger :: E'EnumInteger -> Int fromE'EnumInteger = \case - E'EnumInteger'Num1 -> 1 - E'EnumInteger'NumMinus_1 -> -1 -- | parse 'E'EnumInteger' enum toE'EnumInteger :: Int -> P.Either String E'EnumInteger toE'EnumInteger = \case - 1 -> P.Right E'EnumInteger'Num1 - -1 -> P.Right E'EnumInteger'NumMinus_1 s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s @@ -2129,9 +2123,7 @@ toE'EnumInteger = \case -- | Enum of 'Double' data E'EnumNumber - = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ - | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o @@ -2142,14 +2134,10 @@ instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mime -- | unwrap 'E'EnumNumber' enum fromE'EnumNumber :: E'EnumNumber -> Double fromE'EnumNumber = \case - E'EnumNumber'Num1_Dot_1 -> 1.1 - E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 -- | parse 'E'EnumNumber' enum toE'EnumNumber :: Double -> P.Either String E'EnumNumber toE'EnumNumber = \case - 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 - -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s @@ -2185,10 +2173,7 @@ toE'EnumQueryInteger = \case -- | Enum of 'Text' data E'EnumString - = E'EnumString'UPPER -- ^ @"UPPER"@ - | E'EnumString'Lower -- ^ @"lower"@ - | E'EnumString'Empty -- ^ @""@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o @@ -2199,16 +2184,10 @@ instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mime -- | unwrap 'E'EnumString' enum fromE'EnumString :: E'EnumString -> Text fromE'EnumString = \case - E'EnumString'UPPER -> "UPPER" - E'EnumString'Lower -> "lower" - E'EnumString'Empty -> "" -- | parse 'E'EnumString' enum toE'EnumString :: Text -> P.Either String E'EnumString toE'EnumString = \case - "UPPER" -> P.Right E'EnumString'UPPER - "lower" -> P.Right E'EnumString'Lower - "" -> P.Right E'EnumString'Empty s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s @@ -2244,9 +2223,7 @@ toE'Inner = \case -- | Enum of 'Text' data E'JustSymbol - = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ - | E'JustSymbol'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o @@ -2257,14 +2234,10 @@ instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mime -- | unwrap 'E'JustSymbol' enum fromE'JustSymbol :: E'JustSymbol -> Text fromE'JustSymbol = \case - E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" - E'JustSymbol'Dollar -> "$" -- | parse 'E'JustSymbol' enum toE'JustSymbol :: Text -> P.Either String E'JustSymbol toE'JustSymbol = \case - ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To - "$" -> P.Right E'JustSymbol'Dollar s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s @@ -2272,11 +2245,7 @@ toE'JustSymbol = \case -- | Enum of 'Text' data E'Kind - = E'Kind'Lions -- ^ @"lions"@ - | E'Kind'Tigers -- ^ @"tigers"@ - | E'Kind'Leopards -- ^ @"leopards"@ - | E'Kind'Jaguars -- ^ @"jaguars"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'Kind where toJSON = A.toJSON . fromE'Kind instance A.FromJSON E'Kind where parseJSON o = P.either P.fail (pure . P.id) . toE'Kind =<< A.parseJSON o @@ -2287,18 +2256,10 @@ instance MimeRender MimeMultipartFormData E'Kind where mimeRender _ = mimeRender -- | unwrap 'E'Kind' enum fromE'Kind :: E'Kind -> Text fromE'Kind = \case - E'Kind'Lions -> "lions" - E'Kind'Tigers -> "tigers" - E'Kind'Leopards -> "leopards" - E'Kind'Jaguars -> "jaguars" -- | parse 'E'Kind' enum toE'Kind :: Text -> P.Either String E'Kind toE'Kind = \case - "lions" -> P.Right E'Kind'Lions - "tigers" -> P.Right E'Kind'Tigers - "leopards" -> P.Right E'Kind'Leopards - "jaguars" -> P.Right E'Kind'Jaguars s -> P.Left $ "toE'Kind: enum parse failure: " P.++ P.show s @@ -2307,10 +2268,7 @@ toE'Kind = \case -- | Enum of 'Text' . -- Order Status data E'Status - = E'Status'Placed -- ^ @"placed"@ - | E'Status'Approved -- ^ @"approved"@ - | E'Status'Delivered -- ^ @"delivered"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o @@ -2321,16 +2279,10 @@ instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRend -- | unwrap 'E'Status' enum fromE'Status :: E'Status -> Text fromE'Status = \case - E'Status'Placed -> "placed" - E'Status'Approved -> "approved" - E'Status'Delivered -> "delivered" -- | parse 'E'Status' enum toE'Status :: Text -> P.Either String E'Status toE'Status = \case - "placed" -> P.Right E'Status'Placed - "approved" -> P.Right E'Status'Approved - "delivered" -> P.Right E'Status'Delivered s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s @@ -2339,10 +2291,7 @@ toE'Status = \case -- | Enum of 'Text' . -- pet status in the store data E'Status2 - = E'Status2'Available -- ^ @"available"@ - | E'Status2'Pending -- ^ @"pending"@ - | E'Status2'Sold -- ^ @"sold"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + = instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o @@ -2353,16 +2302,10 @@ instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRen -- | unwrap 'E'Status2' enum fromE'Status2 :: E'Status2 -> Text fromE'Status2 = \case - E'Status2'Available -> "available" - E'Status2'Pending -> "pending" - E'Status2'Sold -> "sold" -- | parse 'E'Status2' enum toE'Status2 :: Text -> P.Either String E'Status2 toE'Status2 = \case - "available" -> P.Right E'Status2'Available - "pending" -> P.Right E'Status2'Pending - "sold" -> P.Right E'Status2'Sold s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/google-api-client/docs/EnumTest.md b/samples/client/petstore/java/google-api-client/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/google-api-client/docs/EnumTest.md +++ b/samples/client/petstore/java/google-api-client/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/jersey1/docs/EnumTest.md b/samples/client/petstore/java/jersey1/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/jersey1/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey1/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 80b62f7f587b..73fa5f53cdfd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -200,11 +200,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/native-async/docs/EnumTest.md b/samples/client/petstore/java/native-async/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/native-async/docs/EnumTest.md +++ b/samples/client/petstore/java/native-async/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index b20e4eceac10..a8d63bfcb31a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/native/docs/EnumTest.md b/samples/client/petstore/java/native/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/native/docs/EnumTest.md +++ b/samples/client/petstore/java/native/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index b20e4eceac10..a8d63bfcb31a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md index b5119dba94b6..71c1bc617253 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" ## Implemented Interfaces diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index e9651f1bfb83..e8464732c513 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -245,11 +245,6 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index 8e565012f605..712a68beef06 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,11 +243,6 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md b/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 99d858ca2207..7808e56bf9d4 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 @@ -199,11 +199,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/rest-assured/docs/EnumTest.md b/samples/client/petstore/java/rest-assured/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/rest-assured/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 6203868a47cc..53d4f0b7baca 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -246,11 +246,6 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/resteasy/docs/EnumTest.md b/samples/client/petstore/java/resteasy/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/resteasy/docs/EnumTest.md +++ b/samples/client/petstore/java/resteasy/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 4265405d0cff..eb014a0155db 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 @@ -205,11 +205,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/resttemplate/docs/EnumTest.md b/samples/client/petstore/java/resttemplate/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/resttemplate/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 9a55e3877c5e..f68de6063f98 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 @@ -198,11 +198,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/retrofit2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index 8e565012f605..712a68beef06 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,11 +243,6 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index 8e565012f605..712a68beef06 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,11 +243,6 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index 8e565012f605..712a68beef06 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,11 +243,6 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/vertx/docs/EnumTest.md b/samples/client/petstore/java/vertx/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/vertx/docs/EnumTest.md +++ b/samples/client/petstore/java/vertx/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/webclient/docs/EnumTest.md b/samples/client/petstore/java/webclient/docs/EnumTest.md index d768f5c13d9b..ccdc69987c7e 100644 --- a/samples/client/petstore/java/webclient/docs/EnumTest.md +++ b/samples/client/petstore/java/webclient/docs/EnumTest.md @@ -56,9 +56,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" 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 2af44d4d4836..63c42775d5be 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 @@ -196,11 +196,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/javascript-es6/docs/EnumTest.md b/samples/client/petstore/javascript-es6/docs/EnumTest.md index a627ae908845..ef5767e13e9e 100644 --- a/samples/client/petstore/javascript-es6/docs/EnumTest.md +++ b/samples/client/petstore/javascript-es6/docs/EnumTest.md @@ -66,12 +66,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumEnum -* `placed` (value: `"placed"`) - -* `approved` (value: `"approved"`) - -* `delivered` (value: `"delivered"`) - @@ -79,12 +73,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerEnum -* `0` (value: `0`) - -* `1` (value: `1`) - -* `2` (value: `2`) - @@ -92,12 +80,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumDefaultValueEnum -* `placed` (value: `"placed"`) - -* `approved` (value: `"approved"`) - -* `delivered` (value: `"delivered"`) - @@ -105,12 +87,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerDefaultValueEnum -* `0` (value: `0`) - -* `1` (value: `1`) - -* `2` (value: `2`) - diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index 471f8ef59dcf..4926284120f8 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -231,23 +231,6 @@ EnumTest['EnumNumberEnum'] = { */ EnumTest['OuterEnumEnum'] = { - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; @@ -258,23 +241,6 @@ EnumTest['OuterEnumEnum'] = { */ EnumTest['OuterEnumIntegerEnum'] = { - /** - * value: 0 - * @const - */ - "0": 0, - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: 2 - * @const - */ - "2": 2 }; @@ -285,23 +251,6 @@ EnumTest['OuterEnumIntegerEnum'] = { */ EnumTest['OuterEnumDefaultValueEnum'] = { - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; @@ -312,23 +261,6 @@ EnumTest['OuterEnumDefaultValueEnum'] = { */ EnumTest['OuterEnumIntegerDefaultValueEnum'] = { - /** - * value: 0 - * @const - */ - "0": 0, - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: 2 - * @const - */ - "2": 2 }; diff --git a/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md b/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md index a627ae908845..ef5767e13e9e 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md +++ b/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md @@ -66,12 +66,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumEnum -* `placed` (value: `"placed"`) - -* `approved` (value: `"approved"`) - -* `delivered` (value: `"delivered"`) - @@ -79,12 +73,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerEnum -* `0` (value: `0`) - -* `1` (value: `1`) - -* `2` (value: `2`) - @@ -92,12 +80,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumDefaultValueEnum -* `placed` (value: `"placed"`) - -* `approved` (value: `"approved"`) - -* `delivered` (value: `"delivered"`) - @@ -105,12 +87,6 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerDefaultValueEnum -* `0` (value: `0`) - -* `1` (value: `1`) - -* `2` (value: `2`) - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index 471f8ef59dcf..4926284120f8 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -231,23 +231,6 @@ EnumTest['EnumNumberEnum'] = { */ EnumTest['OuterEnumEnum'] = { - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; @@ -258,23 +241,6 @@ EnumTest['OuterEnumEnum'] = { */ EnumTest['OuterEnumIntegerEnum'] = { - /** - * value: 0 - * @const - */ - "0": 0, - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: 2 - * @const - */ - "2": 2 }; @@ -285,23 +251,6 @@ EnumTest['OuterEnumIntegerEnum'] = { */ EnumTest['OuterEnumDefaultValueEnum'] = { - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" }; @@ -312,23 +261,6 @@ EnumTest['OuterEnumDefaultValueEnum'] = { */ EnumTest['OuterEnumIntegerDefaultValueEnum'] = { - /** - * value: 0 - * @const - */ - "0": 0, - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: 2 - * @const - */ - "2": 2 }; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index e5c12380340c..97eade7a3893 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -203,18 +203,6 @@ public function getModelName() const ENUM_INTEGER_MINUS_1 = -1; const ENUM_NUMBER_1_DOT_1 = 1.1; const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; - const OUTER_ENUM_PLACED = 'placed'; - const OUTER_ENUM_APPROVED = 'approved'; - const OUTER_ENUM_DELIVERED = 'delivered'; - const OUTER_ENUM_INTEGER__0 = '0'; - const OUTER_ENUM_INTEGER__1 = '1'; - const OUTER_ENUM_INTEGER__2 = '2'; - const OUTER_ENUM_DEFAULT_VALUE_PLACED = 'placed'; - const OUTER_ENUM_DEFAULT_VALUE_APPROVED = 'approved'; - const OUTER_ENUM_DEFAULT_VALUE_DELIVERED = 'delivered'; - const OUTER_ENUM_INTEGER_DEFAULT_VALUE__0 = '0'; - const OUTER_ENUM_INTEGER_DEFAULT_VALUE__1 = '1'; - const OUTER_ENUM_INTEGER_DEFAULT_VALUE__2 = '2'; @@ -280,9 +268,7 @@ public function getEnumNumberAllowableValues() public function getOuterEnumAllowableValues() { return [ - self::OUTER_ENUM_PLACED, - self::OUTER_ENUM_APPROVED, - self::OUTER_ENUM_DELIVERED, + ]; } @@ -294,9 +280,7 @@ public function getOuterEnumAllowableValues() public function getOuterEnumIntegerAllowableValues() { return [ - self::OUTER_ENUM_INTEGER__0, - self::OUTER_ENUM_INTEGER__1, - self::OUTER_ENUM_INTEGER__2, + ]; } @@ -308,9 +292,7 @@ public function getOuterEnumIntegerAllowableValues() public function getOuterEnumDefaultValueAllowableValues() { return [ - self::OUTER_ENUM_DEFAULT_VALUE_PLACED, - self::OUTER_ENUM_DEFAULT_VALUE_APPROVED, - self::OUTER_ENUM_DEFAULT_VALUE_DELIVERED, + ]; } @@ -322,9 +304,7 @@ public function getOuterEnumDefaultValueAllowableValues() public function getOuterEnumIntegerDefaultValueAllowableValues() { return [ - self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__0, - self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__1, - self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__2, + ]; } diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 8dbb710e14ab..f695e15f6ff4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -158,13 +158,13 @@ def valid? return false unless enum_integer_validator.valid?(@enum_integer) enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) - outer_enum_validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + outer_enum_validator = EnumAttributeValidator.new('OuterEnum', []) return false unless outer_enum_validator.valid?(@outer_enum) - outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', []) return false unless outer_enum_integer_validator.valid?(@outer_enum_integer) - outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) return false unless outer_enum_default_value_validator.valid?(@outer_enum_default_value) - outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) return false unless outer_enum_integer_default_value_validator.valid?(@outer_enum_integer_default_value) true end @@ -212,7 +212,7 @@ def enum_number=(enum_number) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum Object to be assigned def outer_enum=(outer_enum) - validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + validator = EnumAttributeValidator.new('OuterEnum', []) unless validator.valid?(outer_enum) fail ArgumentError, "invalid value for \"outer_enum\", must be one of #{validator.allowable_values}." end @@ -222,7 +222,7 @@ def outer_enum=(outer_enum) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer Object to be assigned def outer_enum_integer=(outer_enum_integer) - validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + validator = EnumAttributeValidator.new('OuterEnumInteger', []) unless validator.valid?(outer_enum_integer) fail ArgumentError, "invalid value for \"outer_enum_integer\", must be one of #{validator.allowable_values}." end @@ -232,7 +232,7 @@ def outer_enum_integer=(outer_enum_integer) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_default_value Object to be assigned def outer_enum_default_value=(outer_enum_default_value) - validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) unless validator.valid?(outer_enum_default_value) fail ArgumentError, "invalid value for \"outer_enum_default_value\", must be one of #{validator.allowable_values}." end @@ -242,7 +242,7 @@ def outer_enum_default_value=(outer_enum_default_value) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer_default_value Object to be assigned def outer_enum_integer_default_value=(outer_enum_integer_default_value) - validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) unless validator.valid?(outer_enum_integer_default_value) fail ArgumentError, "invalid value for \"outer_enum_integer_default_value\", must be one of #{validator.allowable_values}." end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 8dbb710e14ab..f695e15f6ff4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -158,13 +158,13 @@ def valid? return false unless enum_integer_validator.valid?(@enum_integer) enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) - outer_enum_validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + outer_enum_validator = EnumAttributeValidator.new('OuterEnum', []) return false unless outer_enum_validator.valid?(@outer_enum) - outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', []) return false unless outer_enum_integer_validator.valid?(@outer_enum_integer) - outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) return false unless outer_enum_default_value_validator.valid?(@outer_enum_default_value) - outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) return false unless outer_enum_integer_default_value_validator.valid?(@outer_enum_integer_default_value) true end @@ -212,7 +212,7 @@ def enum_number=(enum_number) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum Object to be assigned def outer_enum=(outer_enum) - validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) + validator = EnumAttributeValidator.new('OuterEnum', []) unless validator.valid?(outer_enum) fail ArgumentError, "invalid value for \"outer_enum\", must be one of #{validator.allowable_values}." end @@ -222,7 +222,7 @@ def outer_enum=(outer_enum) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer Object to be assigned def outer_enum_integer=(outer_enum_integer) - validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) + validator = EnumAttributeValidator.new('OuterEnumInteger', []) unless validator.valid?(outer_enum_integer) fail ArgumentError, "invalid value for \"outer_enum_integer\", must be one of #{validator.allowable_values}." end @@ -232,7 +232,7 @@ def outer_enum_integer=(outer_enum_integer) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_default_value Object to be assigned def outer_enum_default_value=(outer_enum_default_value) - validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) + validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) unless validator.valid?(outer_enum_default_value) fail ArgumentError, "invalid value for \"outer_enum_default_value\", must be one of #{validator.allowable_values}." end @@ -242,7 +242,7 @@ def outer_enum_default_value=(outer_enum_default_value) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer_default_value Object to be assigned def outer_enum_integer_default_value=(outer_enum_integer_default_value) - validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) + validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) unless validator.valid?(outer_enum_integer_default_value) fail ArgumentError, "invalid value for \"outer_enum_integer_default_value\", must be one of #{validator.allowable_values}." end diff --git a/samples/openapi3/client/elm/src/Api/Data.elm b/samples/openapi3/client/elm/src/Api/Data.elm index 78cab488dbd4..10e98370de63 100644 --- a/samples/openapi3/client/elm/src/Api/Data.elm +++ b/samples/openapi3/client/elm/src/Api/Data.elm @@ -97,16 +97,10 @@ type alias Array = type ArrayArrayOfEnum - = ArrayArrayOfEnumFoo - | ArrayArrayOfEnumBar - | ArrayArrayOfEnumBaz arrayArrayOfEnumVariants : List ArrayArrayOfEnum arrayArrayOfEnumVariants = - [ ArrayArrayOfEnumFoo - , ArrayArrayOfEnumBar - , ArrayArrayOfEnumBaz ] @@ -320,15 +314,6 @@ encodeArrayPairs model = stringFromArrayArrayOfEnum : ArrayArrayOfEnum -> String stringFromArrayArrayOfEnum model = case model of - ArrayArrayOfEnumFoo -> - "foo" - - ArrayArrayOfEnumBar -> - "bar" - - ArrayArrayOfEnumBaz -> - "baz" - encodeArrayArrayOfEnum : ArrayArrayOfEnum -> Json.Encode.Value encodeArrayArrayOfEnum = @@ -688,15 +673,6 @@ arrayArrayOfEnumDecoder = |> Json.Decode.andThen (\value -> case value of - "foo" -> - Json.Decode.succeed ArrayArrayOfEnumFoo - - "bar" -> - Json.Decode.succeed ArrayArrayOfEnumBar - - "baz" -> - Json.Decode.succeed ArrayArrayOfEnumBaz - other -> Json.Decode.fail <| "Unknown type: " ++ String.fromInt other ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md index 46c00a8ecc72..4e4b3acb9392 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -59,9 +59,6 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" @@ -69,9 +66,6 @@ DELIVERED | "delivered" Name | Value ---- | ----- -NUMBER_0 | 0 -NUMBER_1 | 1 -NUMBER_2 | 2 @@ -79,9 +73,6 @@ NUMBER_2 | 2 Name | Value ---- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" @@ -89,9 +80,6 @@ DELIVERED | "delivered" Name | Value ---- | ----- -NUMBER_0 | 0 -NUMBER_1 | 1 -NUMBER_2 | 2 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 4864ee71687a..e9913994a9f8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -209,11 +209,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; @@ -249,11 +244,6 @@ public static OuterEnumEnum fromValue(OuterEnum value) { * Gets or Sets outerEnumInteger */ public enum OuterEnumIntegerEnum { - NUMBER_0(0), - - NUMBER_1(1), - - NUMBER_2(2); private OuterEnumInteger value; @@ -289,11 +279,6 @@ public static OuterEnumIntegerEnum fromValue(OuterEnumInteger value) { * Gets or Sets outerEnumDefaultValue */ public enum OuterEnumDefaultValueEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnumDefaultValue value; @@ -323,17 +308,12 @@ public static OuterEnumDefaultValueEnum fromValue(OuterEnumDefaultValue value) { } public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; - private OuterEnumDefaultValueEnum outerEnumDefaultValue = OuterEnumDefaultValueEnum.PLACED; + private OuterEnumDefaultValueEnum outerEnumDefaultValue = placed; /** * Gets or Sets outerEnumIntegerDefaultValue */ public enum OuterEnumIntegerDefaultValueEnum { - NUMBER_0(0), - - NUMBER_1(1), - - NUMBER_2(2); private OuterEnumIntegerDefaultValue value; @@ -363,7 +343,7 @@ public static OuterEnumIntegerDefaultValueEnum fromValue(OuterEnumIntegerDefault } public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; - private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueEnum.NUMBER_0; + private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = 0; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java index 993b88ddb8b3..545a4e71eba2 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java @@ -157,11 +157,6 @@ public static EnumNumberEnum fromValue(String text) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index 9c22c0023937..db24f6302d5a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -156,11 +156,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private final OuterEnum value; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java index d0271a254ec3..0867597c30c1 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java @@ -160,7 +160,7 @@ public static EnumNumberEnum fromValue(Double value) { @XmlEnum(OuterEnum.class) public enum OuterEnumEnum { -@XmlEnumValue("placed") PLACED(OuterEnum.valueOf("placed")), @XmlEnumValue("approved") APPROVED(OuterEnum.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(OuterEnum.valueOf("delivered")); + private OuterEnum value; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index c3df6cc3f5f2..ed0d069e60b3 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -185,11 +185,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index 2a5ec001fbb8..6ca93f634d4d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -190,11 +190,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; @@ -227,11 +222,6 @@ public static OuterEnumEnum fromValue(OuterEnum value) { * Gets or Sets outerEnumInteger */ public enum OuterEnumIntegerEnum { - NUMBER_0(0), - - NUMBER_1(1), - - NUMBER_2(2); private OuterEnumInteger value; @@ -264,11 +254,6 @@ public static OuterEnumIntegerEnum fromValue(OuterEnumInteger value) { * Gets or Sets outerEnumDefaultValue */ public enum OuterEnumDefaultValueEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnumDefaultValue value; @@ -295,17 +280,12 @@ public static OuterEnumDefaultValueEnum fromValue(OuterEnumDefaultValue value) { public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) - private OuterEnumDefaultValueEnum outerEnumDefaultValue = OuterEnumDefaultValueEnum.PLACED; + private OuterEnumDefaultValueEnum outerEnumDefaultValue = placed; /** * Gets or Sets outerEnumIntegerDefaultValue */ public enum OuterEnumIntegerDefaultValueEnum { - NUMBER_0(0), - - NUMBER_1(1), - - NUMBER_2(2); private OuterEnumIntegerDefaultValue value; @@ -332,7 +312,7 @@ public static OuterEnumIntegerDefaultValueEnum fromValue(OuterEnumIntegerDefault public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) - private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueEnum.NUMBER_0; + private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = 0; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java index c6dbbb2d1d94..a0a4ba84d9fd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java @@ -156,7 +156,7 @@ public static EnumNumberEnum fromValue(Double value) { public enum OuterEnumEnum { - PLACED(OuterEnum.valueOf("placed")), APPROVED(OuterEnum.valueOf("approved")), DELIVERED(OuterEnum.valueOf("delivered")); + private OuterEnum value; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index c6dbbb2d1d94..a0a4ba84d9fd 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -156,7 +156,7 @@ public static EnumNumberEnum fromValue(Double value) { public enum OuterEnumEnum { - PLACED(OuterEnum.valueOf("placed")), APPROVED(OuterEnum.valueOf("approved")), DELIVERED(OuterEnum.valueOf("delivered")); + private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 37e5055bb35b..82ba8e447f1c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,11 +184,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index 37e5055bb35b..82ba8e447f1c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,11 +184,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 37e5055bb35b..82ba8e447f1c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,11 +184,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index 37e5055bb35b..82ba8e447f1c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,11 +184,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 49566a8f77c6..1d6a30f70416 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index 135388b9fba1..19ab9c31863a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -176,11 +176,6 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); private OuterEnum value; From 3b6fc9aa598e2d7b03f5788ffdf7dd88e6c3b474 Mon Sep 17 00:00:00 2001 From: Luke Marlin Date: Wed, 8 Jul 2020 11:10:15 +0200 Subject: [PATCH 3/3] Revert "Keep backward compatible behaviour" This reverts commit 24306194feb5d26cf25b71f333d3f5745c31a165. --- .../openapitools/codegen/DefaultCodegen.java | 11 ++- .../languages/HaskellHttpClientCodegen.java | 2 +- .../lib/OpenAPIPetstore/Model.hs | 71 +++++++++++++++++-- .../openapitools/client/model/EnumTest.java | 5 ++ .../java/google-api-client/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/java/jersey1/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/jersey2-java8/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/native-async/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/java/native/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/okhttp-gson/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../rest-assured-jackson/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/rest-assured/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/java/resteasy/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../resttemplate-withXml/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/resttemplate/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/retrofit2-play26/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/java/retrofit2/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/retrofit2rx2/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../java/retrofit2rx3/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/java/vertx/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/java/webclient/docs/EnumTest.md | 3 + .../openapitools/client/model/EnumTest.java | 5 ++ .../petstore/javascript-es6/docs/EnumTest.md | 24 +++++++ .../javascript-es6/src/model/EnumTest.js | 68 ++++++++++++++++++ .../javascript-promise-es6/docs/EnumTest.md | 24 +++++++ .../src/model/EnumTest.js | 68 ++++++++++++++++++ .../OpenAPIClient-php/lib/Model/EnumTest.php | 28 ++++++-- .../lib/petstore/models/enum_test.rb | 16 ++--- .../ruby/lib/petstore/models/enum_test.rb | 16 ++--- samples/openapi3/client/elm/src/Api/Data.elm | 24 +++++++ .../java/jersey2-java8/docs/EnumTest.md | 12 ++++ .../openapitools/client/model/EnumTest.java | 24 ++++++- .../java/org/openapitools/model/EnumTest.java | 5 ++ .../app/apimodels/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 24 ++++++- .../java/org/openapitools/model/EnumTest.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ .../virtualan/model/EnumTest.java | 5 ++ .../java/org/openapitools/model/EnumTest.java | 5 ++ 72 files changed, 615 insertions(+), 42 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 38413887117e..ea1dd54ef4c1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4594,13 +4594,13 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera * of the 'additionalProperties' keyword. Some language generator use class inheritance * to implement additional properties. For example, in Java the generated model class * has 'extends HashMap' to represent the additional properties. - * + * * TODO: it's not a good idea to use single class inheritance to implement * additionalProperties. That may work for non-composed schemas, but that does not * work for composed 'allOf' schemas. For example, in Java, if additionalProperties * is set to true (which it should be by default, per OAS spec), then the generated * code has extends HashMap. That wouldn't work for composed 'allOf' schemas. - * + * * @param model the codegen representation of the OAS schema. * @param name the name of the model. * @param schema the input OAS schema. @@ -5258,9 +5258,6 @@ public void setParameterBooleanFlagWithCodegenProperty(CodegenParameter paramete * @param var list of CodegenProperty */ public void updateCodegenPropertyEnum(CodegenProperty var) { - if (!var.isPrimitiveType) { - return; - } Map allowableValues = var.allowableValues; // handle array @@ -6458,7 +6455,7 @@ protected boolean isFreeFormObject(Schema schema) { /** * Returns the additionalProperties Schema for the specified input schema. - * + * * The additionalProperties keyword is used to control the handling of additional, undeclared * properties, that is, properties whose names are not listed in the properties keyword. * The additionalProperties keyword may be either a boolean or an object. @@ -6466,7 +6463,7 @@ protected boolean isFreeFormObject(Schema schema) { * By default when the additionalProperties keyword is not specified in the input schema, * any additional properties are allowed. This is equivalent to setting additionalProperties * to the boolean value True or setting additionalProperties: {} - * + * * @param schema the input schema that may or may not have the additionalProperties keyword. * @return the Schema of the additionalProperties. The null value is returned if no additional * properties are allowed. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 451e3cc89ee9..b6977acca7e1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -1373,7 +1373,7 @@ public void updateCodegenPropertyEnumValues(CodegenProperty var, String paramNam } private void updateAllowableValuesNames(String paramNameType, Map allowableValues) { - if (allowableValues == null || allowableValues.get("enumVars") == null) { + if (allowableValues == null) { return; } for (Map enumVar : (List>) allowableValues.get("enumVars")) { diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 81f06f28aa7a..187402d66919 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -2101,7 +2101,9 @@ toE'EnumFormStringArray = \case -- | Enum of 'Int' data E'EnumInteger - = + = E'EnumInteger'Num1 -- ^ @1@ + | E'EnumInteger'NumMinus_1 -- ^ @-1@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o @@ -2112,10 +2114,14 @@ instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mim -- | unwrap 'E'EnumInteger' enum fromE'EnumInteger :: E'EnumInteger -> Int fromE'EnumInteger = \case + E'EnumInteger'Num1 -> 1 + E'EnumInteger'NumMinus_1 -> -1 -- | parse 'E'EnumInteger' enum toE'EnumInteger :: Int -> P.Either String E'EnumInteger toE'EnumInteger = \case + 1 -> P.Right E'EnumInteger'Num1 + -1 -> P.Right E'EnumInteger'NumMinus_1 s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s @@ -2123,7 +2129,9 @@ toE'EnumInteger = \case -- | Enum of 'Double' data E'EnumNumber - = + = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ + | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o @@ -2134,10 +2142,14 @@ instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mime -- | unwrap 'E'EnumNumber' enum fromE'EnumNumber :: E'EnumNumber -> Double fromE'EnumNumber = \case + E'EnumNumber'Num1_Dot_1 -> 1.1 + E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 -- | parse 'E'EnumNumber' enum toE'EnumNumber :: Double -> P.Either String E'EnumNumber toE'EnumNumber = \case + 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 + -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s @@ -2173,7 +2185,10 @@ toE'EnumQueryInteger = \case -- | Enum of 'Text' data E'EnumString - = + = E'EnumString'UPPER -- ^ @"UPPER"@ + | E'EnumString'Lower -- ^ @"lower"@ + | E'EnumString'Empty -- ^ @""@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o @@ -2184,10 +2199,16 @@ instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mime -- | unwrap 'E'EnumString' enum fromE'EnumString :: E'EnumString -> Text fromE'EnumString = \case + E'EnumString'UPPER -> "UPPER" + E'EnumString'Lower -> "lower" + E'EnumString'Empty -> "" -- | parse 'E'EnumString' enum toE'EnumString :: Text -> P.Either String E'EnumString toE'EnumString = \case + "UPPER" -> P.Right E'EnumString'UPPER + "lower" -> P.Right E'EnumString'Lower + "" -> P.Right E'EnumString'Empty s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s @@ -2223,7 +2244,9 @@ toE'Inner = \case -- | Enum of 'Text' data E'JustSymbol - = + = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ + | E'JustSymbol'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o @@ -2234,10 +2257,14 @@ instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mime -- | unwrap 'E'JustSymbol' enum fromE'JustSymbol :: E'JustSymbol -> Text fromE'JustSymbol = \case + E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" + E'JustSymbol'Dollar -> "$" -- | parse 'E'JustSymbol' enum toE'JustSymbol :: Text -> P.Either String E'JustSymbol toE'JustSymbol = \case + ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To + "$" -> P.Right E'JustSymbol'Dollar s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s @@ -2245,7 +2272,11 @@ toE'JustSymbol = \case -- | Enum of 'Text' data E'Kind - = + = E'Kind'Lions -- ^ @"lions"@ + | E'Kind'Tigers -- ^ @"tigers"@ + | E'Kind'Leopards -- ^ @"leopards"@ + | E'Kind'Jaguars -- ^ @"jaguars"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'Kind where toJSON = A.toJSON . fromE'Kind instance A.FromJSON E'Kind where parseJSON o = P.either P.fail (pure . P.id) . toE'Kind =<< A.parseJSON o @@ -2256,10 +2287,18 @@ instance MimeRender MimeMultipartFormData E'Kind where mimeRender _ = mimeRender -- | unwrap 'E'Kind' enum fromE'Kind :: E'Kind -> Text fromE'Kind = \case + E'Kind'Lions -> "lions" + E'Kind'Tigers -> "tigers" + E'Kind'Leopards -> "leopards" + E'Kind'Jaguars -> "jaguars" -- | parse 'E'Kind' enum toE'Kind :: Text -> P.Either String E'Kind toE'Kind = \case + "lions" -> P.Right E'Kind'Lions + "tigers" -> P.Right E'Kind'Tigers + "leopards" -> P.Right E'Kind'Leopards + "jaguars" -> P.Right E'Kind'Jaguars s -> P.Left $ "toE'Kind: enum parse failure: " P.++ P.show s @@ -2268,7 +2307,10 @@ toE'Kind = \case -- | Enum of 'Text' . -- Order Status data E'Status - = + = E'Status'Placed -- ^ @"placed"@ + | E'Status'Approved -- ^ @"approved"@ + | E'Status'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o @@ -2279,10 +2321,16 @@ instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRend -- | unwrap 'E'Status' enum fromE'Status :: E'Status -> Text fromE'Status = \case + E'Status'Placed -> "placed" + E'Status'Approved -> "approved" + E'Status'Delivered -> "delivered" -- | parse 'E'Status' enum toE'Status :: Text -> P.Either String E'Status toE'Status = \case + "placed" -> P.Right E'Status'Placed + "approved" -> P.Right E'Status'Approved + "delivered" -> P.Right E'Status'Delivered s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s @@ -2291,7 +2339,10 @@ toE'Status = \case -- | Enum of 'Text' . -- pet status in the store data E'Status2 - = + = E'Status2'Available -- ^ @"available"@ + | E'Status2'Pending -- ^ @"pending"@ + | E'Status2'Sold -- ^ @"sold"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o @@ -2302,10 +2353,16 @@ instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRen -- | unwrap 'E'Status2' enum fromE'Status2 :: E'Status2 -> Text fromE'Status2 = \case + E'Status2'Available -> "available" + E'Status2'Pending -> "pending" + E'Status2'Sold -> "sold" -- | parse 'E'Status2' enum toE'Status2 :: Text -> P.Either String E'Status2 toE'Status2 = \case + "available" -> P.Right E'Status2'Available + "pending" -> P.Right E'Status2'Pending + "sold" -> P.Right E'Status2'Sold s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/google-api-client/docs/EnumTest.md b/samples/client/petstore/java/google-api-client/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/google-api-client/docs/EnumTest.md +++ b/samples/client/petstore/java/google-api-client/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/jersey1/docs/EnumTest.md b/samples/client/petstore/java/jersey1/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/jersey1/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey1/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 73fa5f53cdfd..80b62f7f587b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -200,6 +200,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/native-async/docs/EnumTest.md b/samples/client/petstore/java/native-async/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/native-async/docs/EnumTest.md +++ b/samples/client/petstore/java/native-async/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index a8d63bfcb31a..b20e4eceac10 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/native/docs/EnumTest.md b/samples/client/petstore/java/native/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/native/docs/EnumTest.md +++ b/samples/client/petstore/java/native/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index a8d63bfcb31a..b20e4eceac10 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md index 71c1bc617253..b5119dba94b6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" ## Implemented Interfaces diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index e8464732c513..e9651f1bfb83 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -245,6 +245,11 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index 712a68beef06..8e565012f605 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,6 +243,11 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md b/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured-jackson/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 7808e56bf9d4..99d858ca2207 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 @@ -199,6 +199,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/rest-assured/docs/EnumTest.md b/samples/client/petstore/java/rest-assured/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/rest-assured/docs/EnumTest.md +++ b/samples/client/petstore/java/rest-assured/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 53d4f0b7baca..6203868a47cc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -246,6 +246,11 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/resteasy/docs/EnumTest.md b/samples/client/petstore/java/resteasy/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/resteasy/docs/EnumTest.md +++ b/samples/client/petstore/java/resteasy/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 eb014a0155db..4265405d0cff 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 @@ -205,6 +205,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/resttemplate/docs/EnumTest.md b/samples/client/petstore/java/resttemplate/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/resttemplate/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 f68de6063f98..9a55e3877c5e 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 @@ -198,6 +198,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index 712a68beef06..8e565012f605 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,6 +243,11 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index 712a68beef06..8e565012f605 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,6 +243,11 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx3/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index 712a68beef06..8e565012f605 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,6 +243,11 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(OuterEnumEnum.Adapter.class) public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/vertx/docs/EnumTest.md b/samples/client/petstore/java/vertx/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/vertx/docs/EnumTest.md +++ b/samples/client/petstore/java/vertx/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/java/webclient/docs/EnumTest.md b/samples/client/petstore/java/webclient/docs/EnumTest.md index ccdc69987c7e..d768f5c13d9b 100644 --- a/samples/client/petstore/java/webclient/docs/EnumTest.md +++ b/samples/client/petstore/java/webclient/docs/EnumTest.md @@ -56,6 +56,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" 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 63c42775d5be..2af44d4d4836 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 @@ -196,6 +196,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/client/petstore/javascript-es6/docs/EnumTest.md b/samples/client/petstore/javascript-es6/docs/EnumTest.md index ef5767e13e9e..a627ae908845 100644 --- a/samples/client/petstore/javascript-es6/docs/EnumTest.md +++ b/samples/client/petstore/javascript-es6/docs/EnumTest.md @@ -66,6 +66,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumEnum +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + @@ -73,6 +79,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerEnum +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + @@ -80,6 +92,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumDefaultValueEnum +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + @@ -87,6 +105,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerDefaultValueEnum +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index 4926284120f8..471f8ef59dcf 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -231,6 +231,23 @@ EnumTest['EnumNumberEnum'] = { */ EnumTest['OuterEnumEnum'] = { + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" }; @@ -241,6 +258,23 @@ EnumTest['OuterEnumEnum'] = { */ EnumTest['OuterEnumIntegerEnum'] = { + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 }; @@ -251,6 +285,23 @@ EnumTest['OuterEnumIntegerEnum'] = { */ EnumTest['OuterEnumDefaultValueEnum'] = { + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" }; @@ -261,6 +312,23 @@ EnumTest['OuterEnumDefaultValueEnum'] = { */ EnumTest['OuterEnumIntegerDefaultValueEnum'] = { + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 }; diff --git a/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md b/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md index ef5767e13e9e..a627ae908845 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md +++ b/samples/client/petstore/javascript-promise-es6/docs/EnumTest.md @@ -66,6 +66,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumEnum +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + @@ -73,6 +79,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerEnum +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + @@ -80,6 +92,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumDefaultValueEnum +* `placed` (value: `"placed"`) + +* `approved` (value: `"approved"`) + +* `delivered` (value: `"delivered"`) + @@ -87,6 +105,12 @@ Name | Type | Description | Notes ## Enum: OuterEnumIntegerDefaultValueEnum +* `0` (value: `0`) + +* `1` (value: `1`) + +* `2` (value: `2`) + diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index 4926284120f8..471f8ef59dcf 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -231,6 +231,23 @@ EnumTest['EnumNumberEnum'] = { */ EnumTest['OuterEnumEnum'] = { + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" }; @@ -241,6 +258,23 @@ EnumTest['OuterEnumEnum'] = { */ EnumTest['OuterEnumIntegerEnum'] = { + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 }; @@ -251,6 +285,23 @@ EnumTest['OuterEnumIntegerEnum'] = { */ EnumTest['OuterEnumDefaultValueEnum'] = { + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" }; @@ -261,6 +312,23 @@ EnumTest['OuterEnumDefaultValueEnum'] = { */ EnumTest['OuterEnumIntegerDefaultValueEnum'] = { + /** + * value: 0 + * @const + */ + "0": 0, + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: 2 + * @const + */ + "2": 2 }; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 97eade7a3893..e5c12380340c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -203,6 +203,18 @@ public function getModelName() const ENUM_INTEGER_MINUS_1 = -1; const ENUM_NUMBER_1_DOT_1 = 1.1; const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; + const OUTER_ENUM_PLACED = 'placed'; + const OUTER_ENUM_APPROVED = 'approved'; + const OUTER_ENUM_DELIVERED = 'delivered'; + const OUTER_ENUM_INTEGER__0 = '0'; + const OUTER_ENUM_INTEGER__1 = '1'; + const OUTER_ENUM_INTEGER__2 = '2'; + const OUTER_ENUM_DEFAULT_VALUE_PLACED = 'placed'; + const OUTER_ENUM_DEFAULT_VALUE_APPROVED = 'approved'; + const OUTER_ENUM_DEFAULT_VALUE_DELIVERED = 'delivered'; + const OUTER_ENUM_INTEGER_DEFAULT_VALUE__0 = '0'; + const OUTER_ENUM_INTEGER_DEFAULT_VALUE__1 = '1'; + const OUTER_ENUM_INTEGER_DEFAULT_VALUE__2 = '2'; @@ -268,7 +280,9 @@ public function getEnumNumberAllowableValues() public function getOuterEnumAllowableValues() { return [ - + self::OUTER_ENUM_PLACED, + self::OUTER_ENUM_APPROVED, + self::OUTER_ENUM_DELIVERED, ]; } @@ -280,7 +294,9 @@ public function getOuterEnumAllowableValues() public function getOuterEnumIntegerAllowableValues() { return [ - + self::OUTER_ENUM_INTEGER__0, + self::OUTER_ENUM_INTEGER__1, + self::OUTER_ENUM_INTEGER__2, ]; } @@ -292,7 +308,9 @@ public function getOuterEnumIntegerAllowableValues() public function getOuterEnumDefaultValueAllowableValues() { return [ - + self::OUTER_ENUM_DEFAULT_VALUE_PLACED, + self::OUTER_ENUM_DEFAULT_VALUE_APPROVED, + self::OUTER_ENUM_DEFAULT_VALUE_DELIVERED, ]; } @@ -304,7 +322,9 @@ public function getOuterEnumDefaultValueAllowableValues() public function getOuterEnumIntegerDefaultValueAllowableValues() { return [ - + self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__0, + self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__1, + self::OUTER_ENUM_INTEGER_DEFAULT_VALUE__2, ]; } diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index f695e15f6ff4..8dbb710e14ab 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -158,13 +158,13 @@ def valid? return false unless enum_integer_validator.valid?(@enum_integer) enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) - outer_enum_validator = EnumAttributeValidator.new('OuterEnum', []) + outer_enum_validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) return false unless outer_enum_validator.valid?(@outer_enum) - outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', []) + outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) return false unless outer_enum_integer_validator.valid?(@outer_enum_integer) - outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) + outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) return false unless outer_enum_default_value_validator.valid?(@outer_enum_default_value) - outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) + outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) return false unless outer_enum_integer_default_value_validator.valid?(@outer_enum_integer_default_value) true end @@ -212,7 +212,7 @@ def enum_number=(enum_number) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum Object to be assigned def outer_enum=(outer_enum) - validator = EnumAttributeValidator.new('OuterEnum', []) + validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) unless validator.valid?(outer_enum) fail ArgumentError, "invalid value for \"outer_enum\", must be one of #{validator.allowable_values}." end @@ -222,7 +222,7 @@ def outer_enum=(outer_enum) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer Object to be assigned def outer_enum_integer=(outer_enum_integer) - validator = EnumAttributeValidator.new('OuterEnumInteger', []) + validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) unless validator.valid?(outer_enum_integer) fail ArgumentError, "invalid value for \"outer_enum_integer\", must be one of #{validator.allowable_values}." end @@ -232,7 +232,7 @@ def outer_enum_integer=(outer_enum_integer) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_default_value Object to be assigned def outer_enum_default_value=(outer_enum_default_value) - validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) + validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) unless validator.valid?(outer_enum_default_value) fail ArgumentError, "invalid value for \"outer_enum_default_value\", must be one of #{validator.allowable_values}." end @@ -242,7 +242,7 @@ def outer_enum_default_value=(outer_enum_default_value) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer_default_value Object to be assigned def outer_enum_integer_default_value=(outer_enum_integer_default_value) - validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) + validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) unless validator.valid?(outer_enum_integer_default_value) fail ArgumentError, "invalid value for \"outer_enum_integer_default_value\", must be one of #{validator.allowable_values}." end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index f695e15f6ff4..8dbb710e14ab 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -158,13 +158,13 @@ def valid? return false unless enum_integer_validator.valid?(@enum_integer) enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) - outer_enum_validator = EnumAttributeValidator.new('OuterEnum', []) + outer_enum_validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) return false unless outer_enum_validator.valid?(@outer_enum) - outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', []) + outer_enum_integer_validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) return false unless outer_enum_integer_validator.valid?(@outer_enum_integer) - outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) + outer_enum_default_value_validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) return false unless outer_enum_default_value_validator.valid?(@outer_enum_default_value) - outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) + outer_enum_integer_default_value_validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) return false unless outer_enum_integer_default_value_validator.valid?(@outer_enum_integer_default_value) true end @@ -212,7 +212,7 @@ def enum_number=(enum_number) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum Object to be assigned def outer_enum=(outer_enum) - validator = EnumAttributeValidator.new('OuterEnum', []) + validator = EnumAttributeValidator.new('OuterEnum', ["placed", "approved", "delivered"]) unless validator.valid?(outer_enum) fail ArgumentError, "invalid value for \"outer_enum\", must be one of #{validator.allowable_values}." end @@ -222,7 +222,7 @@ def outer_enum=(outer_enum) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer Object to be assigned def outer_enum_integer=(outer_enum_integer) - validator = EnumAttributeValidator.new('OuterEnumInteger', []) + validator = EnumAttributeValidator.new('OuterEnumInteger', [0, 1, 2]) unless validator.valid?(outer_enum_integer) fail ArgumentError, "invalid value for \"outer_enum_integer\", must be one of #{validator.allowable_values}." end @@ -232,7 +232,7 @@ def outer_enum_integer=(outer_enum_integer) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_default_value Object to be assigned def outer_enum_default_value=(outer_enum_default_value) - validator = EnumAttributeValidator.new('OuterEnumDefaultValue', []) + validator = EnumAttributeValidator.new('OuterEnumDefaultValue', ["placed", "approved", "delivered"]) unless validator.valid?(outer_enum_default_value) fail ArgumentError, "invalid value for \"outer_enum_default_value\", must be one of #{validator.allowable_values}." end @@ -242,7 +242,7 @@ def outer_enum_default_value=(outer_enum_default_value) # Custom attribute writer method checking allowed values (enum). # @param [Object] outer_enum_integer_default_value Object to be assigned def outer_enum_integer_default_value=(outer_enum_integer_default_value) - validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', []) + validator = EnumAttributeValidator.new('OuterEnumIntegerDefaultValue', [0, 1, 2]) unless validator.valid?(outer_enum_integer_default_value) fail ArgumentError, "invalid value for \"outer_enum_integer_default_value\", must be one of #{validator.allowable_values}." end diff --git a/samples/openapi3/client/elm/src/Api/Data.elm b/samples/openapi3/client/elm/src/Api/Data.elm index 10e98370de63..78cab488dbd4 100644 --- a/samples/openapi3/client/elm/src/Api/Data.elm +++ b/samples/openapi3/client/elm/src/Api/Data.elm @@ -97,10 +97,16 @@ type alias Array = type ArrayArrayOfEnum + = ArrayArrayOfEnumFoo + | ArrayArrayOfEnumBar + | ArrayArrayOfEnumBaz arrayArrayOfEnumVariants : List ArrayArrayOfEnum arrayArrayOfEnumVariants = + [ ArrayArrayOfEnumFoo + , ArrayArrayOfEnumBar + , ArrayArrayOfEnumBaz ] @@ -314,6 +320,15 @@ encodeArrayPairs model = stringFromArrayArrayOfEnum : ArrayArrayOfEnum -> String stringFromArrayArrayOfEnum model = case model of + ArrayArrayOfEnumFoo -> + "foo" + + ArrayArrayOfEnumBar -> + "bar" + + ArrayArrayOfEnumBaz -> + "baz" + encodeArrayArrayOfEnum : ArrayArrayOfEnum -> Json.Encode.Value encodeArrayArrayOfEnum = @@ -673,6 +688,15 @@ arrayArrayOfEnumDecoder = |> Json.Decode.andThen (\value -> case value of + "foo" -> + Json.Decode.succeed ArrayArrayOfEnumFoo + + "bar" -> + Json.Decode.succeed ArrayArrayOfEnumBar + + "baz" -> + Json.Decode.succeed ArrayArrayOfEnumBaz + other -> Json.Decode.fail <| "Unknown type: " ++ String.fromInt other ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md index 4e4b3acb9392..46c00a8ecc72 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -59,6 +59,9 @@ NUMBER_MINUS_1_DOT_2 | -1.2 Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" @@ -66,6 +69,9 @@ Name | Value Name | Value ---- | ----- +NUMBER_0 | 0 +NUMBER_1 | 1 +NUMBER_2 | 2 @@ -73,6 +79,9 @@ Name | Value Name | Value ---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" @@ -80,6 +89,9 @@ Name | Value Name | Value ---- | ----- +NUMBER_0 | 0 +NUMBER_1 | 1 +NUMBER_2 | 2 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index e9913994a9f8..4864ee71687a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -209,6 +209,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; @@ -244,6 +249,11 @@ public static OuterEnumEnum fromValue(OuterEnum value) { * Gets or Sets outerEnumInteger */ public enum OuterEnumIntegerEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); private OuterEnumInteger value; @@ -279,6 +289,11 @@ public static OuterEnumIntegerEnum fromValue(OuterEnumInteger value) { * Gets or Sets outerEnumDefaultValue */ public enum OuterEnumDefaultValueEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnumDefaultValue value; @@ -308,12 +323,17 @@ public static OuterEnumDefaultValueEnum fromValue(OuterEnumDefaultValue value) { } public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; - private OuterEnumDefaultValueEnum outerEnumDefaultValue = placed; + private OuterEnumDefaultValueEnum outerEnumDefaultValue = OuterEnumDefaultValueEnum.PLACED; /** * Gets or Sets outerEnumIntegerDefaultValue */ public enum OuterEnumIntegerDefaultValueEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); private OuterEnumIntegerDefaultValue value; @@ -343,7 +363,7 @@ public static OuterEnumIntegerDefaultValueEnum fromValue(OuterEnumIntegerDefault } public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; - private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = 0; + private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueEnum.NUMBER_0; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java index 545a4e71eba2..993b88ddb8b3 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/EnumTest.java @@ -157,6 +157,11 @@ public static EnumNumberEnum fromValue(String text) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index db24f6302d5a..9c22c0023937 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -156,6 +156,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private final OuterEnum value; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java index 0867597c30c1..d0271a254ec3 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java @@ -160,7 +160,7 @@ public static EnumNumberEnum fromValue(Double value) { @XmlEnum(OuterEnum.class) public enum OuterEnumEnum { - +@XmlEnumValue("placed") PLACED(OuterEnum.valueOf("placed")), @XmlEnumValue("approved") APPROVED(OuterEnum.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(OuterEnum.valueOf("delivered")); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index ed0d069e60b3..c3df6cc3f5f2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -185,6 +185,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index 6ca93f634d4d..2a5ec001fbb8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -190,6 +190,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; @@ -222,6 +227,11 @@ public static OuterEnumEnum fromValue(OuterEnum value) { * Gets or Sets outerEnumInteger */ public enum OuterEnumIntegerEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); private OuterEnumInteger value; @@ -254,6 +264,11 @@ public static OuterEnumIntegerEnum fromValue(OuterEnumInteger value) { * Gets or Sets outerEnumDefaultValue */ public enum OuterEnumDefaultValueEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnumDefaultValue value; @@ -280,12 +295,17 @@ public static OuterEnumDefaultValueEnum fromValue(OuterEnumDefaultValue value) { public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) - private OuterEnumDefaultValueEnum outerEnumDefaultValue = placed; + private OuterEnumDefaultValueEnum outerEnumDefaultValue = OuterEnumDefaultValueEnum.PLACED; /** * Gets or Sets outerEnumIntegerDefaultValue */ public enum OuterEnumIntegerDefaultValueEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); private OuterEnumIntegerDefaultValue value; @@ -312,7 +332,7 @@ public static OuterEnumIntegerDefaultValueEnum fromValue(OuterEnumIntegerDefault public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) - private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = 0; + private OuterEnumIntegerDefaultValueEnum outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueEnum.NUMBER_0; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java index a0a4ba84d9fd..c6dbbb2d1d94 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java @@ -156,7 +156,7 @@ public static EnumNumberEnum fromValue(Double value) { public enum OuterEnumEnum { - + PLACED(OuterEnum.valueOf("placed")), APPROVED(OuterEnum.valueOf("approved")), DELIVERED(OuterEnum.valueOf("delivered")); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index a0a4ba84d9fd..c6dbbb2d1d94 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -156,7 +156,7 @@ public static EnumNumberEnum fromValue(Double value) { public enum OuterEnumEnum { - + PLACED(OuterEnum.valueOf("placed")), APPROVED(OuterEnum.valueOf("approved")), DELIVERED(OuterEnum.valueOf("delivered")); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 82ba8e447f1c..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,6 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index 82ba8e447f1c..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,6 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 82ba8e447f1c..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,6 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index 82ba8e447f1c..37e5055bb35b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -184,6 +184,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index 1d6a30f70416..49566a8f77c6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index 19ab9c31863a..135388b9fba1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -176,6 +176,11 @@ public static EnumNumberEnum fromValue(Double value) { * Gets or Sets outerEnum */ public enum OuterEnumEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); private OuterEnum value;