From b41e61c7141fa72be1b49ed0375d105d72cae7fa Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Sat, 24 Aug 2024 10:40:56 +0200 Subject: [PATCH] Update samples --- .../resources/Java/modelInnerEnum.mustache | 2 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 12 +- .../openapitools/client/model/GmFruit.java | 72 ++++++---- .../client/model/MammalAnyof.java | 125 +++++++++++------- .../openapitools/client/model/EnumTest.java | 12 +- .../openapitools/client/model/EnumTest.java | 12 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 8 +- .../openapitools/client/model/EnumTest.java | 12 +- 29 files changed, 234 insertions(+), 189 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache index f875240996b32..be273444d7ff0 100644 --- a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache @@ -23,7 +23,7 @@ {{#withXml}} @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{/withXml}} - {{{name}}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}}, + {{{name}}}({{^isUri}}{{^isString}}{{dataType}}.valueOf({{/isString}}{{/isUri}}{{{value}}}{{^isUri}}{{^isString}}){{/isString}}{{/isUri}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}} {{/enumVars}} {{/allowableValues}} diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java index 5fe70b9e5c67b..e8072d8bb9942 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -134,9 +134,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -172,9 +172,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 31e3f8199f3e0..67e9d965ce639 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -122,9 +122,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -160,9 +160,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 6636e85935aeb..ed799eff97a71 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 @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 726fcf37f13d4..6c368f4ff4fab 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 @@ -121,9 +121,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -159,9 +159,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java index f25d2337822c1..0b77156a55e4e 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/EnumTest.java @@ -124,9 +124,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -162,9 +162,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 f25d2337822c1..0b77156a55e4e 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 @@ -124,9 +124,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -162,9 +162,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index 61987d6cb72aa..52ea4c2900f70 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -137,9 +137,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -175,9 +175,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumIntegerOnly */ public enum EnumIntegerOnlyEnum { - NUMBER_2(2), + NUMBER_2(Integer.valueOf(2)), - NUMBER_MINUS_2(-2); + NUMBER_MINUS_2(Integer.valueOf(-2)); private Integer value; @@ -213,9 +213,9 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index b718b0b32a3c3..7450f9b3d58fb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -43,10 +43,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -89,29 +91,47 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO JsonNode tree = jp.readValueAsTree(); Object deserialized = null; - // deserialize Apple + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Apple (nullable) try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); - GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); - return ret; + boolean attemptParsing = true; + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Apple'"); + } } catch (Exception e) { - // deserialization failed, continue, log to help debugging - log.log(Level.FINER, "Input data does not match 'GmFruit'", e); + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Apple'", e); } // deserialize Banana try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + boolean attemptParsing = true; + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Banana'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Banana'", e); + } + + if (match == 1) { GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; - } catch (Exception e) { - // deserialization failed, continue, log to help debugging - log.log(Level.FINER, "Input data does not match 'GmFruit'", e); } - - throw new IOException(String.format("Failed deserialization for GmFruit: no match found")); + throw new IOException(String.format("Failed deserialization for GmFruit: %d classes match result, expected 1", match)); } /** @@ -131,7 +151,7 @@ public GmFruit() { } public GmFruit(Apple o) { - super("anyOf", Boolean.FALSE); + super("anyOf", Boolean.TRUE); setActualInstance(o); } @@ -188,23 +208,23 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Apple`. If the actual instance is not `Apple`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Apple` - * @throws ClassCastException if the instance is not `Apple` - */ + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Apple` + * @throws ClassCastException if the instance is not `Apple` + */ public Apple getApple() throws ClassCastException { return (Apple)super.getActualInstance(); } /** - * Get the actual instance of `Banana`. If the actual instance is not `Banana`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Banana` - * @throws ClassCastException if the instance is not `Banana` - */ + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Banana` + * @throws ClassCastException if the instance is not `Banana` + */ public Banana getBanana() throws ClassCastException { return (Banana)super.getActualInstance(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java index 2bec08cf2d7a2..a5ecee25e77cb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -50,10 +50,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -106,40 +108,63 @@ public MammalAnyof deserialize(JsonParser jp, DeserializationContext ctxt) throw ret.setActualInstance(deserialized); return ret; } - // deserialize Pig + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Whale try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); - MammalAnyof ret = new MammalAnyof(); - ret.setActualInstance(deserialized); - return ret; + boolean attemptParsing = true; + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Whale'"); + } } catch (Exception e) { - // deserialization failed, continue, log to help debugging - log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Whale'", e); } - // deserialize Whale + // deserialize Zebra try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); - MammalAnyof ret = new MammalAnyof(); - ret.setActualInstance(deserialized); - return ret; + boolean attemptParsing = true; + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Zebra'"); + } } catch (Exception e) { - // deserialization failed, continue, log to help debugging - log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); } - // deserialize Zebra + // deserialize Pig try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + boolean attemptParsing = true; + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Pig'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Pig'", e); + } + + if (match == 1) { MammalAnyof ret = new MammalAnyof(); ret.setActualInstance(deserialized); return ret; - } catch (Exception e) { - // deserialization failed, continue, log to help debugging - log.log(Level.FINER, "Input data does not match 'MammalAnyof'", e); } - - throw new IOException(String.format("Failed deserialization for MammalAnyof: no match found")); + throw new IOException(String.format("Failed deserialization for MammalAnyof: %d classes match result, expected 1", match)); } /** @@ -207,17 +232,17 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } - public MammalAnyof(Pig o) { + public MammalAnyof(Whale o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public MammalAnyof(Whale o) { + public MammalAnyof(Zebra o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public MammalAnyof(Zebra o) { + public MammalAnyof(Pig o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } @@ -254,17 +279,17 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) { + if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Whale.class, instance, new HashSet<>())) { + if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<>())) { + if (JSON.isInstanceOf(Pig.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } @@ -284,37 +309,37 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Pig`. If the actual instance is not `Pig`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Pig` - * @throws ClassCastException if the instance is not `Pig` - */ - public Pig getPig() throws ClassCastException { - return (Pig)super.getActualInstance(); - } - - /** - * Get the actual instance of `Whale`. If the actual instance is not `Whale`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Whale` - * @throws ClassCastException if the instance is not `Whale` - */ + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ public Whale getWhale() throws ClassCastException { return (Whale)super.getActualInstance(); } /** - * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Zebra` - * @throws ClassCastException if the instance is not `Zebra` - */ + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ public Zebra getZebra() throws ClassCastException { return (Zebra)super.getActualInstance(); } + /** + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)super.getActualInstance(); + } + } 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 f317018d0fd03..db8f3265954e0 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 @@ -137,9 +137,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -175,9 +175,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumIntegerOnly */ public enum EnumIntegerOnlyEnum { - NUMBER_2(2), + NUMBER_2(Integer.valueOf(2)), - NUMBER_MINUS_2(-2); + NUMBER_MINUS_2(Integer.valueOf(-2)); private Integer value; @@ -213,9 +213,9 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 cdb411064b3ed..fbac9197e4573 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 @@ -137,9 +137,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -175,9 +175,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumIntegerOnly */ public enum EnumIntegerOnlyEnum { - NUMBER_2(2), + NUMBER_2(Integer.valueOf(2)), - NUMBER_MINUS_2(-2); + NUMBER_MINUS_2(Integer.valueOf(-2)); private Integer value; @@ -213,9 +213,9 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 7f4fc0e251fef..914525bdbaf6d 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 @@ -124,9 +124,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -162,9 +162,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 fe7c7f1bab71f..19e2b52924e96 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 @@ -142,9 +142,9 @@ public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOExcepti */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -193,9 +193,9 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java index bbbeefaba1429..c9fa44866f8ff 100644 --- a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -132,9 +132,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -170,9 +170,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java index 42f9f8e206a7f..5524b4d3e0405 100644 --- a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 c84f2fa3fc8dc..7f1caca5f0a99 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 @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 92d2f1eee1f38..5fae8e2e9fecf 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 @@ -153,10 +153,10 @@ public static EnumStringRequiredEnum fromValue(String value) { @XmlEnum(Integer.class) public enum EnumIntegerEnum { @XmlEnumValue("1") - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), @XmlEnumValue("-1") - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -196,10 +196,10 @@ public static EnumIntegerEnum fromValue(Integer value) { @XmlEnum(Double.class) public enum EnumNumberEnum { @XmlEnumValue("1.1") - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), @XmlEnumValue("-1.2") - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 836b9fc93fbb8..c613e446dd783 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 @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 268c45b7a6572..9d5ca6b7a9049 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 @@ -123,9 +123,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -161,9 +161,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 7ae5e0b170b9f..2e7e6dab97209 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 @@ -139,9 +139,9 @@ public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOExcepti */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -190,9 +190,9 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 7ae5e0b170b9f..2e7e6dab97209 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 @@ -139,9 +139,9 @@ public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOExcepti */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -190,9 +190,9 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 7ae5e0b170b9f..2e7e6dab97209 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 @@ -139,9 +139,9 @@ public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOExcepti */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -190,9 +190,9 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 726fcf37f13d4..6c368f4ff4fab 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -121,9 +121,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -159,9 +159,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 c84f2fa3fc8dc..7f1caca5f0a99 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 @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java index 42f9f8e206a7f..5524b4d3e0405 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java index 6761607407da6..6fcf8f0f9b408 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -132,9 +132,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -170,9 +170,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 c84f2fa3fc8dc..7f1caca5f0a99 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 @@ -131,9 +131,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -169,9 +169,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; 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 210b4f21aaa4f..28b1a4f249795 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 @@ -135,9 +135,9 @@ public static EnumStringRequiredEnum fromValue(String value) { * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(Integer.valueOf(1)), - NUMBER_MINUS_1(-1); + NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -173,9 +173,9 @@ public static EnumIntegerEnum fromValue(Integer value) { * Gets or Sets enumIntegerOnly */ public enum EnumIntegerOnlyEnum { - NUMBER_2(2), + NUMBER_2(Integer.valueOf(2)), - NUMBER_MINUS_2(-2); + NUMBER_MINUS_2(Integer.valueOf(-2)); private Integer value; @@ -211,9 +211,9 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(Double.valueOf(1.1)), - NUMBER_MINUS_1_DOT_2(-1.2); + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value;