From def006920fcee366f71bafd4e452d9187b60b24a Mon Sep 17 00:00:00 2001 From: William Dutton Date: Thu, 15 Oct 2026 17:05:25 +1000 Subject: [PATCH 1/2] [#12911] [JAVA][Native] Improve handling of oneOf/anyOf with mixed object and lists etc Also correct any tests outside of native changes (unrelated but boyscout rule, don't leave broken tests in master) --- bin/configs/java-native-jackson3.yaml | 1 + .../libraries/native/anyof_model.mustache | 66 +-- .../libraries/native/oneof_model.mustache | 81 ++-- .../Java/libraries/native/pom.mustache | 12 +- .../Java/libraries/retrofit2/pom.mustache | 5 - ...odels-for-testing-with-http-signature.yaml | 30 ++ samples/client/echo_api/java/native/pom.xml | 4 +- .../native-async/.openapi-generator/FILES | 4 + .../petstore/java/native-async/README.md | 2 + .../java/native-async/api/openapi.yaml | 30 ++ .../java/native-async/docs/FruitOrFruits.md | 55 +++ .../java/native-async/docs/GmFruitOrFruits.md | 55 +++ .../client/petstore/java/native-async/pom.xml | 4 +- .../org/openapitools/client/model/Fruit.java | 42 +- .../client/model/FruitOrFruits.java | 437 +++++++++++++++++ .../openapitools/client/model/FruitReq.java | 40 +- .../openapitools/client/model/GmFruit.java | 10 +- .../client/model/GmFruitOrFruits.java | 314 +++++++++++++ .../org/openapitools/client/model/Mammal.java | 96 ++-- .../client/model/NullableShape.java | 74 +-- .../org/openapitools/client/model/Pig.java | 40 +- .../client/model/Quadrilateral.java | 70 +-- .../org/openapitools/client/model/Shape.java | 70 +-- .../client/model/ShapeOrNull.java | 70 +-- .../openapitools/client/model/Triangle.java | 60 ++- .../client/model/FruitOrFruitsTest.java | 68 +++ .../client/model/GmFruitOrFruitsTest.java | 68 +++ .../java/native-jackson3-jspecify/pom.xml | 6 +- .../native-jackson3/.openapi-generator/FILES | 4 + .../petstore/java/native-jackson3/README.md | 2 + .../java/native-jackson3/api/openapi.yaml | 30 ++ .../java/native-jackson3/build.gradle | 4 +- .../native-jackson3/docs/FruitOrFruits.md | 55 +++ .../native-jackson3/docs/GmFruitOrFruits.md | 55 +++ .../petstore/java/native-jackson3/pom.xml | 10 +- .../org/openapitools/client/ApiClient.java | 2 +- .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiResponse.java | 2 +- .../openapitools/client/Configuration.java | 2 +- .../java/org/openapitools/client/JSON.java | 4 +- .../java/org/openapitools/client/Pair.java | 2 +- .../client/RFC3339DateFormat.java | 2 +- .../client/RFC3339InstantDeserializer.java | 2 +- .../client/RFC3339JavaTimeModule.java | 2 +- .../client/ServerConfiguration.java | 2 +- .../openapitools/client/ServerVariable.java | 2 +- .../client/api/AnotherFakeApi.java | 12 +- .../openapitools/client/api/DefaultApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 210 ++++----- .../client/api/FakeClassnameTags123Api.java | 12 +- .../org/openapitools/client/api/PetApi.java | 92 ++-- .../org/openapitools/client/api/StoreApi.java | 32 +- .../org/openapitools/client/api/UserApi.java | 72 +-- .../client/model/AbstractOpenApiSchema.java | 2 +- .../model/AdditionalPropertiesClass.java | 66 +-- .../client/model/AllOfRefToDouble.java | 10 +- .../client/model/AllOfRefToFloat.java | 10 +- .../client/model/AllOfRefToLong.java | 10 +- .../org/openapitools/client/model/Animal.java | 18 +- .../org/openapitools/client/model/Apple.java | 18 +- .../openapitools/client/model/AppleReq.java | 18 +- .../model/ArrayOfArrayOfNumberOnly.java | 10 +- .../client/model/ArrayOfNumberOnly.java | 10 +- .../openapitools/client/model/ArrayTest.java | 26 +- .../org/openapitools/client/model/Banana.java | 10 +- .../openapitools/client/model/BananaReq.java | 18 +- .../openapitools/client/model/BasquePig.java | 10 +- .../client/model/Capitalization.java | 50 +- .../org/openapitools/client/model/Cat.java | 14 +- .../openapitools/client/model/Category.java | 18 +- .../openapitools/client/model/ChildCat.java | 18 +- .../openapitools/client/model/ClassModel.java | 10 +- .../org/openapitools/client/model/Client.java | 10 +- .../client/model/ComplexQuadrilateral.java | 18 +- .../openapitools/client/model/DanishPig.java | 10 +- .../client/model/DeprecatedObject.java | 10 +- .../org/openapitools/client/model/Dog.java | 14 +- .../openapitools/client/model/Drawing.java | 34 +- .../openapitools/client/model/EnumArrays.java | 18 +- .../openapitools/client/model/EnumTest.java | 74 +-- .../client/model/EquilateralTriangle.java | 18 +- .../model/FakeBigDecimalMap200Response.java | 18 +- .../client/model/FileSchemaTestClass.java | 18 +- .../org/openapitools/client/model/Foo.java | 10 +- .../client/model/FooGetDefaultResponse.java | 10 +- .../openapitools/client/model/FormatTest.java | 130 +++--- .../org/openapitools/client/model/Fruit.java | 44 +- .../client/model/FruitOrFruits.java | 437 +++++++++++++++++ .../openapitools/client/model/FruitReq.java | 42 +- .../openapitools/client/model/GmFruit.java | 12 +- .../client/model/GmFruitOrFruits.java | 315 +++++++++++++ .../client/model/GrandparentAnimal.java | 10 +- .../client/model/HasOnlyReadOnly.java | 10 +- .../client/model/HealthCheckResult.java | 10 +- .../client/model/IsoscelesTriangle.java | 18 +- .../org/openapitools/client/model/Mammal.java | 98 ++-- .../openapitools/client/model/MapTest.java | 34 +- ...ropertiesAndAdditionalPropertiesClass.java | 26 +- .../client/model/Model200Response.java | 18 +- .../client/model/ModelApiResponse.java | 26 +- .../openapitools/client/model/ModelFile.java | 10 +- .../openapitools/client/model/ModelList.java | 10 +- .../client/model/ModelReturn.java | 10 +- .../org/openapitools/client/model/Name.java | 26 +- .../client/model/NullableClass.java | 98 ++-- .../client/model/NullableShape.java | 76 +-- .../openapitools/client/model/NumberOnly.java | 10 +- .../model/ObjectWithDeprecatedFields.java | 34 +- .../org/openapitools/client/model/Order.java | 50 +- .../client/model/OuterComposite.java | 26 +- .../openapitools/client/model/ParentPet.java | 4 +- .../org/openapitools/client/model/Pet.java | 50 +- .../org/openapitools/client/model/Pig.java | 42 +- .../client/model/Quadrilateral.java | 72 +-- .../client/model/QuadrilateralInterface.java | 10 +- .../client/model/ReadOnlyFirst.java | 14 +- .../client/model/ScaleneTriangle.java | 18 +- .../org/openapitools/client/model/Shape.java | 72 +-- .../client/model/ShapeInterface.java | 10 +- .../client/model/ShapeOrNull.java | 72 +-- .../client/model/SimpleQuadrilateral.java | 18 +- .../client/model/SpecialModelName.java | 18 +- .../org/openapitools/client/model/Tag.java | 18 +- ...neFreeformAdditionalPropertiesRequest.java | 10 +- .../openapitools/client/model/Triangle.java | 62 ++- .../client/model/TriangleInterface.java | 10 +- .../org/openapitools/client/model/User.java | 98 ++-- .../org/openapitools/client/model/Whale.java | 26 +- .../org/openapitools/client/model/Zebra.java | 18 +- .../client/model/FruitOrFruitsTest.java | 68 +++ .../client/model/GmFruitOrFruitsTest.java | 68 +++ .../petstore/java/native-jakarta/pom.xml | 6 +- .../java/native-useGzipFeature/pom.xml | 6 +- .../java/native/.openapi-generator/FILES | 4 + samples/client/petstore/java/native/README.md | 2 + .../petstore/java/native/api/openapi.yaml | 30 ++ .../java/native/docs/FruitOrFruits.md | 55 +++ .../java/native/docs/GmFruitOrFruits.md | 55 +++ samples/client/petstore/java/native/pom.xml | 6 +- .../org/openapitools/client/model/Fruit.java | 42 +- .../client/model/FruitOrFruits.java | 439 ++++++++++++++++++ .../openapitools/client/model/FruitReq.java | 40 +- .../openapitools/client/model/GmFruit.java | 10 +- .../client/model/GmFruitOrFruits.java | 316 +++++++++++++ .../org/openapitools/client/model/Mammal.java | 96 ++-- .../client/model/NullableShape.java | 74 +-- .../org/openapitools/client/model/Pig.java | 40 +- .../client/model/Quadrilateral.java | 70 +-- .../org/openapitools/client/model/Shape.java | 70 +-- .../client/model/ShapeOrNull.java | 70 +-- .../openapitools/client/model/Triangle.java | 60 ++- .../client/model/FruitOrFruitsTest.java | 68 +++ .../client/model/GmFruitOrFruitsTest.java | 68 +++ .../petstore/java/retrofit2-play26/pom.xml | 5 - 154 files changed, 5337 insertions(+), 1691 deletions(-) create mode 100644 samples/client/petstore/java/native-async/docs/FruitOrFruits.md create mode 100644 samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java create mode 100644 samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md create mode 100644 samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md create mode 100644 samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java create mode 100644 samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java create mode 100644 samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java create mode 100644 samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java create mode 100644 samples/client/petstore/java/native/docs/FruitOrFruits.md create mode 100644 samples/client/petstore/java/native/docs/GmFruitOrFruits.md create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java diff --git a/bin/configs/java-native-jackson3.yaml b/bin/configs/java-native-jackson3.yaml index 2be924aa84d4..5c34aa9f44b5 100644 --- a/bin/configs/java-native-jackson3.yaml +++ b/bin/configs/java-native-jackson3.yaml @@ -9,4 +9,5 @@ additionalProperties: generateBuilders: true useReflectionEqualsHashCode: "true" useJackson3: "true" + useJakartaEe: "true" openApiNullable: "false" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache index c977cbf355d2..178c71f8e1c7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache @@ -31,7 +31,7 @@ import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -@JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) +@JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); @@ -90,11 +90,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#anyOf}} // deserialize {{{.}}} try { + final {{jacksonPackage}}.core.type.TypeReference<{{{.}}}> candidateRef = new {{jacksonPackage}}.core.type.TypeReference<{{{.}}}>() {}; {{^useJackson3}} - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); {{/useJackson3}} {{#useJackson3}} - deserialized = ctxt.readTreeAsValue(tree, {{{.}}}.class); + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); {{/useJackson3}} {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -159,17 +160,28 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} - {{#anyOf}} - public {{classname}}({{{.}}} o) { + {{#composedSchemas.anyOf}} + {{^isArray}} + {{^isMap}} + public {{classname}}({{{dataType}}} o) { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/isMap}} + {{/isArray}} - {{/anyOf}} + {{/composedSchemas.anyOf}} + {{#vendorExtensions.x-has-list-alternative}} + public {{classname}}(java.util.List o) { + this(); + setActualInstance(o); + } + + {{/vendorExtensions.x-has-list-alternative}} static { - {{#anyOf}} - schemas.put("{{{.}}}", {{{.}}}.class); - {{/anyOf}} + {{#composedSchemas.anyOf}} + schemas.put("{{{dataType}}}", {{#isArray}}{{#uniqueItems}}java.util.Set{{/uniqueItems}}{{^uniqueItems}}java.util.List{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class); + {{/composedSchemas.anyOf}} JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. @@ -190,7 +202,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im /** * Set the instance that matches the anyOf child schema, check * the instance parameter is valid against the anyOf child schemas: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * {{#anyOf}}{{.}}{{^-last}}, {{/-last}}{{/anyOf}} * * It could be an instance of the 'anyOf' schemas. * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). @@ -204,40 +216,40 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} - {{#anyOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + {{#composedSchemas.anyOf}} + if (JSON.isInstanceOf({{#isArray}}{{#uniqueItems}}java.util.Set{{/uniqueItems}}{{^uniqueItems}}java.util.List{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - {{/anyOf}} + {{/composedSchemas.anyOf}} throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); } /** * Get the actual instance, which can be the following: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * {{#anyOf}}{{.}}{{^-last}}, {{/-last}}{{/anyOf}} * - * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) + * @return The actual instance ({{#anyOf}}{{.}}{{^-last}}, {{/-last}}{{/anyOf}}) */ @Override public Object getActualInstance() { return super.getActualInstance(); } - {{#anyOf}} + {{#composedSchemas.anyOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{dataType}}` + * @throws ClassCastException if the instance is not `{{dataType}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + public {{{dataType}}} get{{#isArray}}{{#uniqueItems}}Set{{{items.dataType}}}{{/uniqueItems}}{{^uniqueItems}}List{{{items.dataType}}}{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}Map{{{items.dataType}}}{{/isMap}}{{^isMap}}{{/isMap}}{{{dataType}}}{{/isArray}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } - {{/anyOf}} + {{/composedSchemas.anyOf}} {{#supportUrlQuery}} @@ -275,7 +287,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#composedSchemas.oneOf}} {{^vendorExtensions.x-duplicated-data-type}} - if (getActualInstance() instanceof {{{dataType}}}) { + if (getActualInstance() instanceof {{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{/isMap}}{{{dataType}}}{{/isArray}}) { {{#isArray}} {{#items.isPrimitiveType}} {{#uniqueItems}} @@ -315,9 +327,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/uniqueItems}} {{^uniqueItems}} if (getActualInstance() != null) { - for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { - if ((({{{dataType}}})getActualInstance()).get(i) != null) { - joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%s{{baseName}}%s%s", prefix, suffix, + {{{dataType}}} items = ({{{dataType}}}) getActualInstance(); + for (int i = 0; i < items.size(); i++) { + {{{items.dataType}}} item = items.get(i); + if (item != null) { + joiner.add(item.toUrlQueryString(String.format(java.util.Locale.ROOT, "%s{{baseName}}%s%s", prefix, suffix, "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache index 1ecfc5679a64..3517fcfb0315 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache @@ -115,15 +115,23 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#oneOf}} // deserialize {{{.}}} try { + final {{jacksonPackage}}.core.type.TypeReference<{{{.}}}> candidateRef = new {{jacksonPackage}}.core.type.TypeReference<{{{.}}}>() {}; + final {{jacksonPackage}}.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); {{#isNullable}} attemptParsing |= (token == JsonToken.VALUE_NULL); {{/isNullable}} @@ -131,10 +139,10 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } if (attemptParsing) { {{^useJackson3}} - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); {{/useJackson3}} {{#useJackson3}} - deserialized = ctxt.readTreeAsValue(tree, {{{.}}}.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); {{/useJackson3}} // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON @@ -207,17 +215,28 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} - {{#oneOf}} - public {{classname}}({{{.}}} o) { + {{#composedSchemas.oneOf}} + {{^isArray}} + {{^isMap}} + public {{classname}}({{{dataType}}} o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/isMap}} + {{/isArray}} - {{/oneOf}} + {{/composedSchemas.oneOf}} + {{#vendorExtensions.x-has-list-alternative}} + public {{classname}}(java.util.List o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + {{/vendorExtensions.x-has-list-alternative}} static { - {{#oneOf}} - schemas.put("{{{.}}}", {{{.}}}.class); - {{/oneOf}} + {{#composedSchemas.oneOf}} + schemas.put("{{{dataType}}}", {{#isArray}}{{#uniqueItems}}java.util.Set{{/uniqueItems}}{{^uniqueItems}}java.util.List{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class); + {{/composedSchemas.oneOf}} JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. @@ -238,7 +257,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * {{#oneOf}}{{.}}{{^-last}}, {{/-last}}{{/oneOf}} * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -252,40 +271,40 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} - {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + {{#composedSchemas.oneOf}} + if (JSON.isInstanceOf({{#isArray}}{{#uniqueItems}}java.util.Set{{/uniqueItems}}{{^uniqueItems}}java.util.List{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - {{/oneOf}} + {{/composedSchemas.oneOf}} throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } /** * Get the actual instance, which can be the following: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * {{#oneOf}}{{.}}{{^-last}}, {{/-last}}{{/oneOf}} * - * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + * @return The actual instance ({{#oneOf}}{{.}}{{^-last}}, {{/-last}}{{/oneOf}}) */ @Override public Object getActualInstance() { return super.getActualInstance(); } - {{#oneOf}} + {{#composedSchemas.oneOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{dataType}}`. If the actual instance is not `{{dataType}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{dataType}}` + * @throws ClassCastException if the instance is not `{{dataType}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + public {{{dataType}}} get{{#isArray}}{{#uniqueItems}}Set{{{items.dataType}}}{{/uniqueItems}}{{^uniqueItems}}List{{{items.dataType}}}{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}Map{{{items.dataType}}}{{/isMap}}{{^isMap}}{{/isMap}}{{{dataType}}}{{/isArray}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } - {{/oneOf}} + {{/composedSchemas.oneOf}} {{#supportUrlQuery}} @@ -323,7 +342,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#composedSchemas.oneOf}} {{^vendorExtensions.x-duplicated-data-type}} - if (getActualInstance() instanceof {{{dataType}}}) { + if (getActualInstance() instanceof {{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{/isMap}}{{{dataType}}}{{/isArray}}) { {{#isArray}} {{#items.isPrimitiveType}} {{#uniqueItems}} @@ -363,9 +382,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/uniqueItems}} {{^uniqueItems}} if (getActualInstance() != null) { - for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { - if ((({{{dataType}}})getActualInstance()).get(i) != null) { - joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%s{{baseName}}%s%s", prefix, suffix, + {{{dataType}}} items = ({{{dataType}}}) getActualInstance(); + for (int i = 0; i < items.size(); i++) { + {{{items.dataType}}} item = items.get(i); + if (item != null) { + joiner.add(item.toUrlQueryString(String.format(java.util.Locale.ROOT, "%s{{baseName}}%s%s", prefix, suffix, "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index 80363c09adcb..38f8325d1623 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -340,17 +340,17 @@ 17 {{/useJackson3}} {{^useJackson3}} - 2.21.6 - 2.21 + 2.22.3 + 2.22 0.2.12 {{/useJackson3}} {{#useJackson3}} - 3.1.6 - 2.21 + 3.2.3 + 2.22 0.2.12 {{/useJackson3}} {{#useJakartaEe}} - 2.1.1 + 3.0.0 3.0.2 {{/useJakartaEe}} {{^useJakartaEe}} @@ -361,7 +361,7 @@ 4.5.14 {{/hasFormParamsInSpec}} {{#useReflectionEqualsHashCode}} - 3.17.0 + 3.21.0 {{/useReflectionEqualsHashCode}} 5.10.2 2.27.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 01969888564b..f8365ce45314 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -344,11 +344,6 @@ play-ahc-ws_2.12 ${play-version} - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - {{/usePlayWS}} {{#parcelableModel}} diff --git a/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 8f758bf5f5f5..c2f4fb4b9420 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1965,6 +1965,21 @@ components: additionalProperties: type: object nullable: true + fruitOrFruits: + properties: + color: + type: string + x-has-list-alternative: true + oneOf: + - $ref: "#/components/schemas/apple" + - type: array + items: + $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + - type: array + items: + $ref: "#/components/schemas/banana" + additionalProperties: false fruit: properties: color: @@ -2042,6 +2057,21 @@ components: type: string required: - className + gmFruitOrFruits: + properties: + color: + type: string + x-has-list-alternative: true + anyOf: + - $ref: "#/components/schemas/apple" + - type: array + items: + $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + - type: array + items: + $ref: "#/components/schemas/banana" + additionalProperties: false gmFruit: properties: color: diff --git a/samples/client/echo_api/java/native/pom.xml b/samples/client/echo_api/java/native/pom.xml index fcc14baf2e10..cd5dd6bb6cf7 100644 --- a/samples/client/echo_api/java/native/pom.xml +++ b/samples/client/echo_api/java/native/pom.xml @@ -253,8 +253,8 @@ UTF-8 11 11 - 2.21.6 - 2.21 + 2.22.3 + 2.22 0.2.12 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/native-async/.openapi-generator/FILES b/samples/client/petstore/java/native-async/.openapi-generator/FILES index 8dc201491a16..8b1c02a8644f 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-async/.openapi-generator/FILES @@ -43,8 +43,10 @@ docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md docs/Fruit.md +docs/FruitOrFruits.md docs/FruitReq.md docs/GmFruit.md +docs/GmFruitOrFruits.md docs/GrandparentAnimal.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md @@ -152,8 +154,10 @@ src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java src/main/java/org/openapitools/client/model/FormatTest.java src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitOrFruits.java src/main/java/org/openapitools/client/model/FruitReq.java src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GmFruitOrFruits.java src/main/java/org/openapitools/client/model/GrandparentAnimal.java src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java src/main/java/org/openapitools/client/model/HealthCheckResult.java diff --git a/samples/client/petstore/java/native-async/README.md b/samples/client/petstore/java/native-async/README.md index f3f4adb73544..3d7051df0da7 100644 --- a/samples/client/petstore/java/native-async/README.md +++ b/samples/client/petstore/java/native-async/README.md @@ -234,8 +234,10 @@ Class | Method | HTTP request | Description - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) + - [FruitOrFruits](docs/FruitOrFruits.md) - [FruitReq](docs/FruitReq.md) - [GmFruit](docs/GmFruit.md) + - [GmFruitOrFruits](docs/GmFruitOrFruits.md) - [GrandparentAnimal](docs/GrandparentAnimal.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index c999de47bc75..5ff275a6e8b1 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -2040,6 +2040,21 @@ components: type: object type: object type: object + fruitOrFruits: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/apple" + - items: + $ref: "#/components/schemas/apple" + type: array + - $ref: "#/components/schemas/banana" + - items: + $ref: "#/components/schemas/banana" + type: array + properties: + color: + type: string + x-has-list-alternative: true fruit: additionalProperties: false oneOf: @@ -2115,6 +2130,21 @@ components: required: - className type: object + gmFruitOrFruits: + additionalProperties: false + anyOf: + - $ref: "#/components/schemas/apple" + - items: + $ref: "#/components/schemas/apple" + type: array + - $ref: "#/components/schemas/banana" + - items: + $ref: "#/components/schemas/banana" + type: array + properties: + color: + type: string + x-has-list-alternative: true gmFruit: additionalProperties: false anyOf: diff --git a/samples/client/petstore/java/native-async/docs/FruitOrFruits.md b/samples/client/petstore/java/native-async/docs/FruitOrFruits.md new file mode 100644 index 000000000000..a271b07800ac --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/FruitOrFruits.md @@ -0,0 +1,55 @@ + + +# FruitOrFruits + +## oneOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) +* [List](List.md) +* [List](List.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.FruitOrFruits; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.openapitools.client.model.List; +import org.openapitools.client.model.List; + +public class Example { + public static void main(String[] args) { + FruitOrFruits exampleFruitOrFruits = new FruitOrFruits(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set FruitOrFruits to Apple + exampleFruitOrFruits.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleFruitOrFruits.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set FruitOrFruits to Banana + exampleFruitOrFruits.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set FruitOrFruits to List + exampleFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set FruitOrFruits to List + exampleFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleFruitOrFruits.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md b/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md new file mode 100644 index 000000000000..74b1e425d966 --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md @@ -0,0 +1,55 @@ + + +# GmFruitOrFruits + +## anyOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) +* [List](List.md) +* [List](List.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.GmFruitOrFruits; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.openapitools.client.model.List; +import org.openapitools.client.model.List; + +public class Example { + public static void main(String[] args) { + GmFruitOrFruits exampleGmFruitOrFruits = new GmFruitOrFruits(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set GmFruitOrFruits to Apple + exampleGmFruitOrFruits.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleGmFruitOrFruits.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set GmFruitOrFruits to Banana + exampleGmFruitOrFruits.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleGmFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set GmFruitOrFruits to List + exampleGmFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleGmFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set GmFruitOrFruits to List + exampleGmFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleGmFruitOrFruits.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-async/pom.xml b/samples/client/petstore/java/native-async/pom.xml index af5ee3105170..c98e75ee0540 100644 --- a/samples/client/petstore/java/native-async/pom.xml +++ b/samples/client/petstore/java/native-async/pom.xml @@ -253,8 +253,8 @@ UTF-8 11 11 - 2.21.6 - 2.21 + 2.22.3 + 2.22 0.2.12 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java index 81772166db2e..a23627bc8c7f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java @@ -94,19 +94,27 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Apple try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -120,19 +128,27 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx // deserialize Banana try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -169,7 +185,7 @@ public Fruit() { } public Fruit(Apple o) { - super("oneOf", Boolean.FALSE); + super("oneOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java new file mode 100644 index 000000000000..0573c1064128 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java @@ -0,0 +1,437 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = FruitOrFruits.FruitOrFruitsDeserializer.class) +@JsonSerialize(using = FruitOrFruits.FruitOrFruitsSerializer.class) +public class FruitOrFruits extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FruitOrFruits.class.getName()); + + public static class FruitOrFruitsSerializer extends StdSerializer { + public FruitOrFruitsSerializer(Class t) { + super(t); + } + + public FruitOrFruitsSerializer() { + this(null); + } + + @Override + public void serialize(FruitOrFruits value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class FruitOrFruitsDeserializer extends StdDeserializer { + public FruitOrFruitsDeserializer() { + this(FruitOrFruits.class); + } + + public FruitOrFruitsDeserializer(Class vc) { + super(vc); + } + + @Override + public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = ctxt.readTree(jp); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Apple + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + if (match == 1) { + FruitOrFruits ret = new FruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for FruitOrFruits: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public FruitOrFruits getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "FruitOrFruits cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public FruitOrFruits() { + super("oneOf", Boolean.FALSE); + } + + public FruitOrFruits(Apple o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + + public FruitOrFruits(Banana o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + + public FruitOrFruits(java.util.List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("List", java.util.List.class); + schemas.put("Banana", Banana.class); + schemas.put("List", java.util.List.class); + JSON.registerDescendants(FruitOrFruits.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return FruitOrFruits.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Apple, Banana, List<Apple>, List<Banana> + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, List, List"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana, List<Apple>, List<Banana> + * + * @return The actual instance (Apple, Banana, List<Apple>, List<Banana>) + */ + @Override + public Object getActualInstance() { + return super.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` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Apple>`. If the actual instance is not `List<Apple>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Apple>` + * @throws ClassCastException if the instance is not `List<Apple>` + */ + public List getListApple() throws ClassCastException { + return (List)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` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Banana>`. If the actual instance is not `List<Banana>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Banana>` + * @throws ClassCastException if the instance is not `List<Banana>` + */ + public List getListBanana() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Apple) { + if (getActualInstance() != null) { + joiner.add(((Apple)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof List) { + if (getActualInstance() != null) { + List items = (List) getActualInstance(); + for (int i = 0; i < items.size(); i++) { + Apple item = items.get(i); + if (item != null) { + joiner.add(item.toUrlQueryString(String.format(java.util.Locale.ROOT, "%sone_of_1%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + return joiner.toString(); + } + if (getActualInstance() instanceof Banana) { + if (getActualInstance() != null) { + joiner.add(((Banana)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java index b0f492c48845..31dcae532dfe 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java @@ -94,19 +94,27 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize AppleReq try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -120,19 +128,27 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize BananaReq try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java index 983d6c559949..fd66bad0eacd 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java @@ -53,7 +53,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") -@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) +@JsonDeserialize(using = GmFruit.GmFruitDeserializer.class) @JsonSerialize(using = GmFruit.GmFruitSerializer.class) public class GmFruit extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(GmFruit.class.getName()); @@ -89,7 +89,8 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO Object deserialized = null; // deserialize Apple try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -100,7 +101,8 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO // deserialize Banana try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -129,7 +131,7 @@ public GmFruit() { } public GmFruit(Apple o) { - super("anyOf", Boolean.FALSE); + super("anyOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java new file mode 100644 index 000000000000..a8212e46a313 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java @@ -0,0 +1,314 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = GmFruitOrFruits.GmFruitOrFruitsDeserializer.class) +@JsonSerialize(using = GmFruitOrFruits.GmFruitOrFruitsSerializer.class) +public class GmFruitOrFruits extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GmFruitOrFruits.class.getName()); + + public static class GmFruitOrFruitsSerializer extends StdSerializer { + public GmFruitOrFruitsSerializer(Class t) { + super(t); + } + + public GmFruitOrFruitsSerializer() { + this(null); + } + + @Override + public void serialize(GmFruitOrFruits value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class GmFruitOrFruitsDeserializer extends StdDeserializer { + public GmFruitOrFruitsDeserializer() { + this(GmFruitOrFruits.class); + } + + public GmFruitOrFruitsDeserializer(Class vc) { + super(vc); + } + + @Override + public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = ctxt.readTree(jp); + + Object deserialized = null; + // deserialize Apple + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize Banana + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + throw new IOException("Failed deserialization for GmFruitOrFruits: no match found"); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public GmFruitOrFruits getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "GmFruitOrFruits cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public GmFruitOrFruits() { + super("anyOf", Boolean.FALSE); + } + + public GmFruitOrFruits(Apple o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + + public GmFruitOrFruits(Banana o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + + public GmFruitOrFruits(java.util.List o) { + this(); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("List", java.util.List.class); + schemas.put("Banana", Banana.class); + schemas.put("List", java.util.List.class); + JSON.registerDescendants(GmFruitOrFruits.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return GmFruitOrFruits.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Apple, Banana, List<Apple>, List<Banana> + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, List, List"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana, List<Apple>, List<Banana> + * + * @return The actual instance (Apple, Banana, List<Apple>, List<Banana>) + */ + @Override + public Object getActualInstance() { + return super.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` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Apple>`. If the actual instance is not `List<Apple>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Apple>` + * @throws ClassCastException if the instance is not `List<Apple>` + */ + public List getListApple() throws ClassCastException { + return (List)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` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Banana>`. If the actual instance is not `List<Banana>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Banana>` + * @throws ClassCastException if the instance is not `List<Banana>` + */ + public List getListBanana() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java index 1f009166ba38..c2c212fce434 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java @@ -97,19 +97,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Pig try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -123,19 +131,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE // deserialize Whale try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -149,19 +165,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE // deserialize Zebra try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -197,25 +221,25 @@ public Mammal() { super("oneOf", Boolean.FALSE); } - public Mammal(Pig o) { + public Mammal(Whale o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Mammal(Whale o) { + public Mammal(Zebra o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Mammal(Zebra o) { + public Mammal(Pig o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Pig", Pig.class); schemas.put("Whale", Whale.class); schemas.put("Zebra", Zebra.class); + schemas.put("Pig", Pig.class); JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -241,17 +265,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; } @@ -270,17 +294,6 @@ public Object getActualInstance() { return 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(); - } - /** * Get the actual instance of `Whale`. If the actual instance is not `Whale`, * the ClassCastException will be thrown. @@ -303,6 +316,17 @@ 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/NullableShape.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java index cb2e423e9a53..d44b4ad3011a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java @@ -96,20 +96,28 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -123,20 +131,28 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize Triangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -172,19 +188,19 @@ public NullableShape() { super("oneOf", Boolean.TRUE); } - public NullableShape(Quadrilateral o) { - super("oneOf", Boolean.TRUE); + public NullableShape(Triangle o) { + super("oneOf", Boolean.FALSE); setActualInstance(o); } - public NullableShape(Triangle o) { - super("oneOf", Boolean.TRUE); + public NullableShape(Quadrilateral o) { + super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -214,12 +230,12 @@ public void setActualInstance(Object instance) { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -239,25 +255,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java index c4b33f81de9e..b7a7f9f1f972 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java @@ -96,19 +96,27 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize BasquePig try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -122,19 +130,27 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce // deserialize DanishPig try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java index d261b0f4237a..e01edaac22e3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -96,19 +96,27 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize ComplexQuadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -122,19 +130,27 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize SimpleQuadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -170,19 +186,19 @@ public Quadrilateral() { super("oneOf", Boolean.FALSE); } - public Quadrilateral(ComplexQuadrilateral o) { + public Quadrilateral(SimpleQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Quadrilateral(SimpleQuadrilateral o) { + public Quadrilateral(ComplexQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); schemas.put("SimpleQuadrilateral", SimpleQuadrilateral.class); + schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -207,12 +223,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -232,25 +248,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `ComplexQuadrilateral` - * @throws ClassCastException if the instance is not `ComplexQuadrilateral` + * @return The actual instance of `SimpleQuadrilateral` + * @throws ClassCastException if the instance is not `SimpleQuadrilateral` */ - public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { - return (ComplexQuadrilateral)super.getActualInstance(); + public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { + return (SimpleQuadrilateral)super.getActualInstance(); } /** - * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `SimpleQuadrilateral` - * @throws ClassCastException if the instance is not `SimpleQuadrilateral` + * @return The actual instance of `ComplexQuadrilateral` + * @throws ClassCastException if the instance is not `ComplexQuadrilateral` */ - public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { - return (SimpleQuadrilateral)super.getActualInstance(); + public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { + return (ComplexQuadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java index 63ab52872bca..764973fb0984 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java @@ -96,19 +96,27 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -122,19 +130,27 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx // deserialize Triangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -170,19 +186,19 @@ public Shape() { super("oneOf", Boolean.FALSE); } - public Shape(Quadrilateral o) { + public Shape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Shape(Triangle o) { + public Shape(Quadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -207,12 +223,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -232,25 +248,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 566047895075..cbbe1e63bd61 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -96,19 +96,27 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -122,19 +130,27 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw // deserialize Triangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -170,19 +186,19 @@ public ShapeOrNull() { super("oneOf", Boolean.FALSE); } - public ShapeOrNull(Quadrilateral o) { + public ShapeOrNull(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public ShapeOrNull(Triangle o) { + public ShapeOrNull(Quadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -207,12 +223,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -232,25 +248,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java index ab135668d014..3d4ef7bf2196 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java @@ -97,19 +97,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize EquilateralTriangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -123,19 +131,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize IsoscelesTriangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -149,19 +165,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize ScaleneTriangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java new file mode 100644 index 000000000000..1f825fbe6b32 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FruitOrFruits + */ +class FruitOrFruitsTest { + private final FruitOrFruits model = new FruitOrFruits(); + + /** + * Model tests for FruitOrFruits + */ + @Test + void testFruitOrFruits() { + // TODO: test FruitOrFruits + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java new file mode 100644 index 000000000000..3e630b9349f2 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GmFruitOrFruits + */ +class GmFruitOrFruitsTest { + private final GmFruitOrFruits model = new GmFruitOrFruits(); + + /** + * Model tests for GmFruitOrFruits + */ + @Test + void testGmFruitOrFruits() { + // TODO: test GmFruitOrFruits + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-jackson3-jspecify/pom.xml b/samples/client/petstore/java/native-jackson3-jspecify/pom.xml index 40720e41decb..6183e60f1c36 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/pom.xml +++ b/samples/client/petstore/java/native-jackson3-jspecify/pom.xml @@ -253,13 +253,13 @@ UTF-8 17 17 - 3.1.6 - 2.21 + 3.2.3 + 2.22 0.2.12 1.3.5 2.0.2 4.5.14 - 3.17.0 + 3.21.0 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native-jackson3/.openapi-generator/FILES b/samples/client/petstore/java/native-jackson3/.openapi-generator/FILES index 8dc201491a16..8b1c02a8644f 100644 --- a/samples/client/petstore/java/native-jackson3/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-jackson3/.openapi-generator/FILES @@ -43,8 +43,10 @@ docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md docs/Fruit.md +docs/FruitOrFruits.md docs/FruitReq.md docs/GmFruit.md +docs/GmFruitOrFruits.md docs/GrandparentAnimal.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md @@ -152,8 +154,10 @@ src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java src/main/java/org/openapitools/client/model/FormatTest.java src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitOrFruits.java src/main/java/org/openapitools/client/model/FruitReq.java src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GmFruitOrFruits.java src/main/java/org/openapitools/client/model/GrandparentAnimal.java src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java src/main/java/org/openapitools/client/model/HealthCheckResult.java diff --git a/samples/client/petstore/java/native-jackson3/README.md b/samples/client/petstore/java/native-jackson3/README.md index bbad8d7bf97f..7611fded588d 100644 --- a/samples/client/petstore/java/native-jackson3/README.md +++ b/samples/client/petstore/java/native-jackson3/README.md @@ -233,8 +233,10 @@ Class | Method | HTTP request | Description - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) + - [FruitOrFruits](docs/FruitOrFruits.md) - [FruitReq](docs/FruitReq.md) - [GmFruit](docs/GmFruit.md) + - [GmFruitOrFruits](docs/GmFruitOrFruits.md) - [GrandparentAnimal](docs/GrandparentAnimal.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) diff --git a/samples/client/petstore/java/native-jackson3/api/openapi.yaml b/samples/client/petstore/java/native-jackson3/api/openapi.yaml index c999de47bc75..5ff275a6e8b1 100644 --- a/samples/client/petstore/java/native-jackson3/api/openapi.yaml +++ b/samples/client/petstore/java/native-jackson3/api/openapi.yaml @@ -2040,6 +2040,21 @@ components: type: object type: object type: object + fruitOrFruits: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/apple" + - items: + $ref: "#/components/schemas/apple" + type: array + - $ref: "#/components/schemas/banana" + - items: + $ref: "#/components/schemas/banana" + type: array + properties: + color: + type: string + x-has-list-alternative: true fruit: additionalProperties: false oneOf: @@ -2115,6 +2130,21 @@ components: required: - className type: object + gmFruitOrFruits: + additionalProperties: false + anyOf: + - $ref: "#/components/schemas/apple" + - items: + $ref: "#/components/schemas/apple" + type: array + - $ref: "#/components/schemas/banana" + - items: + $ref: "#/components/schemas/banana" + type: array + properties: + color: + type: string + x-has-list-alternative: true gmFruit: additionalProperties: false anyOf: diff --git a/samples/client/petstore/java/native-jackson3/build.gradle b/samples/client/petstore/java/native-jackson3/build.gradle index fe44c669cc38..e44491641f42 100644 --- a/samples/client/petstore/java/native-jackson3/build.gradle +++ b/samples/client/petstore/java/native-jackson3/build.gradle @@ -70,8 +70,8 @@ artifacts { ext { jackson3_version = "3.1.6" jackson_annotations_version = "2.21" - jakarta_annotation_version = "1.3.5" - beanvalidation_version = "2.0.2" + jakarta_annotation_version = "2.1.1" + beanvalidation_version = "3.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" commons_lang3_version = "3.17.0" diff --git a/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md b/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md new file mode 100644 index 000000000000..a271b07800ac --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md @@ -0,0 +1,55 @@ + + +# FruitOrFruits + +## oneOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) +* [List](List.md) +* [List](List.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.FruitOrFruits; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.openapitools.client.model.List; +import org.openapitools.client.model.List; + +public class Example { + public static void main(String[] args) { + FruitOrFruits exampleFruitOrFruits = new FruitOrFruits(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set FruitOrFruits to Apple + exampleFruitOrFruits.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleFruitOrFruits.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set FruitOrFruits to Banana + exampleFruitOrFruits.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set FruitOrFruits to List + exampleFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set FruitOrFruits to List + exampleFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleFruitOrFruits.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md b/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md new file mode 100644 index 000000000000..74b1e425d966 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md @@ -0,0 +1,55 @@ + + +# GmFruitOrFruits + +## anyOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) +* [List](List.md) +* [List](List.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.GmFruitOrFruits; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.openapitools.client.model.List; +import org.openapitools.client.model.List; + +public class Example { + public static void main(String[] args) { + GmFruitOrFruits exampleGmFruitOrFruits = new GmFruitOrFruits(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set GmFruitOrFruits to Apple + exampleGmFruitOrFruits.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleGmFruitOrFruits.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set GmFruitOrFruits to Banana + exampleGmFruitOrFruits.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleGmFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set GmFruitOrFruits to List + exampleGmFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleGmFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set GmFruitOrFruits to List + exampleGmFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleGmFruitOrFruits.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/pom.xml b/samples/client/petstore/java/native-jackson3/pom.xml index 2c72c6793378..dd0c3b4444fc 100644 --- a/samples/client/petstore/java/native-jackson3/pom.xml +++ b/samples/client/petstore/java/native-jackson3/pom.xml @@ -255,13 +255,13 @@ UTF-8 17 17 - 3.1.6 - 2.21 + 3.2.3 + 2.22 0.2.12 - 1.3.5 - 2.0.2 + 3.0.0 + 3.0.2 4.5.14 - 3.17.0 + 3.21.0 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java index 8f6e191317c4..eb9f6e593e79 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java @@ -54,7 +54,7 @@ *

The setter methods of this class return the current object to facilitate * a fluent style of configuration.

*/ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ApiClient { protected HttpClient.Builder builder; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java index e83cfb059268..df2316b225c7 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java @@ -15,7 +15,7 @@ import java.net.http.HttpHeaders; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java index 2a5446725744..3cb2b8bfde38 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java @@ -21,7 +21,7 @@ * * @param The type of data that is deserialized from response body */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ApiResponse { final private int statusCode; final private Map> headers; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java index 2bac8998c981..82cee98f780a 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java index d01e7f33355e..b166183388a7 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java @@ -26,7 +26,7 @@ import java.util.Map; import java.util.Set; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class JSON { private ObjectMapper mapper; @@ -78,7 +78,7 @@ public static Class getClassForElement(JsonNode node, Class modelClass) { /** * Helper class to register the discriminator mappings. */ - @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") + @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") private static class ClassDiscriminatorMapping { // The model class name. Class modelClass; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java index c4b7c6f8fc98..a0fe7ce2c305 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Pair { private final String name; private final String value; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 8a3efd1dad9c..fbc6cb891c15 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -21,7 +21,7 @@ import java.util.TimeZone; import tools.jackson.databind.util.StdDateFormat; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java index 5f1e86824349..3e1c0914769f 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -28,7 +28,7 @@ import tools.jackson.databind.cfg.DateTimeFeature; import tools.jackson.databind.ext.javatime.deser.InstantDeserializer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class RFC3339InstantDeserializer extends InstantDeserializer { private static final long serialVersionUID = 1L; private final static boolean DEFAULT_NORMALIZE_ZONE_ID = DateTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java index bb53571c4d3b..97fe28226958 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -18,7 +18,7 @@ import tools.jackson.databind.module.SimpleModule; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class RFC3339JavaTimeModule extends SimpleModule { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java index c71e6c126455..7b9ffeb71ee0 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -18,7 +18,7 @@ /** * Representing a Server configuration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java index fc7bd5b4150b..7237f0d0a6fe 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java @@ -18,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index a100f5b9a5d9..00dbffb73761 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -46,7 +46,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class AnotherFakeApi { /** * Utility class for extending HttpRequest.Builder functionality. @@ -170,7 +170,7 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * @return Client * @throws ApiException if fails to make API call */ - public Client call123testSpecialTags(@javax.annotation.Nonnull Client client) throws ApiException { + public Client call123testSpecialTags(@jakarta.annotation.Nonnull Client client) throws ApiException { return call123testSpecialTags(client, null); } @@ -182,7 +182,7 @@ public Client call123testSpecialTags(@javax.annotation.Nonnull Client client) th * @return Client * @throws ApiException if fails to make API call */ - public Client call123testSpecialTags(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + public Client call123testSpecialTags(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { ApiResponse localVarResponse = call123testSpecialTagsWithHttpInfo(client, headers); return localVarResponse.getData(); } @@ -194,7 +194,7 @@ public Client call123testSpecialTags(@javax.annotation.Nonnull Client client, Ma * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse call123testSpecialTagsWithHttpInfo(@javax.annotation.Nonnull Client client) throws ApiException { + public ApiResponse call123testSpecialTagsWithHttpInfo(@jakarta.annotation.Nonnull Client client) throws ApiException { return call123testSpecialTagsWithHttpInfo(client, null); } @@ -206,7 +206,7 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(@javax.annotation. * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse call123testSpecialTagsWithHttpInfo(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + public ApiResponse call123testSpecialTagsWithHttpInfo(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(client, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -254,7 +254,7 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(@javax.annotation. } } - private HttpRequest.Builder call123testSpecialTagsRequestBuilder(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + private HttpRequest.Builder call123testSpecialTagsRequestBuilder(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { // verify the required parameter 'client' is set if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java index 42fb25bc67cf..aa37f4ae0aa0 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -46,7 +46,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class DefaultApi { /** * Utility class for extending HttpRequest.Builder functionality. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java index 48d498b42833..1bbb06e8b617 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -63,7 +63,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class FakeApi { /** * Utility class for extending HttpRequest.Builder functionality. @@ -405,7 +405,7 @@ private HttpRequest.Builder fakeHealthGetRequestBuilder(Map head * @return Boolean * @throws ApiException if fails to make API call */ - public Boolean fakeOuterBooleanSerialize(@javax.annotation.Nullable Boolean body) throws ApiException { + public Boolean fakeOuterBooleanSerialize(@jakarta.annotation.Nullable Boolean body) throws ApiException { return fakeOuterBooleanSerialize(body, null); } @@ -417,7 +417,7 @@ public Boolean fakeOuterBooleanSerialize(@javax.annotation.Nullable Boolean body * @return Boolean * @throws ApiException if fails to make API call */ - public Boolean fakeOuterBooleanSerialize(@javax.annotation.Nullable Boolean body, Map headers) throws ApiException { + public Boolean fakeOuterBooleanSerialize(@jakarta.annotation.Nullable Boolean body, Map headers) throws ApiException { ApiResponse localVarResponse = fakeOuterBooleanSerializeWithHttpInfo(body, headers); return localVarResponse.getData(); } @@ -429,7 +429,7 @@ public Boolean fakeOuterBooleanSerialize(@javax.annotation.Nullable Boolean body * @return ApiResponse<Boolean> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@javax.annotation.Nullable Boolean body) throws ApiException { + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@jakarta.annotation.Nullable Boolean body) throws ApiException { return fakeOuterBooleanSerializeWithHttpInfo(body, null); } @@ -441,7 +441,7 @@ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@javax.annotat * @return ApiResponse<Boolean> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@javax.annotation.Nullable Boolean body, Map headers) throws ApiException { + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@jakarta.annotation.Nullable Boolean body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -489,7 +489,7 @@ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@javax.annotat } } - private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(@javax.annotation.Nullable Boolean body, Map headers) throws ApiException { + private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(@jakarta.annotation.Nullable Boolean body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -524,7 +524,7 @@ private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(@javax.annot * @return OuterComposite * @throws ApiException if fails to make API call */ - public OuterComposite fakeOuterCompositeSerialize(@javax.annotation.Nullable OuterComposite outerComposite) throws ApiException { + public OuterComposite fakeOuterCompositeSerialize(@jakarta.annotation.Nullable OuterComposite outerComposite) throws ApiException { return fakeOuterCompositeSerialize(outerComposite, null); } @@ -536,7 +536,7 @@ public OuterComposite fakeOuterCompositeSerialize(@javax.annotation.Nullable Out * @return OuterComposite * @throws ApiException if fails to make API call */ - public OuterComposite fakeOuterCompositeSerialize(@javax.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { + public OuterComposite fakeOuterCompositeSerialize(@jakarta.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { ApiResponse localVarResponse = fakeOuterCompositeSerializeWithHttpInfo(outerComposite, headers); return localVarResponse.getData(); } @@ -548,7 +548,7 @@ public OuterComposite fakeOuterCompositeSerialize(@javax.annotation.Nullable Out * @return ApiResponse<OuterComposite> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@javax.annotation.Nullable OuterComposite outerComposite) throws ApiException { + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@jakarta.annotation.Nullable OuterComposite outerComposite) throws ApiException { return fakeOuterCompositeSerializeWithHttpInfo(outerComposite, null); } @@ -560,7 +560,7 @@ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@java * @return ApiResponse<OuterComposite> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@javax.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@jakarta.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = fakeOuterCompositeSerializeRequestBuilder(outerComposite, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -608,7 +608,7 @@ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@java } } - private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(@javax.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { + private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(@jakarta.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -643,7 +643,7 @@ private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(@javax.ann * @return BigDecimal * @throws ApiException if fails to make API call */ - public BigDecimal fakeOuterNumberSerialize(@javax.annotation.Nullable BigDecimal body) throws ApiException { + public BigDecimal fakeOuterNumberSerialize(@jakarta.annotation.Nullable BigDecimal body) throws ApiException { return fakeOuterNumberSerialize(body, null); } @@ -655,7 +655,7 @@ public BigDecimal fakeOuterNumberSerialize(@javax.annotation.Nullable BigDecimal * @return BigDecimal * @throws ApiException if fails to make API call */ - public BigDecimal fakeOuterNumberSerialize(@javax.annotation.Nullable BigDecimal body, Map headers) throws ApiException { + public BigDecimal fakeOuterNumberSerialize(@jakarta.annotation.Nullable BigDecimal body, Map headers) throws ApiException { ApiResponse localVarResponse = fakeOuterNumberSerializeWithHttpInfo(body, headers); return localVarResponse.getData(); } @@ -667,7 +667,7 @@ public BigDecimal fakeOuterNumberSerialize(@javax.annotation.Nullable BigDecimal * @return ApiResponse<BigDecimal> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@javax.annotation.Nullable BigDecimal body) throws ApiException { + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@jakarta.annotation.Nullable BigDecimal body) throws ApiException { return fakeOuterNumberSerializeWithHttpInfo(body, null); } @@ -679,7 +679,7 @@ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@javax.annot * @return ApiResponse<BigDecimal> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@javax.annotation.Nullable BigDecimal body, Map headers) throws ApiException { + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@jakarta.annotation.Nullable BigDecimal body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -727,7 +727,7 @@ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@javax.annot } } - private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(@javax.annotation.Nullable BigDecimal body, Map headers) throws ApiException { + private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(@jakarta.annotation.Nullable BigDecimal body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -762,7 +762,7 @@ private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(@javax.annota * @return String * @throws ApiException if fails to make API call */ - public String fakeOuterStringSerialize(@javax.annotation.Nullable String body) throws ApiException { + public String fakeOuterStringSerialize(@jakarta.annotation.Nullable String body) throws ApiException { return fakeOuterStringSerialize(body, null); } @@ -774,7 +774,7 @@ public String fakeOuterStringSerialize(@javax.annotation.Nullable String body) t * @return String * @throws ApiException if fails to make API call */ - public String fakeOuterStringSerialize(@javax.annotation.Nullable String body, Map headers) throws ApiException { + public String fakeOuterStringSerialize(@jakarta.annotation.Nullable String body, Map headers) throws ApiException { ApiResponse localVarResponse = fakeOuterStringSerializeWithHttpInfo(body, headers); return localVarResponse.getData(); } @@ -786,7 +786,7 @@ public String fakeOuterStringSerialize(@javax.annotation.Nullable String body, M * @return ApiResponse<String> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterStringSerializeWithHttpInfo(@javax.annotation.Nullable String body) throws ApiException { + public ApiResponse fakeOuterStringSerializeWithHttpInfo(@jakarta.annotation.Nullable String body) throws ApiException { return fakeOuterStringSerializeWithHttpInfo(body, null); } @@ -798,7 +798,7 @@ public ApiResponse fakeOuterStringSerializeWithHttpInfo(@javax.annotatio * @return ApiResponse<String> * @throws ApiException if fails to make API call */ - public ApiResponse fakeOuterStringSerializeWithHttpInfo(@javax.annotation.Nullable String body, Map headers) throws ApiException { + public ApiResponse fakeOuterStringSerializeWithHttpInfo(@jakarta.annotation.Nullable String body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = fakeOuterStringSerializeRequestBuilder(body, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -846,7 +846,7 @@ public ApiResponse fakeOuterStringSerializeWithHttpInfo(@javax.annotatio } } - private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(@javax.annotation.Nullable String body, Map headers) throws ApiException { + private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(@jakarta.annotation.Nullable String body, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1093,7 +1093,7 @@ private HttpRequest.Builder getArrayOfEnumsRequestBuilder(Map he * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testAdditionalPropertiesReference(@javax.annotation.Nonnull Map requestBody) throws ApiException { + public void testAdditionalPropertiesReference(@jakarta.annotation.Nonnull Map requestBody) throws ApiException { testAdditionalPropertiesReference(requestBody, null); } @@ -1104,7 +1104,7 @@ public void testAdditionalPropertiesReference(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + public void testAdditionalPropertiesReference(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { testAdditionalPropertiesReferenceWithHttpInfo(requestBody, headers); } @@ -1115,7 +1115,7 @@ public void testAdditionalPropertiesReference(@javax.annotation.Nonnull Map testAdditionalPropertiesReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody) throws ApiException { + public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@jakarta.annotation.Nonnull Map requestBody) throws ApiException { return testAdditionalPropertiesReferenceWithHttpInfo(requestBody, null); } @@ -1127,7 +1127,7 @@ public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@javax.an * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testAdditionalPropertiesReferenceRequestBuilder(requestBody, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1164,7 +1164,7 @@ public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@javax.an } } - private HttpRequest.Builder testAdditionalPropertiesReferenceRequestBuilder(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + private HttpRequest.Builder testAdditionalPropertiesReferenceRequestBuilder(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testAdditionalPropertiesReference"); @@ -1202,7 +1202,7 @@ private HttpRequest.Builder testAdditionalPropertiesReferenceRequestBuilder(@jav * @param fileSchemaTestClass (required) * @throws ApiException if fails to make API call */ - public void testBodyWithFileSchema(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass) throws ApiException { + public void testBodyWithFileSchema(@jakarta.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass) throws ApiException { testBodyWithFileSchema(fileSchemaTestClass, null); } @@ -1213,7 +1213,7 @@ public void testBodyWithFileSchema(@javax.annotation.Nonnull FileSchemaTestClass * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testBodyWithFileSchema(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { + public void testBodyWithFileSchema(@jakarta.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, headers); } @@ -1224,7 +1224,7 @@ public void testBodyWithFileSchema(@javax.annotation.Nonnull FileSchemaTestClass * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass) throws ApiException { + public ApiResponse testBodyWithFileSchemaWithHttpInfo(@jakarta.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass) throws ApiException { return testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, null); } @@ -1236,7 +1236,7 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(@javax.annotation.No * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { + public ApiResponse testBodyWithFileSchemaWithHttpInfo(@jakarta.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testBodyWithFileSchemaRequestBuilder(fileSchemaTestClass, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1273,7 +1273,7 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(@javax.annotation.No } } - private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { + private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(@jakarta.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) { throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); @@ -1312,7 +1312,7 @@ private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(@javax.annotati * @param user (required) * @throws ApiException if fails to make API call */ - public void testBodyWithQueryParams(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user) throws ApiException { + public void testBodyWithQueryParams(@jakarta.annotation.Nonnull String query, @jakarta.annotation.Nonnull User user) throws ApiException { testBodyWithQueryParams(query, user, null); } @@ -1324,7 +1324,7 @@ public void testBodyWithQueryParams(@javax.annotation.Nonnull String query, @jav * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testBodyWithQueryParams(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + public void testBodyWithQueryParams(@jakarta.annotation.Nonnull String query, @jakarta.annotation.Nonnull User user, Map headers) throws ApiException { testBodyWithQueryParamsWithHttpInfo(query, user, headers); } @@ -1336,7 +1336,7 @@ public void testBodyWithQueryParams(@javax.annotation.Nonnull String query, @jav * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user) throws ApiException { + public ApiResponse testBodyWithQueryParamsWithHttpInfo(@jakarta.annotation.Nonnull String query, @jakarta.annotation.Nonnull User user) throws ApiException { return testBodyWithQueryParamsWithHttpInfo(query, user, null); } @@ -1349,7 +1349,7 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(@javax.annotation.N * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + public ApiResponse testBodyWithQueryParamsWithHttpInfo(@jakarta.annotation.Nonnull String query, @jakarta.annotation.Nonnull User user, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testBodyWithQueryParamsRequestBuilder(query, user, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1386,7 +1386,7 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(@javax.annotation.N } } - private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(@jakarta.annotation.Nonnull String query, @jakarta.annotation.Nonnull User user, Map headers) throws ApiException { // verify the required parameter 'query' is set if (query == null) { throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); @@ -1444,7 +1444,7 @@ private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(@javax.annotat * @return Client * @throws ApiException if fails to make API call */ - public Client testClientModel(@javax.annotation.Nonnull Client client) throws ApiException { + public Client testClientModel(@jakarta.annotation.Nonnull Client client) throws ApiException { return testClientModel(client, null); } @@ -1456,7 +1456,7 @@ public Client testClientModel(@javax.annotation.Nonnull Client client) throws Ap * @return Client * @throws ApiException if fails to make API call */ - public Client testClientModel(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + public Client testClientModel(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { ApiResponse localVarResponse = testClientModelWithHttpInfo(client, headers); return localVarResponse.getData(); } @@ -1468,7 +1468,7 @@ public Client testClientModel(@javax.annotation.Nonnull Client client, Map testClientModelWithHttpInfo(@javax.annotation.Nonnull Client client) throws ApiException { + public ApiResponse testClientModelWithHttpInfo(@jakarta.annotation.Nonnull Client client) throws ApiException { return testClientModelWithHttpInfo(client, null); } @@ -1480,7 +1480,7 @@ public ApiResponse testClientModelWithHttpInfo(@javax.annotation.Nonnull * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testClientModelWithHttpInfo(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + public ApiResponse testClientModelWithHttpInfo(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testClientModelRequestBuilder(client, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1528,7 +1528,7 @@ public ApiResponse testClientModelWithHttpInfo(@javax.annotation.Nonnull } } - private HttpRequest.Builder testClientModelRequestBuilder(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + private HttpRequest.Builder testClientModelRequestBuilder(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { // verify the required parameter 'client' is set if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); @@ -1579,7 +1579,7 @@ private HttpRequest.Builder testClientModelRequestBuilder(@javax.annotation.Nonn * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public void testEndpointParameters(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback) throws ApiException { + public void testEndpointParameters(@jakarta.annotation.Nonnull BigDecimal number, @jakarta.annotation.Nonnull Double _double, @jakarta.annotation.Nonnull String patternWithoutDelimiter, @jakarta.annotation.Nonnull byte[] _byte, @jakarta.annotation.Nullable Integer integer, @jakarta.annotation.Nullable Integer int32, @jakarta.annotation.Nullable Long int64, @jakarta.annotation.Nullable Float _float, @jakarta.annotation.Nullable String string, @jakarta.annotation.Nullable File binary, @jakarta.annotation.Nullable LocalDate date, @jakarta.annotation.Nullable OffsetDateTime dateTime, @jakarta.annotation.Nullable String password, @jakarta.annotation.Nullable String paramCallback) throws ApiException { testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null); } @@ -1603,7 +1603,7 @@ public void testEndpointParameters(@javax.annotation.Nonnull BigDecimal number, * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testEndpointParameters(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Map headers) throws ApiException { + public void testEndpointParameters(@jakarta.annotation.Nonnull BigDecimal number, @jakarta.annotation.Nonnull Double _double, @jakarta.annotation.Nonnull String patternWithoutDelimiter, @jakarta.annotation.Nonnull byte[] _byte, @jakarta.annotation.Nullable Integer integer, @jakarta.annotation.Nullable Integer int32, @jakarta.annotation.Nullable Long int64, @jakarta.annotation.Nullable Float _float, @jakarta.annotation.Nullable String string, @jakarta.annotation.Nullable File binary, @jakarta.annotation.Nullable LocalDate date, @jakarta.annotation.Nullable OffsetDateTime dateTime, @jakarta.annotation.Nullable String password, @jakarta.annotation.Nullable String paramCallback, Map headers) throws ApiException { testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, headers); } @@ -1627,7 +1627,7 @@ public void testEndpointParameters(@javax.annotation.Nonnull BigDecimal number, * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testEndpointParametersWithHttpInfo(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo(@jakarta.annotation.Nonnull BigDecimal number, @jakarta.annotation.Nonnull Double _double, @jakarta.annotation.Nonnull String patternWithoutDelimiter, @jakarta.annotation.Nonnull byte[] _byte, @jakarta.annotation.Nullable Integer integer, @jakarta.annotation.Nullable Integer int32, @jakarta.annotation.Nullable Long int64, @jakarta.annotation.Nullable Float _float, @jakarta.annotation.Nullable String string, @jakarta.annotation.Nullable File binary, @jakarta.annotation.Nullable LocalDate date, @jakarta.annotation.Nullable OffsetDateTime dateTime, @jakarta.annotation.Nullable String password, @jakarta.annotation.Nullable String paramCallback) throws ApiException { return testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null); } @@ -1652,7 +1652,7 @@ public ApiResponse testEndpointParametersWithHttpInfo(@javax.annotation.No * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testEndpointParametersWithHttpInfo(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Map headers) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo(@jakarta.annotation.Nonnull BigDecimal number, @jakarta.annotation.Nonnull Double _double, @jakarta.annotation.Nonnull String patternWithoutDelimiter, @jakarta.annotation.Nonnull byte[] _byte, @jakarta.annotation.Nullable Integer integer, @jakarta.annotation.Nullable Integer int32, @jakarta.annotation.Nullable Long int64, @jakarta.annotation.Nullable Float _float, @jakarta.annotation.Nullable String string, @jakarta.annotation.Nullable File binary, @jakarta.annotation.Nullable LocalDate date, @jakarta.annotation.Nullable OffsetDateTime dateTime, @jakarta.annotation.Nullable String password, @jakarta.annotation.Nullable String paramCallback, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testEndpointParametersRequestBuilder(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1689,7 +1689,7 @@ public ApiResponse testEndpointParametersWithHttpInfo(@javax.annotation.No } } - private HttpRequest.Builder testEndpointParametersRequestBuilder(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Map headers) throws ApiException { + private HttpRequest.Builder testEndpointParametersRequestBuilder(@jakarta.annotation.Nonnull BigDecimal number, @jakarta.annotation.Nonnull Double _double, @jakarta.annotation.Nonnull String patternWithoutDelimiter, @jakarta.annotation.Nonnull byte[] _byte, @jakarta.annotation.Nullable Integer integer, @jakarta.annotation.Nullable Integer int32, @jakarta.annotation.Nullable Long int64, @jakarta.annotation.Nullable Float _float, @jakarta.annotation.Nullable String string, @jakarta.annotation.Nullable File binary, @jakarta.annotation.Nullable LocalDate date, @jakarta.annotation.Nullable OffsetDateTime dateTime, @jakarta.annotation.Nullable String password, @jakarta.annotation.Nullable String paramCallback, Map headers) throws ApiException { // verify the required parameter 'number' is set if (number == null) { throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); @@ -1794,7 +1794,7 @@ private HttpRequest.Builder testEndpointParametersRequestBuilder(@javax.annotati * @param enumFormString Form parameter enum test (string) (optional, default to -efg) * @throws ApiException if fails to make API call */ - public void testEnumParameters(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString) throws ApiException { + public void testEnumParameters(@jakarta.annotation.Nullable List enumHeaderStringArray, @jakarta.annotation.Nullable String enumHeaderString, @jakarta.annotation.Nullable List enumQueryStringArray, @jakarta.annotation.Nullable String enumQueryString, @jakarta.annotation.Nullable Integer enumQueryInteger, @jakarta.annotation.Nullable Double enumQueryDouble, @jakarta.annotation.Nullable List enumFormStringArray, @jakarta.annotation.Nullable String enumFormString) throws ApiException { testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null); } @@ -1812,7 +1812,7 @@ public void testEnumParameters(@javax.annotation.Nullable List enumHeade * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testEnumParameters(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString, Map headers) throws ApiException { + public void testEnumParameters(@jakarta.annotation.Nullable List enumHeaderStringArray, @jakarta.annotation.Nullable String enumHeaderString, @jakarta.annotation.Nullable List enumQueryStringArray, @jakarta.annotation.Nullable String enumQueryString, @jakarta.annotation.Nullable Integer enumQueryInteger, @jakarta.annotation.Nullable Double enumQueryDouble, @jakarta.annotation.Nullable List enumFormStringArray, @jakarta.annotation.Nullable String enumFormString, Map headers) throws ApiException { testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, headers); } @@ -1830,7 +1830,7 @@ public void testEnumParameters(@javax.annotation.Nullable List enumHeade * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testEnumParametersWithHttpInfo(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString) throws ApiException { + public ApiResponse testEnumParametersWithHttpInfo(@jakarta.annotation.Nullable List enumHeaderStringArray, @jakarta.annotation.Nullable String enumHeaderString, @jakarta.annotation.Nullable List enumQueryStringArray, @jakarta.annotation.Nullable String enumQueryString, @jakarta.annotation.Nullable Integer enumQueryInteger, @jakarta.annotation.Nullable Double enumQueryDouble, @jakarta.annotation.Nullable List enumFormStringArray, @jakarta.annotation.Nullable String enumFormString) throws ApiException { return testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null); } @@ -1849,7 +1849,7 @@ public ApiResponse testEnumParametersWithHttpInfo(@javax.annotation.Nullab * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testEnumParametersWithHttpInfo(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString, Map headers) throws ApiException { + public ApiResponse testEnumParametersWithHttpInfo(@jakarta.annotation.Nullable List enumHeaderStringArray, @jakarta.annotation.Nullable String enumHeaderString, @jakarta.annotation.Nullable List enumQueryStringArray, @jakarta.annotation.Nullable String enumQueryString, @jakarta.annotation.Nullable Integer enumQueryInteger, @jakarta.annotation.Nullable Double enumQueryDouble, @jakarta.annotation.Nullable List enumFormStringArray, @jakarta.annotation.Nullable String enumFormString, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testEnumParametersRequestBuilder(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1886,7 +1886,7 @@ public ApiResponse testEnumParametersWithHttpInfo(@javax.annotation.Nullab } } - private HttpRequest.Builder testEnumParametersRequestBuilder(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString, Map headers) throws ApiException { + private HttpRequest.Builder testEnumParametersRequestBuilder(@jakarta.annotation.Nullable List enumHeaderStringArray, @jakarta.annotation.Nullable String enumHeaderString, @jakarta.annotation.Nullable List enumQueryStringArray, @jakarta.annotation.Nullable String enumQueryString, @jakarta.annotation.Nullable Integer enumQueryInteger, @jakarta.annotation.Nullable Double enumQueryDouble, @jakarta.annotation.Nullable List enumFormStringArray, @jakarta.annotation.Nullable String enumFormString, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -1973,17 +1973,17 @@ public void testGroupParameters(APITestGroupParametersRequest apiRequest) throws * @throws ApiException if fails to make API call */ public void testGroupParameters(APITestGroupParametersRequest apiRequest, Map headers) throws ApiException { - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull Integer requiredStringGroup = apiRequest.requiredStringGroup(); - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull Long requiredInt64Group = apiRequest.requiredInt64Group(); - @javax.annotation.Nullable + @jakarta.annotation.Nullable Integer stringGroup = apiRequest.stringGroup(); - @javax.annotation.Nullable + @jakarta.annotation.Nullable Boolean booleanGroup = apiRequest.booleanGroup(); - @javax.annotation.Nullable + @jakarta.annotation.Nullable Long int64Group = apiRequest.int64Group(); testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); } @@ -2028,7 +2028,7 @@ public ApiResponse testGroupParametersWithHttpInfo(APITestGroupParametersR * @param int64Group Integer in group parameters (optional) * @throws ApiException if fails to make API call */ - public void testGroupParameters(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group) throws ApiException { + public void testGroupParameters(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group) throws ApiException { testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null); } @@ -2044,7 +2044,7 @@ public void testGroupParameters(@javax.annotation.Nonnull Integer requiredString * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testGroupParameters(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group, Map headers) throws ApiException { + public void testGroupParameters(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group, Map headers) throws ApiException { testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); } @@ -2060,7 +2060,7 @@ public void testGroupParameters(@javax.annotation.Nonnull Integer requiredString * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testGroupParametersWithHttpInfo(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group) throws ApiException { + public ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group) throws ApiException { return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null); } @@ -2077,7 +2077,7 @@ public ApiResponse testGroupParametersWithHttpInfo(@javax.annotation.Nonnu * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testGroupParametersWithHttpInfo(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group, Map headers) throws ApiException { + public ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testGroupParametersRequestBuilder(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -2114,7 +2114,7 @@ public ApiResponse testGroupParametersWithHttpInfo(@javax.annotation.Nonnu } } - private HttpRequest.Builder testGroupParametersRequestBuilder(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group, Map headers) throws ApiException { + private HttpRequest.Builder testGroupParametersRequestBuilder(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group, Map headers) throws ApiException { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); @@ -2177,17 +2177,17 @@ private HttpRequest.Builder testGroupParametersRequestBuilder(@javax.annotation. public static final class APITestGroupParametersRequest { - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private Integer requiredStringGroup; // Required String in group parameters (required) - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private Boolean requiredBooleanGroup; // Required Boolean in group parameters (required) - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private Long requiredInt64Group; // Required Integer in group parameters (required) - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer stringGroup; // String in group parameters (optional) - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean booleanGroup; // Boolean in group parameters (optional) - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long int64Group; // Integer in group parameters (optional) private APITestGroupParametersRequest(Builder builder) { @@ -2198,27 +2198,27 @@ private APITestGroupParametersRequest(Builder builder) { this.booleanGroup = builder.booleanGroup; this.int64Group = builder.int64Group; } - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull public Integer requiredStringGroup() { return requiredStringGroup; } - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull public Boolean requiredBooleanGroup() { return requiredBooleanGroup; } - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull public Long requiredInt64Group() { return requiredInt64Group; } - @javax.annotation.Nullable + @jakarta.annotation.Nullable public Integer stringGroup() { return stringGroup; } - @javax.annotation.Nullable + @jakarta.annotation.Nullable public Boolean booleanGroup() { return booleanGroup; } - @javax.annotation.Nullable + @jakarta.annotation.Nullable public Long int64Group() { return int64Group; } @@ -2234,27 +2234,27 @@ public static class Builder { private Boolean booleanGroup; private Long int64Group; - public Builder requiredStringGroup(@javax.annotation.Nonnull Integer requiredStringGroup) { + public Builder requiredStringGroup(@jakarta.annotation.Nonnull Integer requiredStringGroup) { this.requiredStringGroup = requiredStringGroup; return this; } - public Builder requiredBooleanGroup(@javax.annotation.Nonnull Boolean requiredBooleanGroup) { + public Builder requiredBooleanGroup(@jakarta.annotation.Nonnull Boolean requiredBooleanGroup) { this.requiredBooleanGroup = requiredBooleanGroup; return this; } - public Builder requiredInt64Group(@javax.annotation.Nonnull Long requiredInt64Group) { + public Builder requiredInt64Group(@jakarta.annotation.Nonnull Long requiredInt64Group) { this.requiredInt64Group = requiredInt64Group; return this; } - public Builder stringGroup(@javax.annotation.Nullable Integer stringGroup) { + public Builder stringGroup(@jakarta.annotation.Nullable Integer stringGroup) { this.stringGroup = stringGroup; return this; } - public Builder booleanGroup(@javax.annotation.Nullable Boolean booleanGroup) { + public Builder booleanGroup(@jakarta.annotation.Nullable Boolean booleanGroup) { this.booleanGroup = booleanGroup; return this; } - public Builder int64Group(@javax.annotation.Nullable Long int64Group) { + public Builder int64Group(@jakarta.annotation.Nullable Long int64Group) { this.int64Group = int64Group; return this; } @@ -2270,7 +2270,7 @@ public APITestGroupParametersRequest build() { * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testInlineAdditionalProperties(@javax.annotation.Nonnull Map requestBody) throws ApiException { + public void testInlineAdditionalProperties(@jakarta.annotation.Nonnull Map requestBody) throws ApiException { testInlineAdditionalProperties(requestBody, null); } @@ -2281,7 +2281,7 @@ public void testInlineAdditionalProperties(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + public void testInlineAdditionalProperties(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { testInlineAdditionalPropertiesWithHttpInfo(requestBody, headers); } @@ -2292,7 +2292,7 @@ public void testInlineAdditionalProperties(@javax.annotation.Nonnull Map testInlineAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull Map requestBody) throws ApiException { + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@jakarta.annotation.Nonnull Map requestBody) throws ApiException { return testInlineAdditionalPropertiesWithHttpInfo(requestBody, null); } @@ -2304,7 +2304,7 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@javax.annot * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testInlineAdditionalPropertiesRequestBuilder(requestBody, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -2341,7 +2341,7 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@javax.annot } } - private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); @@ -2379,7 +2379,7 @@ private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(@javax. * @param testInlineFreeformAdditionalPropertiesRequest request body (required) * @throws ApiException if fails to make API call */ - public void testInlineFreeformAdditionalProperties(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + public void testInlineFreeformAdditionalProperties(@jakarta.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, null); } @@ -2390,7 +2390,7 @@ public void testInlineFreeformAdditionalProperties(@javax.annotation.Nonnull Tes * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testInlineFreeformAdditionalProperties(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { + public void testInlineFreeformAdditionalProperties(@jakarta.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest, headers); } @@ -2401,7 +2401,7 @@ public void testInlineFreeformAdditionalProperties(@javax.annotation.Nonnull Tes * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jakarta.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { return testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest, null); } @@ -2413,7 +2413,7 @@ public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jav * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jakarta.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -2450,7 +2450,7 @@ public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jav } } - private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { + private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder(@jakarta.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set if (testInlineFreeformAdditionalPropertiesRequest == null) { throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); @@ -2489,7 +2489,7 @@ private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder * @param param2 field2 (required) * @throws ApiException if fails to make API call */ - public void testJsonFormData(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2) throws ApiException { + public void testJsonFormData(@jakarta.annotation.Nonnull String param, @jakarta.annotation.Nonnull String param2) throws ApiException { testJsonFormData(param, param2, null); } @@ -2501,7 +2501,7 @@ public void testJsonFormData(@javax.annotation.Nonnull String param, @javax.anno * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testJsonFormData(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2, Map headers) throws ApiException { + public void testJsonFormData(@jakarta.annotation.Nonnull String param, @jakarta.annotation.Nonnull String param2, Map headers) throws ApiException { testJsonFormDataWithHttpInfo(param, param2, headers); } @@ -2513,7 +2513,7 @@ public void testJsonFormData(@javax.annotation.Nonnull String param, @javax.anno * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2) throws ApiException { + public ApiResponse testJsonFormDataWithHttpInfo(@jakarta.annotation.Nonnull String param, @jakarta.annotation.Nonnull String param2) throws ApiException { return testJsonFormDataWithHttpInfo(param, param2, null); } @@ -2526,7 +2526,7 @@ public ApiResponse testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2, Map headers) throws ApiException { + public ApiResponse testJsonFormDataWithHttpInfo(@jakarta.annotation.Nonnull String param, @jakarta.annotation.Nonnull String param2, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -2563,7 +2563,7 @@ public ApiResponse testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull } } - private HttpRequest.Builder testJsonFormDataRequestBuilder(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2, Map headers) throws ApiException { + private HttpRequest.Builder testJsonFormDataRequestBuilder(@jakarta.annotation.Nonnull String param, @jakarta.annotation.Nonnull String param2, Map headers) throws ApiException { // verify the required parameter 'param' is set if (param == null) { throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); @@ -2621,7 +2621,7 @@ private HttpRequest.Builder testJsonFormDataRequestBuilder(@javax.annotation.Non * @param context (required) * @throws ApiException if fails to make API call */ - public void testQueryParameterCollectionFormat(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context) throws ApiException { + public void testQueryParameterCollectionFormat(@jakarta.annotation.Nonnull List pipe, @jakarta.annotation.Nonnull List ioutil, @jakarta.annotation.Nonnull List http, @jakarta.annotation.Nonnull List url, @jakarta.annotation.Nonnull List context) throws ApiException { testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, null); } @@ -2636,7 +2636,7 @@ public void testQueryParameterCollectionFormat(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context, Map headers) throws ApiException { + public void testQueryParameterCollectionFormat(@jakarta.annotation.Nonnull List pipe, @jakarta.annotation.Nonnull List ioutil, @jakarta.annotation.Nonnull List http, @jakarta.annotation.Nonnull List url, @jakarta.annotation.Nonnull List context, Map headers) throws ApiException { testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, headers); } @@ -2651,7 +2651,7 @@ public void testQueryParameterCollectionFormat(@javax.annotation.Nonnull List testQueryParameterCollectionFormatWithHttpInfo(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context) throws ApiException { + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@jakarta.annotation.Nonnull List pipe, @jakarta.annotation.Nonnull List ioutil, @jakarta.annotation.Nonnull List http, @jakarta.annotation.Nonnull List url, @jakarta.annotation.Nonnull List context) throws ApiException { return testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, null); } @@ -2667,7 +2667,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@javax.a * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context, Map headers) throws ApiException { + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@jakarta.annotation.Nonnull List pipe, @jakarta.annotation.Nonnull List ioutil, @jakarta.annotation.Nonnull List http, @jakarta.annotation.Nonnull List url, @jakarta.annotation.Nonnull List context, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -2704,7 +2704,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@javax.a } } - private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context, Map headers) throws ApiException { + private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(@jakarta.annotation.Nonnull List pipe, @jakarta.annotation.Nonnull List ioutil, @jakarta.annotation.Nonnull List http, @jakarta.annotation.Nonnull List url, @jakarta.annotation.Nonnull List context, Map headers) throws ApiException { // verify the required parameter 'pipe' is set if (pipe == null) { throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); @@ -2775,7 +2775,7 @@ private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(@ja * @param requestBody request body (required) * @throws ApiException if fails to make API call */ - public void testStringMapReference(@javax.annotation.Nonnull Map requestBody) throws ApiException { + public void testStringMapReference(@jakarta.annotation.Nonnull Map requestBody) throws ApiException { testStringMapReference(requestBody, null); } @@ -2786,7 +2786,7 @@ public void testStringMapReference(@javax.annotation.Nonnull Map * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void testStringMapReference(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + public void testStringMapReference(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { testStringMapReferenceWithHttpInfo(requestBody, headers); } @@ -2797,7 +2797,7 @@ public void testStringMapReference(@javax.annotation.Nonnull Map * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testStringMapReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody) throws ApiException { + public ApiResponse testStringMapReferenceWithHttpInfo(@jakarta.annotation.Nonnull Map requestBody) throws ApiException { return testStringMapReferenceWithHttpInfo(requestBody, null); } @@ -2809,7 +2809,7 @@ public ApiResponse testStringMapReferenceWithHttpInfo(@javax.annotation.No * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse testStringMapReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + public ApiResponse testStringMapReferenceWithHttpInfo(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testStringMapReferenceRequestBuilder(requestBody, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -2846,7 +2846,7 @@ public ApiResponse testStringMapReferenceWithHttpInfo(@javax.annotation.No } } - private HttpRequest.Builder testStringMapReferenceRequestBuilder(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + private HttpRequest.Builder testStringMapReferenceRequestBuilder(@jakarta.annotation.Nonnull Map requestBody, Map headers) throws ApiException { // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 586db87c8197..d8c1fb2b77a2 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -52,7 +52,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class FakeClassnameTags123Api { /** * Utility class for extending HttpRequest.Builder functionality. @@ -176,7 +176,7 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * @return Client * @throws ApiException if fails to make API call */ - public Client testClassname(@javax.annotation.Nonnull Client client) throws ApiException { + public Client testClassname(@jakarta.annotation.Nonnull Client client) throws ApiException { return testClassname(client, null); } @@ -188,7 +188,7 @@ public Client testClassname(@javax.annotation.Nonnull Client client) throws ApiE * @return Client * @throws ApiException if fails to make API call */ - public Client testClassname(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + public Client testClassname(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { ApiResponse localVarResponse = testClassnameWithHttpInfo(client, headers); return localVarResponse.getData(); } @@ -200,7 +200,7 @@ public Client testClassname(@javax.annotation.Nonnull Client client, Map testClassnameWithHttpInfo(@javax.annotation.Nonnull Client client) throws ApiException { + public ApiResponse testClassnameWithHttpInfo(@jakarta.annotation.Nonnull Client client) throws ApiException { return testClassnameWithHttpInfo(client, null); } @@ -212,7 +212,7 @@ public ApiResponse testClassnameWithHttpInfo(@javax.annotation.Nonnull C * @return ApiResponse<Client> * @throws ApiException if fails to make API call */ - public ApiResponse testClassnameWithHttpInfo(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + public ApiResponse testClassnameWithHttpInfo(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(client, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -260,7 +260,7 @@ public ApiResponse testClassnameWithHttpInfo(@javax.annotation.Nonnull C } } - private HttpRequest.Builder testClassnameRequestBuilder(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + private HttpRequest.Builder testClassnameRequestBuilder(@jakarta.annotation.Nonnull Client client, Map headers) throws ApiException { // verify the required parameter 'client' is set if (client == null) { throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java index 051038270ac9..cfbdde57143e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java @@ -54,7 +54,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class PetApi { /** * Utility class for extending HttpRequest.Builder functionality. @@ -177,7 +177,7 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void addPet(@javax.annotation.Nonnull Pet pet) throws ApiException { + public void addPet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { addPet(pet, null); } @@ -188,7 +188,7 @@ public void addPet(@javax.annotation.Nonnull Pet pet) throws ApiException { * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void addPet(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + public void addPet(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException { addPetWithHttpInfo(pet, headers); } @@ -199,7 +199,7 @@ public void addPet(@javax.annotation.Nonnull Pet pet, Map header * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet) throws ApiException { + public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { return addPetWithHttpInfo(pet, null); } @@ -211,7 +211,7 @@ public ApiResponse addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet) t * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(pet, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -248,7 +248,7 @@ public ApiResponse addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet, M } } - private HttpRequest.Builder addPetRequestBuilder(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + private HttpRequest.Builder addPetRequestBuilder(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException { // verify the required parameter 'pet' is set if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); @@ -287,7 +287,7 @@ private HttpRequest.Builder addPetRequestBuilder(@javax.annotation.Nonnull Pet p * @param apiKey (optional) * @throws ApiException if fails to make API call */ - public void deletePet(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey) throws ApiException { + public void deletePet(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String apiKey) throws ApiException { deletePet(petId, apiKey, null); } @@ -299,7 +299,7 @@ public void deletePet(@javax.annotation.Nonnull Long petId, @javax.annotation.Nu * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void deletePet(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey, Map headers) throws ApiException { + public void deletePet(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String apiKey, Map headers) throws ApiException { deletePetWithHttpInfo(petId, apiKey, headers); } @@ -311,7 +311,7 @@ public void deletePet(@javax.annotation.Nonnull Long petId, @javax.annotation.Nu * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse deletePetWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey) throws ApiException { + public ApiResponse deletePetWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String apiKey) throws ApiException { return deletePetWithHttpInfo(petId, apiKey, null); } @@ -324,7 +324,7 @@ public ApiResponse deletePetWithHttpInfo(@javax.annotation.Nonnull Long pe * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse deletePetWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey, Map headers) throws ApiException { + public ApiResponse deletePetWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String apiKey, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -361,7 +361,7 @@ public ApiResponse deletePetWithHttpInfo(@javax.annotation.Nonnull Long pe } } - private HttpRequest.Builder deletePetRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey, Map headers) throws ApiException { + private HttpRequest.Builder deletePetRequestBuilder(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String apiKey, Map headers) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); @@ -398,7 +398,7 @@ private HttpRequest.Builder deletePetRequestBuilder(@javax.annotation.Nonnull Lo * @return List<Pet> * @throws ApiException if fails to make API call */ - public List findPetsByStatus(@javax.annotation.Nonnull List status) throws ApiException { + public List findPetsByStatus(@jakarta.annotation.Nonnull List status) throws ApiException { return findPetsByStatus(status, null); } @@ -410,7 +410,7 @@ public List findPetsByStatus(@javax.annotation.Nonnull List status) * @return List<Pet> * @throws ApiException if fails to make API call */ - public List findPetsByStatus(@javax.annotation.Nonnull List status, Map headers) throws ApiException { + public List findPetsByStatus(@jakarta.annotation.Nonnull List status, Map headers) throws ApiException { ApiResponse> localVarResponse = findPetsByStatusWithHttpInfo(status, headers); return localVarResponse.getData(); } @@ -422,7 +422,7 @@ public List findPetsByStatus(@javax.annotation.Nonnull List status, * @return ApiResponse<List<Pet>> * @throws ApiException if fails to make API call */ - public ApiResponse> findPetsByStatusWithHttpInfo(@javax.annotation.Nonnull List status) throws ApiException { + public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.Nonnull List status) throws ApiException { return findPetsByStatusWithHttpInfo(status, null); } @@ -434,7 +434,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@javax.annotation.Non * @return ApiResponse<List<Pet>> * @throws ApiException if fails to make API call */ - public ApiResponse> findPetsByStatusWithHttpInfo(@javax.annotation.Nonnull List status, Map headers) throws ApiException { + public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.Nonnull List status, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -482,7 +482,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@javax.annotation.Non } } - private HttpRequest.Builder findPetsByStatusRequestBuilder(@javax.annotation.Nonnull List status, Map headers) throws ApiException { + private HttpRequest.Builder findPetsByStatusRequestBuilder(@jakarta.annotation.Nonnull List status, Map headers) throws ApiException { // verify the required parameter 'status' is set if (status == null) { throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); @@ -532,7 +532,7 @@ private HttpRequest.Builder findPetsByStatusRequestBuilder(@javax.annotation.Non * @deprecated */ @Deprecated - public List findPetsByTags(@javax.annotation.Nonnull List tags) throws ApiException { + public List findPetsByTags(@jakarta.annotation.Nonnull List tags) throws ApiException { return findPetsByTags(tags, null); } @@ -546,7 +546,7 @@ public List findPetsByTags(@javax.annotation.Nonnull List tags) thr * @deprecated */ @Deprecated - public List findPetsByTags(@javax.annotation.Nonnull List tags, Map headers) throws ApiException { + public List findPetsByTags(@jakarta.annotation.Nonnull List tags, Map headers) throws ApiException { ApiResponse> localVarResponse = findPetsByTagsWithHttpInfo(tags, headers); return localVarResponse.getData(); } @@ -560,7 +560,7 @@ public List findPetsByTags(@javax.annotation.Nonnull List tags, Map * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(@javax.annotation.Nonnull List tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Nonnull List tags) throws ApiException { return findPetsByTagsWithHttpInfo(tags, null); } @@ -574,7 +574,7 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@javax.annotation.Nonnu * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(@javax.annotation.Nonnull List tags, Map headers) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Nonnull List tags, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -622,7 +622,7 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@javax.annotation.Nonnu } } - private HttpRequest.Builder findPetsByTagsRequestBuilder(@javax.annotation.Nonnull List tags, Map headers) throws ApiException { + private HttpRequest.Builder findPetsByTagsRequestBuilder(@jakarta.annotation.Nonnull List tags, Map headers) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); @@ -670,7 +670,7 @@ private HttpRequest.Builder findPetsByTagsRequestBuilder(@javax.annotation.Nonnu * @return Pet * @throws ApiException if fails to make API call */ - public Pet getPetById(@javax.annotation.Nonnull Long petId) throws ApiException { + public Pet getPetById(@jakarta.annotation.Nonnull Long petId) throws ApiException { return getPetById(petId, null); } @@ -682,7 +682,7 @@ public Pet getPetById(@javax.annotation.Nonnull Long petId) throws ApiException * @return Pet * @throws ApiException if fails to make API call */ - public Pet getPetById(@javax.annotation.Nonnull Long petId, Map headers) throws ApiException { + public Pet getPetById(@jakarta.annotation.Nonnull Long petId, Map headers) throws ApiException { ApiResponse localVarResponse = getPetByIdWithHttpInfo(petId, headers); return localVarResponse.getData(); } @@ -694,7 +694,7 @@ public Pet getPetById(@javax.annotation.Nonnull Long petId, Map * @return ApiResponse<Pet> * @throws ApiException if fails to make API call */ - public ApiResponse getPetByIdWithHttpInfo(@javax.annotation.Nonnull Long petId) throws ApiException { + public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long petId) throws ApiException { return getPetByIdWithHttpInfo(petId, null); } @@ -706,7 +706,7 @@ public ApiResponse getPetByIdWithHttpInfo(@javax.annotation.Nonnull Long pe * @return ApiResponse<Pet> * @throws ApiException if fails to make API call */ - public ApiResponse getPetByIdWithHttpInfo(@javax.annotation.Nonnull Long petId, Map headers) throws ApiException { + public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long petId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -754,7 +754,7 @@ public ApiResponse getPetByIdWithHttpInfo(@javax.annotation.Nonnull Long pe } } - private HttpRequest.Builder getPetByIdRequestBuilder(@javax.annotation.Nonnull Long petId, Map headers) throws ApiException { + private HttpRequest.Builder getPetByIdRequestBuilder(@jakarta.annotation.Nonnull Long petId, Map headers) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); @@ -787,7 +787,7 @@ private HttpRequest.Builder getPetByIdRequestBuilder(@javax.annotation.Nonnull L * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call */ - public void updatePet(@javax.annotation.Nonnull Pet pet) throws ApiException { + public void updatePet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { updatePet(pet, null); } @@ -798,7 +798,7 @@ public void updatePet(@javax.annotation.Nonnull Pet pet) throws ApiException { * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void updatePet(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + public void updatePet(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException { updatePetWithHttpInfo(pet, headers); } @@ -809,7 +809,7 @@ public void updatePet(@javax.annotation.Nonnull Pet pet, Map hea * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet) throws ApiException { + public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { return updatePetWithHttpInfo(pet, null); } @@ -821,7 +821,7 @@ public ApiResponse updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(pet, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -858,7 +858,7 @@ public ApiResponse updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet } } - private HttpRequest.Builder updatePetRequestBuilder(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + private HttpRequest.Builder updatePetRequestBuilder(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException { // verify the required parameter 'pet' is set if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); @@ -898,7 +898,7 @@ private HttpRequest.Builder updatePetRequestBuilder(@javax.annotation.Nonnull Pe * @param status Updated status of the pet (optional) * @throws ApiException if fails to make API call */ - public void updatePetWithForm(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status) throws ApiException { + public void updatePetWithForm(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String status) throws ApiException { updatePetWithForm(petId, name, status, null); } @@ -911,7 +911,7 @@ public void updatePetWithForm(@javax.annotation.Nonnull Long petId, @javax.annot * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void updatePetWithForm(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status, Map headers) throws ApiException { + public void updatePetWithForm(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String status, Map headers) throws ApiException { updatePetWithFormWithHttpInfo(petId, name, status, headers); } @@ -924,7 +924,7 @@ public void updatePetWithForm(@javax.annotation.Nonnull Long petId, @javax.annot * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status) throws ApiException { + public ApiResponse updatePetWithFormWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String status) throws ApiException { return updatePetWithFormWithHttpInfo(petId, name, status, null); } @@ -938,7 +938,7 @@ public ApiResponse updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status, Map headers) throws ApiException { + public ApiResponse updatePetWithFormWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String status, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -975,7 +975,7 @@ public ApiResponse updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull } } - private HttpRequest.Builder updatePetWithFormRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status, Map headers) throws ApiException { + private HttpRequest.Builder updatePetWithFormRequestBuilder(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String name, @jakarta.annotation.Nullable String status, Map headers) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); @@ -1029,7 +1029,7 @@ private HttpRequest.Builder updatePetWithFormRequestBuilder(@javax.annotation.No * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file) throws ApiException { + public ModelApiResponse uploadFile(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String additionalMetadata, @jakarta.annotation.Nullable File _file) throws ApiException { return uploadFile(petId, additionalMetadata, _file, null); } @@ -1043,7 +1043,7 @@ public ModelApiResponse uploadFile(@javax.annotation.Nonnull Long petId, @javax. * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file, Map headers) throws ApiException { + public ModelApiResponse uploadFile(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String additionalMetadata, @jakarta.annotation.Nullable File _file, Map headers) throws ApiException { ApiResponse localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, _file, headers); return localVarResponse.getData(); } @@ -1057,7 +1057,7 @@ public ModelApiResponse uploadFile(@javax.annotation.Nonnull Long petId, @javax. * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file) throws ApiException { + public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String additionalMetadata, @jakarta.annotation.Nullable File _file) throws ApiException { return uploadFileWithHttpInfo(petId, additionalMetadata, _file, null); } @@ -1071,7 +1071,7 @@ public ApiResponse uploadFileWithHttpInfo(@javax.annotation.No * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file, Map headers) throws ApiException { + public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String additionalMetadata, @jakarta.annotation.Nullable File _file, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1119,7 +1119,7 @@ public ApiResponse uploadFileWithHttpInfo(@javax.annotation.No } } - private HttpRequest.Builder uploadFileRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file, Map headers) throws ApiException { + private HttpRequest.Builder uploadFileRequestBuilder(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nullable String additionalMetadata, @jakarta.annotation.Nullable File _file, Map headers) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); @@ -1192,7 +1192,7 @@ private HttpRequest.Builder uploadFileRequestBuilder(@javax.annotation.Nonnull L * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata) throws ApiException { + public ModelApiResponse uploadFileWithRequiredFile(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata) throws ApiException { return uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, null); } @@ -1206,7 +1206,7 @@ public ModelApiResponse uploadFileWithRequiredFile(@javax.annotation.Nonnull Lon * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFileWithRequiredFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { + public ModelApiResponse uploadFileWithRequiredFile(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { ApiResponse localVarResponse = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, headers); return localVarResponse.getData(); } @@ -1220,7 +1220,7 @@ public ModelApiResponse uploadFileWithRequiredFile(@javax.annotation.Nonnull Lon * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata) throws ApiException { + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata) throws ApiException { return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, null); } @@ -1234,7 +1234,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jav * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1282,7 +1282,7 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jav } } - private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { + private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java index f786157fb7db..b259f71fe5af 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -52,7 +52,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class StoreApi { /** * Utility class for extending HttpRequest.Builder functionality. @@ -175,7 +175,7 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * @param orderId ID of the order that needs to be deleted (required) * @throws ApiException if fails to make API call */ - public void deleteOrder(@javax.annotation.Nonnull String orderId) throws ApiException { + public void deleteOrder(@jakarta.annotation.Nonnull String orderId) throws ApiException { deleteOrder(orderId, null); } @@ -186,7 +186,7 @@ public void deleteOrder(@javax.annotation.Nonnull String orderId) throws ApiExce * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void deleteOrder(@javax.annotation.Nonnull String orderId, Map headers) throws ApiException { + public void deleteOrder(@jakarta.annotation.Nonnull String orderId, Map headers) throws ApiException { deleteOrderWithHttpInfo(orderId, headers); } @@ -197,7 +197,7 @@ public void deleteOrder(@javax.annotation.Nonnull String orderId, Map deleteOrderWithHttpInfo(@javax.annotation.Nonnull String orderId) throws ApiException { + public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull String orderId) throws ApiException { return deleteOrderWithHttpInfo(orderId, null); } @@ -209,7 +209,7 @@ public ApiResponse deleteOrderWithHttpInfo(@javax.annotation.Nonnull Strin * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse deleteOrderWithHttpInfo(@javax.annotation.Nonnull String orderId, Map headers) throws ApiException { + public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull String orderId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -246,7 +246,7 @@ public ApiResponse deleteOrderWithHttpInfo(@javax.annotation.Nonnull Strin } } - private HttpRequest.Builder deleteOrderRequestBuilder(@javax.annotation.Nonnull String orderId, Map headers) throws ApiException { + private HttpRequest.Builder deleteOrderRequestBuilder(@jakarta.annotation.Nonnull String orderId, Map headers) throws ApiException { // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); @@ -389,7 +389,7 @@ private HttpRequest.Builder getInventoryRequestBuilder(Map heade * @return Order * @throws ApiException if fails to make API call */ - public Order getOrderById(@javax.annotation.Nonnull Long orderId) throws ApiException { + public Order getOrderById(@jakarta.annotation.Nonnull Long orderId) throws ApiException { return getOrderById(orderId, null); } @@ -401,7 +401,7 @@ public Order getOrderById(@javax.annotation.Nonnull Long orderId) throws ApiExce * @return Order * @throws ApiException if fails to make API call */ - public Order getOrderById(@javax.annotation.Nonnull Long orderId, Map headers) throws ApiException { + public Order getOrderById(@jakarta.annotation.Nonnull Long orderId, Map headers) throws ApiException { ApiResponse localVarResponse = getOrderByIdWithHttpInfo(orderId, headers); return localVarResponse.getData(); } @@ -413,7 +413,7 @@ public Order getOrderById(@javax.annotation.Nonnull Long orderId, Map getOrderByIdWithHttpInfo(@javax.annotation.Nonnull Long orderId) throws ApiException { + public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull Long orderId) throws ApiException { return getOrderByIdWithHttpInfo(orderId, null); } @@ -425,7 +425,7 @@ public ApiResponse getOrderByIdWithHttpInfo(@javax.annotation.Nonnull Lon * @return ApiResponse<Order> * @throws ApiException if fails to make API call */ - public ApiResponse getOrderByIdWithHttpInfo(@javax.annotation.Nonnull Long orderId, Map headers) throws ApiException { + public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull Long orderId, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -473,7 +473,7 @@ public ApiResponse getOrderByIdWithHttpInfo(@javax.annotation.Nonnull Lon } } - private HttpRequest.Builder getOrderByIdRequestBuilder(@javax.annotation.Nonnull Long orderId, Map headers) throws ApiException { + private HttpRequest.Builder getOrderByIdRequestBuilder(@jakarta.annotation.Nonnull Long orderId, Map headers) throws ApiException { // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); @@ -507,7 +507,7 @@ private HttpRequest.Builder getOrderByIdRequestBuilder(@javax.annotation.Nonnull * @return Order * @throws ApiException if fails to make API call */ - public Order placeOrder(@javax.annotation.Nonnull Order order) throws ApiException { + public Order placeOrder(@jakarta.annotation.Nonnull Order order) throws ApiException { return placeOrder(order, null); } @@ -519,7 +519,7 @@ public Order placeOrder(@javax.annotation.Nonnull Order order) throws ApiExcepti * @return Order * @throws ApiException if fails to make API call */ - public Order placeOrder(@javax.annotation.Nonnull Order order, Map headers) throws ApiException { + public Order placeOrder(@jakarta.annotation.Nonnull Order order, Map headers) throws ApiException { ApiResponse localVarResponse = placeOrderWithHttpInfo(order, headers); return localVarResponse.getData(); } @@ -531,7 +531,7 @@ public Order placeOrder(@javax.annotation.Nonnull Order order, Map placeOrderWithHttpInfo(@javax.annotation.Nonnull Order order) throws ApiException { + public ApiResponse placeOrderWithHttpInfo(@jakarta.annotation.Nonnull Order order) throws ApiException { return placeOrderWithHttpInfo(order, null); } @@ -543,7 +543,7 @@ public ApiResponse placeOrderWithHttpInfo(@javax.annotation.Nonnull Order * @return ApiResponse<Order> * @throws ApiException if fails to make API call */ - public ApiResponse placeOrderWithHttpInfo(@javax.annotation.Nonnull Order order, Map headers) throws ApiException { + public ApiResponse placeOrderWithHttpInfo(@jakarta.annotation.Nonnull Order order, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(order, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -591,7 +591,7 @@ public ApiResponse placeOrderWithHttpInfo(@javax.annotation.Nonnull Order } } - private HttpRequest.Builder placeOrderRequestBuilder(@javax.annotation.Nonnull Order order, Map headers) throws ApiException { + private HttpRequest.Builder placeOrderRequestBuilder(@jakarta.annotation.Nonnull Order order, Map headers) throws ApiException { // verify the required parameter 'order' is set if (order == null) { throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java index b6858b1a82ee..bc4ba4df7069 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java @@ -53,7 +53,7 @@ import java.util.Set; import java.util.function.Consumer; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class UserApi { /** * Utility class for extending HttpRequest.Builder functionality. @@ -176,7 +176,7 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * @param user Created user object (required) * @throws ApiException if fails to make API call */ - public void createUser(@javax.annotation.Nonnull User user) throws ApiException { + public void createUser(@jakarta.annotation.Nonnull User user) throws ApiException { createUser(user, null); } @@ -187,7 +187,7 @@ public void createUser(@javax.annotation.Nonnull User user) throws ApiException * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void createUser(@javax.annotation.Nonnull User user, Map headers) throws ApiException { + public void createUser(@jakarta.annotation.Nonnull User user, Map headers) throws ApiException { createUserWithHttpInfo(user, headers); } @@ -198,7 +198,7 @@ public void createUser(@javax.annotation.Nonnull User user, Map * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull User user) throws ApiException { + public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User user) throws ApiException { return createUserWithHttpInfo(user, null); } @@ -210,7 +210,7 @@ public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull User u * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull User user, Map headers) throws ApiException { + public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User user, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(user, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -247,7 +247,7 @@ public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull User u } } - private HttpRequest.Builder createUserRequestBuilder(@javax.annotation.Nonnull User user, Map headers) throws ApiException { + private HttpRequest.Builder createUserRequestBuilder(@jakarta.annotation.Nonnull User user, Map headers) throws ApiException { // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); @@ -285,7 +285,7 @@ private HttpRequest.Builder createUserRequestBuilder(@javax.annotation.Nonnull U * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithArrayInput(@javax.annotation.Nonnull List user) throws ApiException { + public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List user) throws ApiException { createUsersWithArrayInput(user, null); } @@ -296,7 +296,7 @@ public void createUsersWithArrayInput(@javax.annotation.Nonnull List user) * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void createUsersWithArrayInput(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List user, Map headers) throws ApiException { createUsersWithArrayInputWithHttpInfo(user, headers); } @@ -307,7 +307,7 @@ public void createUsersWithArrayInput(@javax.annotation.Nonnull List user, * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(@javax.annotation.Nonnull List user) throws ApiException { + public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { return createUsersWithArrayInputWithHttpInfo(user, null); } @@ -319,7 +319,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@javax.annotation * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List user, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(user, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -356,7 +356,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@javax.annotation } } - private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(@jakarta.annotation.Nonnull List user, Map headers) throws ApiException { // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); @@ -394,7 +394,7 @@ private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(@javax.annot * @param user List of user object (required) * @throws ApiException if fails to make API call */ - public void createUsersWithListInput(@javax.annotation.Nonnull List user) throws ApiException { + public void createUsersWithListInput(@jakarta.annotation.Nonnull List user) throws ApiException { createUsersWithListInput(user, null); } @@ -405,7 +405,7 @@ public void createUsersWithListInput(@javax.annotation.Nonnull List user) * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void createUsersWithListInput(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + public void createUsersWithListInput(@jakarta.annotation.Nonnull List user, Map headers) throws ApiException { createUsersWithListInputWithHttpInfo(user, headers); } @@ -416,7 +416,7 @@ public void createUsersWithListInput(@javax.annotation.Nonnull List user, * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithListInputWithHttpInfo(@javax.annotation.Nonnull List user) throws ApiException { + public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { return createUsersWithListInputWithHttpInfo(user, null); } @@ -428,7 +428,7 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@javax.annotation. * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse createUsersWithListInputWithHttpInfo(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List user, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(user, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -465,7 +465,7 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@javax.annotation. } } - private HttpRequest.Builder createUsersWithListInputRequestBuilder(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + private HttpRequest.Builder createUsersWithListInputRequestBuilder(@jakarta.annotation.Nonnull List user, Map headers) throws ApiException { // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); @@ -503,7 +503,7 @@ private HttpRequest.Builder createUsersWithListInputRequestBuilder(@javax.annota * @param username The name that needs to be deleted (required) * @throws ApiException if fails to make API call */ - public void deleteUser(@javax.annotation.Nonnull String username) throws ApiException { + public void deleteUser(@jakarta.annotation.Nonnull String username) throws ApiException { deleteUser(username, null); } @@ -514,7 +514,7 @@ public void deleteUser(@javax.annotation.Nonnull String username) throws ApiExce * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void deleteUser(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + public void deleteUser(@jakarta.annotation.Nonnull String username, Map headers) throws ApiException { deleteUserWithHttpInfo(username, headers); } @@ -525,7 +525,7 @@ public void deleteUser(@javax.annotation.Nonnull String username, Map deleteUserWithHttpInfo(@javax.annotation.Nonnull String username) throws ApiException { + public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull String username) throws ApiException { return deleteUserWithHttpInfo(username, null); } @@ -537,7 +537,7 @@ public ApiResponse deleteUserWithHttpInfo(@javax.annotation.Nonnull String * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse deleteUserWithHttpInfo(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull String username, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -574,7 +574,7 @@ public ApiResponse deleteUserWithHttpInfo(@javax.annotation.Nonnull String } } - private HttpRequest.Builder deleteUserRequestBuilder(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + private HttpRequest.Builder deleteUserRequestBuilder(@jakarta.annotation.Nonnull String username, Map headers) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); @@ -608,7 +608,7 @@ private HttpRequest.Builder deleteUserRequestBuilder(@javax.annotation.Nonnull S * @return User * @throws ApiException if fails to make API call */ - public User getUserByName(@javax.annotation.Nonnull String username) throws ApiException { + public User getUserByName(@jakarta.annotation.Nonnull String username) throws ApiException { return getUserByName(username, null); } @@ -620,7 +620,7 @@ public User getUserByName(@javax.annotation.Nonnull String username) throws ApiE * @return User * @throws ApiException if fails to make API call */ - public User getUserByName(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + public User getUserByName(@jakarta.annotation.Nonnull String username, Map headers) throws ApiException { ApiResponse localVarResponse = getUserByNameWithHttpInfo(username, headers); return localVarResponse.getData(); } @@ -632,7 +632,7 @@ public User getUserByName(@javax.annotation.Nonnull String username, Map getUserByNameWithHttpInfo(@javax.annotation.Nonnull String username) throws ApiException { + public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull String username) throws ApiException { return getUserByNameWithHttpInfo(username, null); } @@ -644,7 +644,7 @@ public ApiResponse getUserByNameWithHttpInfo(@javax.annotation.Nonnull Str * @return ApiResponse<User> * @throws ApiException if fails to make API call */ - public ApiResponse getUserByNameWithHttpInfo(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull String username, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -692,7 +692,7 @@ public ApiResponse getUserByNameWithHttpInfo(@javax.annotation.Nonnull Str } } - private HttpRequest.Builder getUserByNameRequestBuilder(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + private HttpRequest.Builder getUserByNameRequestBuilder(@jakarta.annotation.Nonnull String username, Map headers) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); @@ -727,7 +727,7 @@ private HttpRequest.Builder getUserByNameRequestBuilder(@javax.annotation.Nonnul * @return String * @throws ApiException if fails to make API call */ - public String loginUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password) throws ApiException { + public String loginUser(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull String password) throws ApiException { return loginUser(username, password, null); } @@ -740,7 +740,7 @@ public String loginUser(@javax.annotation.Nonnull String username, @javax.annota * @return String * @throws ApiException if fails to make API call */ - public String loginUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password, Map headers) throws ApiException { + public String loginUser(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull String password, Map headers) throws ApiException { ApiResponse localVarResponse = loginUserWithHttpInfo(username, password, headers); return localVarResponse.getData(); } @@ -753,7 +753,7 @@ public String loginUser(@javax.annotation.Nonnull String username, @javax.annota * @return ApiResponse<String> * @throws ApiException if fails to make API call */ - public ApiResponse loginUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password) throws ApiException { + public ApiResponse loginUserWithHttpInfo(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull String password) throws ApiException { return loginUserWithHttpInfo(username, password, null); } @@ -766,7 +766,7 @@ public ApiResponse loginUserWithHttpInfo(@javax.annotation.Nonnull Strin * @return ApiResponse<String> * @throws ApiException if fails to make API call */ - public ApiResponse loginUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password, Map headers) throws ApiException { + public ApiResponse loginUserWithHttpInfo(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull String password, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -814,7 +814,7 @@ public ApiResponse loginUserWithHttpInfo(@javax.annotation.Nonnull Strin } } - private HttpRequest.Builder loginUserRequestBuilder(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password, Map headers) throws ApiException { + private HttpRequest.Builder loginUserRequestBuilder(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull String password, Map headers) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); @@ -963,7 +963,7 @@ private HttpRequest.Builder logoutUserRequestBuilder(Map headers * @param user Updated user object (required) * @throws ApiException if fails to make API call */ - public void updateUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user) throws ApiException { + public void updateUser(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull User user) throws ApiException { updateUser(username, user, null); } @@ -975,7 +975,7 @@ public void updateUser(@javax.annotation.Nonnull String username, @javax.annotat * @param headers Optional headers to include in the request * @throws ApiException if fails to make API call */ - public void updateUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + public void updateUser(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull User user, Map headers) throws ApiException { updateUserWithHttpInfo(username, user, headers); } @@ -987,7 +987,7 @@ public void updateUser(@javax.annotation.Nonnull String username, @javax.annotat * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user) throws ApiException { + public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull User user) throws ApiException { return updateUserWithHttpInfo(username, user, null); } @@ -1000,7 +1000,7 @@ public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull User user, Map headers) throws ApiException { HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, user, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -1037,7 +1037,7 @@ public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String } } - private HttpRequest.Builder updateUserRequestBuilder(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + private HttpRequest.Builder updateUserRequestBuilder(@jakarta.annotation.Nonnull String username, @jakarta.annotation.Nonnull User user, Map headers) throws ApiException { // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 583959654e10..a44004130f96 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -22,7 +22,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 15167b202246..6b2efab3434e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -45,44 +45,44 @@ AdditionalPropertiesClass.JSON_PROPERTY_EMPTY_MAP, AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map mapProperty = new HashMap<>(); public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map> mapOfMapProperty = new HashMap<>(); public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object anytype1 = null; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object mapWithUndeclaredPropertiesAnytype1; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object mapWithUndeclaredPropertiesAnytype2; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object emptyMap; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map mapWithUndeclaredPropertiesString = new HashMap<>(); public AdditionalPropertiesClass() { } - public AdditionalPropertiesClass mapProperty(@javax.annotation.Nullable Map mapProperty) { + public AdditionalPropertiesClass mapProperty(@jakarta.annotation.Nullable Map mapProperty) { this.mapProperty = mapProperty; return this; } @@ -99,7 +99,7 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper * Get mapProperty * @return mapProperty */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getMapProperty() { @@ -109,12 +109,12 @@ public Map getMapProperty() { @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapProperty(@javax.annotation.Nullable Map mapProperty) { + public void setMapProperty(@jakarta.annotation.Nullable Map mapProperty) { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(@javax.annotation.Nullable Map> mapOfMapProperty) { + public AdditionalPropertiesClass mapOfMapProperty(@jakarta.annotation.Nullable Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } @@ -131,7 +131,7 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { @@ -141,12 +141,12 @@ public Map> getMapOfMapProperty() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapOfMapProperty(@javax.annotation.Nullable Map> mapOfMapProperty) { + public void setMapOfMapProperty(@jakarta.annotation.Nullable Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - public AdditionalPropertiesClass anytype1(@javax.annotation.Nullable Object anytype1) { + public AdditionalPropertiesClass anytype1(@jakarta.annotation.Nullable Object anytype1) { this.anytype1 = anytype1; return this; } @@ -155,7 +155,7 @@ public AdditionalPropertiesClass anytype1(@javax.annotation.Nullable Object anyt * Get anytype1 * @return anytype1 */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getAnytype1() { @@ -165,12 +165,12 @@ public Object getAnytype1() { @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAnytype1(@javax.annotation.Nullable Object anytype1) { + public void setAnytype1(@jakarta.annotation.Nullable Object anytype1) { this.anytype1 = anytype1; } - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(@jakarta.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; return this; } @@ -179,7 +179,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(@javax.anno * Get mapWithUndeclaredPropertiesAnytype1 * @return mapWithUndeclaredPropertiesAnytype1 */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getMapWithUndeclaredPropertiesAnytype1() { @@ -189,12 +189,12 @@ public Object getMapWithUndeclaredPropertiesAnytype1() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesAnytype1(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { + public void setMapWithUndeclaredPropertiesAnytype1(@jakarta.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; } - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(@jakarta.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; return this; } @@ -203,7 +203,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(@javax.anno * Get mapWithUndeclaredPropertiesAnytype2 * @return mapWithUndeclaredPropertiesAnytype2 */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getMapWithUndeclaredPropertiesAnytype2() { @@ -213,12 +213,12 @@ public Object getMapWithUndeclaredPropertiesAnytype2() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesAnytype2(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { + public void setMapWithUndeclaredPropertiesAnytype2(@jakarta.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; } - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(@jakarta.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; return this; } @@ -235,7 +235,7 @@ public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(Stri * Get mapWithUndeclaredPropertiesAnytype3 * @return mapWithUndeclaredPropertiesAnytype3 */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) public Map getMapWithUndeclaredPropertiesAnytype3() { @@ -245,12 +245,12 @@ public Map getMapWithUndeclaredPropertiesAnytype3() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesAnytype3(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { + public void setMapWithUndeclaredPropertiesAnytype3(@jakarta.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; } - public AdditionalPropertiesClass emptyMap(@javax.annotation.Nullable Object emptyMap) { + public AdditionalPropertiesClass emptyMap(@jakarta.annotation.Nullable Object emptyMap) { this.emptyMap = emptyMap; return this; } @@ -259,7 +259,7 @@ public AdditionalPropertiesClass emptyMap(@javax.annotation.Nullable Object empt * an object with no declared properties and no undeclared properties, hence it's an empty map. * @return emptyMap */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getEmptyMap() { @@ -269,12 +269,12 @@ public Object getEmptyMap() { @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmptyMap(@javax.annotation.Nullable Object emptyMap) { + public void setEmptyMap(@jakarta.annotation.Nullable Object emptyMap) { this.emptyMap = emptyMap; } - public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesString) { + public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(@jakarta.annotation.Nullable Map mapWithUndeclaredPropertiesString) { this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; return this; } @@ -291,7 +291,7 @@ public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String * Get mapWithUndeclaredPropertiesString * @return mapWithUndeclaredPropertiesString */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getMapWithUndeclaredPropertiesString() { @@ -301,7 +301,7 @@ public Map getMapWithUndeclaredPropertiesString() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesString) { + public void setMapWithUndeclaredPropertiesString(@jakarta.annotation.Nullable Map mapWithUndeclaredPropertiesString) { this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java index 4808e2d473bf..235dc6f95d93 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ AllOfRefToDouble.JSON_PROPERTY_HEIGHT }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class AllOfRefToDouble { public static final String JSON_PROPERTY_HEIGHT = "height"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Double height = 32.1d; public AllOfRefToDouble() { } - public AllOfRefToDouble height(@javax.annotation.Nullable Double height) { + public AllOfRefToDouble height(@jakarta.annotation.Nullable Double height) { this.height = height; return this; } @@ -54,7 +54,7 @@ public AllOfRefToDouble height(@javax.annotation.Nullable Double height) { * Height as double * @return height */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Double getHeight() { @@ -64,7 +64,7 @@ public Double getHeight() { @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(@javax.annotation.Nullable Double height) { + public void setHeight(@jakarta.annotation.Nullable Double height) { this.height = height; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java index d687bac24920..970fd73042e2 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ AllOfRefToFloat.JSON_PROPERTY_WEIGHT }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class AllOfRefToFloat { public static final String JSON_PROPERTY_WEIGHT = "weight"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Float weight = 7.89f; public AllOfRefToFloat() { } - public AllOfRefToFloat weight(@javax.annotation.Nullable Float weight) { + public AllOfRefToFloat weight(@jakarta.annotation.Nullable Float weight) { this.weight = weight; return this; } @@ -54,7 +54,7 @@ public AllOfRefToFloat weight(@javax.annotation.Nullable Float weight) { * Weight as float * @return weight */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Float getWeight() { @@ -64,7 +64,7 @@ public Float getWeight() { @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWeight(@javax.annotation.Nullable Float weight) { + public void setWeight(@jakarta.annotation.Nullable Float weight) { this.weight = weight; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java index f131d549f0ff..da35d37405ba 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ AllOfRefToLong.JSON_PROPERTY_ID }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class AllOfRefToLong { public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long id = 10l; public AllOfRefToLong() { } - public AllOfRefToLong id(@javax.annotation.Nullable Long id) { + public AllOfRefToLong id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -54,7 +54,7 @@ public AllOfRefToLong id(@javax.annotation.Nullable Long id) { * Id as long * @return id */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -64,7 +64,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable Long id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java index 8f084f26e3dd..7a24e5e137f4 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonIgnoreProperties( value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization allowSetters = true // allows the className to be set during deserialization @@ -54,17 +54,17 @@ public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String className; public static final String JSON_PROPERTY_COLOR = "color"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String color = "red"; public Animal() { } - public Animal className(@javax.annotation.Nonnull String className) { + public Animal className(@jakarta.annotation.Nonnull String className) { this.className = className; return this; } @@ -73,7 +73,7 @@ public Animal className(@javax.annotation.Nonnull String className) { * Get className * @return className */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getClassName() { @@ -83,12 +83,12 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(@javax.annotation.Nonnull String className) { + public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } - public Animal color(@javax.annotation.Nullable String color) { + public Animal color(@jakarta.annotation.Nullable String color) { this.color = color; return this; } @@ -97,7 +97,7 @@ public Animal color(@javax.annotation.Nullable String color) { * Get color * @return color */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getColor() { @@ -107,7 +107,7 @@ public String getColor() { @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setColor(@javax.annotation.Nullable String color) { + public void setColor(@jakarta.annotation.Nullable String color) { this.color = color; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java index b981e679d9f3..a652f169b6ec 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java @@ -38,20 +38,20 @@ Apple.JSON_PROPERTY_CULTIVAR, Apple.JSON_PROPERTY_ORIGIN }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Apple { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String cultivar; public static final String JSON_PROPERTY_ORIGIN = "origin"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String origin; public Apple() { } - public Apple cultivar(@javax.annotation.Nullable String cultivar) { + public Apple cultivar(@jakarta.annotation.Nullable String cultivar) { this.cultivar = cultivar; return this; } @@ -60,7 +60,7 @@ public Apple cultivar(@javax.annotation.Nullable String cultivar) { * Get cultivar * @return cultivar */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getCultivar() { @@ -70,12 +70,12 @@ public String getCultivar() { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCultivar(@javax.annotation.Nullable String cultivar) { + public void setCultivar(@jakarta.annotation.Nullable String cultivar) { this.cultivar = cultivar; } - public Apple origin(@javax.annotation.Nullable String origin) { + public Apple origin(@jakarta.annotation.Nullable String origin) { this.origin = origin; return this; } @@ -84,7 +84,7 @@ public Apple origin(@javax.annotation.Nullable String origin) { * Get origin * @return origin */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getOrigin() { @@ -94,7 +94,7 @@ public String getOrigin() { @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrigin(@javax.annotation.Nullable String origin) { + public void setOrigin(@jakarta.annotation.Nullable String origin) { this.origin = origin; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java index 049607bc9eb7..25a40d2b70d2 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -38,20 +38,20 @@ AppleReq.JSON_PROPERTY_CULTIVAR, AppleReq.JSON_PROPERTY_MEALY }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class AppleReq { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String cultivar; public static final String JSON_PROPERTY_MEALY = "mealy"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean mealy; public AppleReq() { } - public AppleReq cultivar(@javax.annotation.Nonnull String cultivar) { + public AppleReq cultivar(@jakarta.annotation.Nonnull String cultivar) { this.cultivar = cultivar; return this; } @@ -60,7 +60,7 @@ public AppleReq cultivar(@javax.annotation.Nonnull String cultivar) { * Get cultivar * @return cultivar */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getCultivar() { @@ -70,12 +70,12 @@ public String getCultivar() { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCultivar(@javax.annotation.Nonnull String cultivar) { + public void setCultivar(@jakarta.annotation.Nonnull String cultivar) { this.cultivar = cultivar; } - public AppleReq mealy(@javax.annotation.Nullable Boolean mealy) { + public AppleReq mealy(@jakarta.annotation.Nullable Boolean mealy) { this.mealy = mealy; return this; } @@ -84,7 +84,7 @@ public AppleReq mealy(@javax.annotation.Nullable Boolean mealy) { * Get mealy * @return mealy */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getMealy() { @@ -94,7 +94,7 @@ public Boolean getMealy() { @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMealy(@javax.annotation.Nullable Boolean mealy) { + public void setMealy(@jakarta.annotation.Nullable Boolean mealy) { this.mealy = mealy; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index df9cb3b18a63..2e88e4768f40 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -39,16 +39,16 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly() { } - public ArrayOfArrayOfNumberOnly arrayArrayNumber(@javax.annotation.Nullable List> arrayArrayNumber) { + public ArrayOfArrayOfNumberOnly arrayArrayNumber(@jakarta.annotation.Nullable List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -65,7 +65,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List> getArrayArrayNumber() { @@ -75,7 +75,7 @@ public List> getArrayArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayNumber(@javax.annotation.Nullable List> arrayArrayNumber) { + public void setArrayArrayNumber(@jakarta.annotation.Nullable List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index e68a162b26d0..4f678f35bb37 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -39,16 +39,16 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly() { } - public ArrayOfNumberOnly arrayNumber(@javax.annotation.Nullable List arrayNumber) { + public ArrayOfNumberOnly arrayNumber(@jakarta.annotation.Nullable List arrayNumber) { this.arrayNumber = arrayNumber; return this; } @@ -65,7 +65,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getArrayNumber() { @@ -75,7 +75,7 @@ public List getArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayNumber(@javax.annotation.Nullable List arrayNumber) { + public void setArrayNumber(@jakarta.annotation.Nullable List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java index ac83334d9600..df6ed29ec9cb 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -41,24 +41,24 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List arrayOfString = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List> arrayArrayOfInteger = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest() { } - public ArrayTest arrayOfString(@javax.annotation.Nullable List arrayOfString) { + public ArrayTest arrayOfString(@jakarta.annotation.Nullable List arrayOfString) { this.arrayOfString = arrayOfString; return this; } @@ -75,7 +75,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getArrayOfString() { @@ -85,12 +85,12 @@ public List getArrayOfString() { @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayOfString(@javax.annotation.Nullable List arrayOfString) { + public void setArrayOfString(@jakarta.annotation.Nullable List arrayOfString) { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(@javax.annotation.Nullable List> arrayArrayOfInteger) { + public ArrayTest arrayArrayOfInteger(@jakarta.annotation.Nullable List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -107,7 +107,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List> getArrayArrayOfInteger() { @@ -117,12 +117,12 @@ public List> getArrayArrayOfInteger() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfInteger(@javax.annotation.Nullable List> arrayArrayOfInteger) { + public void setArrayArrayOfInteger(@jakarta.annotation.Nullable List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(@javax.annotation.Nullable List> arrayArrayOfModel) { + public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -139,7 +139,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List> getArrayArrayOfModel() { @@ -149,7 +149,7 @@ public List> getArrayArrayOfModel() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(@javax.annotation.Nullable List> arrayArrayOfModel) { + public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java index 1a398fd5b543..08f4e283ad7b 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java @@ -38,16 +38,16 @@ @JsonPropertyOrder({ Banana.JSON_PROPERTY_LENGTH_CM }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Banana { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal lengthCm; public Banana() { } - public Banana lengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { + public Banana lengthCm(@jakarta.annotation.Nullable BigDecimal lengthCm) { this.lengthCm = lengthCm; return this; } @@ -56,7 +56,7 @@ public Banana lengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { * Get lengthCm * @return lengthCm */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getLengthCm() { @@ -66,7 +66,7 @@ public BigDecimal getLengthCm() { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { + public void setLengthCm(@jakarta.annotation.Nullable BigDecimal lengthCm) { this.lengthCm = lengthCm; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java index 37e051126cb5..098d2c7f9fdc 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java @@ -39,20 +39,20 @@ BananaReq.JSON_PROPERTY_LENGTH_CM, BananaReq.JSON_PROPERTY_SWEET }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class BananaReq { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private BigDecimal lengthCm; public static final String JSON_PROPERTY_SWEET = "sweet"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean sweet; public BananaReq() { } - public BananaReq lengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { + public BananaReq lengthCm(@jakarta.annotation.Nonnull BigDecimal lengthCm) { this.lengthCm = lengthCm; return this; } @@ -61,7 +61,7 @@ public BananaReq lengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { * Get lengthCm * @return lengthCm */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public BigDecimal getLengthCm() { @@ -71,12 +71,12 @@ public BigDecimal getLengthCm() { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setLengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { + public void setLengthCm(@jakarta.annotation.Nonnull BigDecimal lengthCm) { this.lengthCm = lengthCm; } - public BananaReq sweet(@javax.annotation.Nullable Boolean sweet) { + public BananaReq sweet(@jakarta.annotation.Nullable Boolean sweet) { this.sweet = sweet; return this; } @@ -85,7 +85,7 @@ public BananaReq sweet(@javax.annotation.Nullable Boolean sweet) { * Get sweet * @return sweet */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getSweet() { @@ -95,7 +95,7 @@ public Boolean getSweet() { @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSweet(@javax.annotation.Nullable Boolean sweet) { + public void setSweet(@jakarta.annotation.Nullable Boolean sweet) { this.sweet = sweet; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java index a547cbb7cef0..129cc46624dd 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ BasquePig.JSON_PROPERTY_CLASS_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class BasquePig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String className; public BasquePig() { } - public BasquePig className(@javax.annotation.Nonnull String className) { + public BasquePig className(@jakarta.annotation.Nonnull String className) { this.className = className; return this; } @@ -54,7 +54,7 @@ public BasquePig className(@javax.annotation.Nonnull String className) { * Get className * @return className */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getClassName() { @@ -64,7 +64,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(@javax.annotation.Nonnull String className) { + public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java index de06f767ae2b..2bb12800aab3 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -41,36 +41,36 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String ATT_NAME; public Capitalization() { } - public Capitalization smallCamel(@javax.annotation.Nullable String smallCamel) { + public Capitalization smallCamel(@jakarta.annotation.Nullable String smallCamel) { this.smallCamel = smallCamel; return this; } @@ -79,7 +79,7 @@ public Capitalization smallCamel(@javax.annotation.Nullable String smallCamel) { * Get smallCamel * @return smallCamel */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getSmallCamel() { @@ -89,12 +89,12 @@ public String getSmallCamel() { @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallCamel(@javax.annotation.Nullable String smallCamel) { + public void setSmallCamel(@jakarta.annotation.Nullable String smallCamel) { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(@javax.annotation.Nullable String capitalCamel) { + public Capitalization capitalCamel(@jakarta.annotation.Nullable String capitalCamel) { this.capitalCamel = capitalCamel; return this; } @@ -103,7 +103,7 @@ public Capitalization capitalCamel(@javax.annotation.Nullable String capitalCame * Get capitalCamel * @return capitalCamel */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getCapitalCamel() { @@ -113,12 +113,12 @@ public String getCapitalCamel() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalCamel(@javax.annotation.Nullable String capitalCamel) { + public void setCapitalCamel(@jakarta.annotation.Nullable String capitalCamel) { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(@javax.annotation.Nullable String smallSnake) { + public Capitalization smallSnake(@jakarta.annotation.Nullable String smallSnake) { this.smallSnake = smallSnake; return this; } @@ -127,7 +127,7 @@ public Capitalization smallSnake(@javax.annotation.Nullable String smallSnake) { * Get smallSnake * @return smallSnake */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getSmallSnake() { @@ -137,12 +137,12 @@ public String getSmallSnake() { @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallSnake(@javax.annotation.Nullable String smallSnake) { + public void setSmallSnake(@jakarta.annotation.Nullable String smallSnake) { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(@javax.annotation.Nullable String capitalSnake) { + public Capitalization capitalSnake(@jakarta.annotation.Nullable String capitalSnake) { this.capitalSnake = capitalSnake; return this; } @@ -151,7 +151,7 @@ public Capitalization capitalSnake(@javax.annotation.Nullable String capitalSnak * Get capitalSnake * @return capitalSnake */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getCapitalSnake() { @@ -161,12 +161,12 @@ public String getCapitalSnake() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalSnake(@javax.annotation.Nullable String capitalSnake) { + public void setCapitalSnake(@jakarta.annotation.Nullable String capitalSnake) { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(@javax.annotation.Nullable String scAETHFlowPoints) { + public Capitalization scAETHFlowPoints(@jakarta.annotation.Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } @@ -175,7 +175,7 @@ public Capitalization scAETHFlowPoints(@javax.annotation.Nullable String scAETHF * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getScAETHFlowPoints() { @@ -185,12 +185,12 @@ public String getScAETHFlowPoints() { @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScAETHFlowPoints(@javax.annotation.Nullable String scAETHFlowPoints) { + public void setScAETHFlowPoints(@jakarta.annotation.Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(@javax.annotation.Nullable String ATT_NAME) { + public Capitalization ATT_NAME(@jakarta.annotation.Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } @@ -199,7 +199,7 @@ public Capitalization ATT_NAME(@javax.annotation.Nullable String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getATTNAME() { @@ -209,7 +209,7 @@ public String getATTNAME() { @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setATTNAME(@javax.annotation.Nullable String ATT_NAME) { + public void setATTNAME(@jakarta.annotation.Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java index e771ed832c13..7bcb977b67d1 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java @@ -42,7 +42,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonIgnoreProperties( value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization allowSetters = true // allows the className to be set during deserialization @@ -51,13 +51,13 @@ public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean declawed; public Cat() { } - public Cat declawed(@javax.annotation.Nullable Boolean declawed) { + public Cat declawed(@jakarta.annotation.Nullable Boolean declawed) { this.declawed = declawed; return this; } @@ -66,7 +66,7 @@ public Cat declawed(@javax.annotation.Nullable Boolean declawed) { * Get declawed * @return declawed */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getDeclawed() { @@ -76,19 +76,19 @@ public Boolean getDeclawed() { @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(@javax.annotation.Nullable Boolean declawed) { + public void setDeclawed(@jakarta.annotation.Nullable Boolean declawed) { this.declawed = declawed; } @Override - public Cat className(@javax.annotation.Nonnull String className) { + public Cat className(@jakarta.annotation.Nonnull String className) { this.setClassName(className); return this; } @Override - public Cat color(@javax.annotation.Nullable String color) { + public Cat color(@jakarta.annotation.Nullable String color) { this.setColor(color); return this; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java index 7500e3795daa..b470d9aae80a 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java @@ -37,20 +37,20 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Category { public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String name = "default-name"; public Category() { } - public Category id(@javax.annotation.Nullable Long id) { + public Category id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -59,7 +59,7 @@ public Category id(@javax.annotation.Nullable Long id) { * Get id * @return id */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -69,12 +69,12 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable Long id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } - public Category name(@javax.annotation.Nonnull String name) { + public Category name(@jakarta.annotation.Nonnull String name) { this.name = name; return this; } @@ -83,7 +83,7 @@ public Category name(@javax.annotation.Nonnull String name) { * Get name * @return name */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { @@ -93,7 +93,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { + public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java index 5f4e8979112f..546e2dc56d90 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -44,7 +44,7 @@ ChildCat.JSON_PROPERTY_NAME, ChildCat.JSON_PROPERTY_PET_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonIgnoreProperties( value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization allowSetters = true // allows the pet_type to be set during deserialization @@ -53,17 +53,17 @@ public class ChildCat extends ParentPet { public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String name; public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String petType = "ChildCat"; public ChildCat() { } - public ChildCat name(@javax.annotation.Nullable String name) { + public ChildCat name(@jakarta.annotation.Nullable String name) { this.name = name; return this; } @@ -72,7 +72,7 @@ public ChildCat name(@javax.annotation.Nullable String name) { * Get name * @return name */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -82,7 +82,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { + public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } @@ -91,7 +91,7 @@ public void setName(@javax.annotation.Nullable String name) { "ChildCat" )); - public ChildCat petType(@javax.annotation.Nullable String petType) { + public ChildCat petType(@jakarta.annotation.Nullable String petType) { if (!PET_TYPE_VALUES.contains(petType)) { throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); } @@ -104,7 +104,7 @@ public ChildCat petType(@javax.annotation.Nullable String petType) { * Get petType * @return petType */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPetType() { @@ -114,7 +114,7 @@ public String getPetType() { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetType(@javax.annotation.Nullable String petType) { + public void setPetType(@jakarta.annotation.Nullable String petType) { if (!PET_TYPE_VALUES.contains(petType)) { throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java index 54c192931035..40c658862078 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String propertyClass; public ClassModel() { } - public ClassModel propertyClass(@javax.annotation.Nullable String propertyClass) { + public ClassModel propertyClass(@jakarta.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; return this; } @@ -54,7 +54,7 @@ public ClassModel propertyClass(@javax.annotation.Nullable String propertyClass) * Get propertyClass * @return propertyClass */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPropertyClass() { @@ -64,7 +64,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { + public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java index a679cf9345e5..506eee926b3c 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String client; public Client() { } - public Client client(@javax.annotation.Nullable String client) { + public Client client(@jakarta.annotation.Nullable String client) { this.client = client; return this; } @@ -54,7 +54,7 @@ public Client client(@javax.annotation.Nullable String client) { * Get client * @return client */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getClient() { @@ -64,7 +64,7 @@ public String getClient() { @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClient(@javax.annotation.Nullable String client) { + public void setClient(@jakarta.annotation.Nullable String client) { this.client = client; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index aefba9a2c39a..62a206a9fc7e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -37,20 +37,20 @@ ComplexQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ComplexQuadrilateral { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String quadrilateralType; public ComplexQuadrilateral() { } - public ComplexQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType) { + public ComplexQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; return this; } @@ -59,7 +59,7 @@ public ComplexQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType * Get shapeType * @return shapeType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getShapeType() { @@ -69,12 +69,12 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(@javax.annotation.Nonnull String shapeType) { + public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } - public ComplexQuadrilateral quadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + public ComplexQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; return this; } @@ -83,7 +83,7 @@ public ComplexQuadrilateral quadrilateralType(@javax.annotation.Nonnull String q * Get quadrilateralType * @return quadrilateralType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getQuadrilateralType() { @@ -93,7 +93,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java index 1184f4a30009..5108d021f799 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ DanishPig.JSON_PROPERTY_CLASS_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class DanishPig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String className; public DanishPig() { } - public DanishPig className(@javax.annotation.Nonnull String className) { + public DanishPig className(@jakarta.annotation.Nonnull String className) { this.className = className; return this; } @@ -54,7 +54,7 @@ public DanishPig className(@javax.annotation.Nonnull String className) { * Get className * @return className */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getClassName() { @@ -64,7 +64,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(@javax.annotation.Nonnull String className) { + public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 64ebfb6dcb5d..550ba8fa1782 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -38,16 +38,16 @@ @JsonPropertyOrder({ DeprecatedObject.JSON_PROPERTY_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String name; public DeprecatedObject() { } - public DeprecatedObject name(@javax.annotation.Nullable String name) { + public DeprecatedObject name(@jakarta.annotation.Nullable String name) { this.name = name; return this; } @@ -56,7 +56,7 @@ public DeprecatedObject name(@javax.annotation.Nullable String name) { * Get name * @return name */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -66,7 +66,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { + public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java index d8807486840e..af60d5775478 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java @@ -41,7 +41,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonIgnoreProperties( value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization allowSetters = true // allows the className to be set during deserialization @@ -50,13 +50,13 @@ public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String breed; public Dog() { } - public Dog breed(@javax.annotation.Nullable String breed) { + public Dog breed(@jakarta.annotation.Nullable String breed) { this.breed = breed; return this; } @@ -65,7 +65,7 @@ public Dog breed(@javax.annotation.Nullable String breed) { * Get breed * @return breed */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getBreed() { @@ -75,19 +75,19 @@ public String getBreed() { @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(@javax.annotation.Nullable String breed) { + public void setBreed(@jakarta.annotation.Nullable String breed) { this.breed = breed; } @Override - public Dog className(@javax.annotation.Nonnull String className) { + public Dog className(@jakarta.annotation.Nonnull String className) { this.setClassName(className); return this; } @Override - public Dog color(@javax.annotation.Nullable String color) { + public Dog color(@jakarta.annotation.Nullable String color) { this.setColor(color); return this; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java index 2c0de10a1d34..e6ef83502b0e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java @@ -49,28 +49,28 @@ Drawing.JSON_PROPERTY_NULLABLE_SHAPE, Drawing.JSON_PROPERTY_SHAPES }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Drawing { public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Shape mainShape; public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private ShapeOrNull shapeOrNull; public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private NullableShape nullableShape; public static final String JSON_PROPERTY_SHAPES = "shapes"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List shapes = new ArrayList<>(); public Drawing() { } - public Drawing mainShape(@javax.annotation.Nullable Shape mainShape) { + public Drawing mainShape(@jakarta.annotation.Nullable Shape mainShape) { this.mainShape = mainShape; return this; } @@ -79,7 +79,7 @@ public Drawing mainShape(@javax.annotation.Nullable Shape mainShape) { * Get mainShape * @return mainShape */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Shape getMainShape() { @@ -89,12 +89,12 @@ public Shape getMainShape() { @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMainShape(@javax.annotation.Nullable Shape mainShape) { + public void setMainShape(@jakarta.annotation.Nullable Shape mainShape) { this.mainShape = mainShape; } - public Drawing shapeOrNull(@javax.annotation.Nullable ShapeOrNull shapeOrNull) { + public Drawing shapeOrNull(@jakarta.annotation.Nullable ShapeOrNull shapeOrNull) { this.shapeOrNull = shapeOrNull; return this; } @@ -103,7 +103,7 @@ public Drawing shapeOrNull(@javax.annotation.Nullable ShapeOrNull shapeOrNull) { * Get shapeOrNull * @return shapeOrNull */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHAPE_OR_NULL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public ShapeOrNull getShapeOrNull() { @@ -113,12 +113,12 @@ public ShapeOrNull getShapeOrNull() { @JsonProperty(value = JSON_PROPERTY_SHAPE_OR_NULL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShapeOrNull(@javax.annotation.Nullable ShapeOrNull shapeOrNull) { + public void setShapeOrNull(@jakarta.annotation.Nullable ShapeOrNull shapeOrNull) { this.shapeOrNull = shapeOrNull; } - public Drawing nullableShape(@javax.annotation.Nullable NullableShape nullableShape) { + public Drawing nullableShape(@jakarta.annotation.Nullable NullableShape nullableShape) { this.nullableShape = nullableShape; return this; } @@ -127,7 +127,7 @@ public Drawing nullableShape(@javax.annotation.Nullable NullableShape nullableSh * Get nullableShape * @return nullableShape */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NULLABLE_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public NullableShape getNullableShape() { @@ -137,12 +137,12 @@ public NullableShape getNullableShape() { @JsonProperty(value = JSON_PROPERTY_NULLABLE_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNullableShape(@javax.annotation.Nullable NullableShape nullableShape) { + public void setNullableShape(@jakarta.annotation.Nullable NullableShape nullableShape) { this.nullableShape = nullableShape; } - public Drawing shapes(@javax.annotation.Nullable List shapes) { + public Drawing shapes(@jakarta.annotation.Nullable List shapes) { this.shapes = shapes; return this; } @@ -159,7 +159,7 @@ public Drawing addShapesItem(Shape shapesItem) { * Get shapes * @return shapes */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getShapes() { @@ -169,7 +169,7 @@ public List getShapes() { @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShapes(@javax.annotation.Nullable List shapes) { + public void setShapes(@jakarta.annotation.Nullable List shapes) { this.shapes = shapes; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java index 1a31adc31f58..e3c8d0058bc6 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -39,7 +39,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class EnumArrays { /** * Gets or Sets justSymbol @@ -77,7 +77,7 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private JustSymbolEnum justSymbol; /** @@ -116,13 +116,13 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List arrayEnum = new ArrayList<>(); public EnumArrays() { } - public EnumArrays justSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbol) { + public EnumArrays justSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } @@ -131,7 +131,7 @@ public EnumArrays justSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbo * Get justSymbol * @return justSymbol */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public JustSymbolEnum getJustSymbol() { @@ -141,12 +141,12 @@ public JustSymbolEnum getJustSymbol() { @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbol) { + public void setJustSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(@javax.annotation.Nullable List arrayEnum) { + public EnumArrays arrayEnum(@jakarta.annotation.Nullable List arrayEnum) { this.arrayEnum = arrayEnum; return this; } @@ -163,7 +163,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getArrayEnum() { @@ -173,7 +173,7 @@ public List getArrayEnum() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayEnum(@javax.annotation.Nullable List arrayEnum) { + public void setArrayEnum(@jakarta.annotation.Nullable List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java index bb79f1d84203..ec0268437731 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -49,7 +49,7 @@ EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class EnumTest { /** * Gets or Sets enumString @@ -89,7 +89,7 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private EnumStringEnum enumString; /** @@ -130,7 +130,7 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private EnumStringRequiredEnum enumStringRequired; /** @@ -169,7 +169,7 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private EnumIntegerEnum enumInteger; /** @@ -208,7 +208,7 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER_ONLY = "enum_integer_only"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private EnumIntegerOnlyEnum enumIntegerOnly; /** @@ -247,29 +247,29 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OuterEnum outerEnum; public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OuterEnumInteger outerEnumInteger; public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; public EnumTest() { } - public EnumTest enumString(@javax.annotation.Nullable EnumStringEnum enumString) { + public EnumTest enumString(@jakarta.annotation.Nullable EnumStringEnum enumString) { this.enumString = enumString; return this; } @@ -278,7 +278,7 @@ public EnumTest enumString(@javax.annotation.Nullable EnumStringEnum enumString) * Get enumString * @return enumString */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EnumStringEnum getEnumString() { @@ -288,12 +288,12 @@ public EnumStringEnum getEnumString() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumString(@javax.annotation.Nullable EnumStringEnum enumString) { + public void setEnumString(@jakarta.annotation.Nullable EnumStringEnum enumString) { this.enumString = enumString; } - public EnumTest enumStringRequired(@javax.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { + public EnumTest enumStringRequired(@jakarta.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; return this; } @@ -302,7 +302,7 @@ public EnumTest enumStringRequired(@javax.annotation.Nonnull EnumStringRequiredE * Get enumStringRequired * @return enumStringRequired */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public EnumStringRequiredEnum getEnumStringRequired() { @@ -312,12 +312,12 @@ public EnumStringRequiredEnum getEnumStringRequired() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEnumStringRequired(@javax.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { + public void setEnumStringRequired(@jakarta.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteger) { + public EnumTest enumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } @@ -326,7 +326,7 @@ public EnumTest enumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteg * Get enumInteger * @return enumInteger */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EnumIntegerEnum getEnumInteger() { @@ -336,12 +336,12 @@ public EnumIntegerEnum getEnumInteger() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteger) { + public void setEnumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - public EnumTest enumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { + public EnumTest enumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { this.enumIntegerOnly = enumIntegerOnly; return this; } @@ -350,7 +350,7 @@ public EnumTest enumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum e * Get enumIntegerOnly * @return enumIntegerOnly */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EnumIntegerOnlyEnum getEnumIntegerOnly() { @@ -360,12 +360,12 @@ public EnumIntegerOnlyEnum getEnumIntegerOnly() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { + public void setEnumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { this.enumIntegerOnly = enumIntegerOnly; } - public EnumTest enumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) { + public EnumTest enumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } @@ -374,7 +374,7 @@ public EnumTest enumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) * Get enumNumber * @return enumNumber */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EnumNumberEnum getEnumNumber() { @@ -384,12 +384,12 @@ public EnumNumberEnum getEnumNumber() { @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) { + public void setEnumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(@javax.annotation.Nullable OuterEnum outerEnum) { + public EnumTest outerEnum(@jakarta.annotation.Nullable OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } @@ -398,7 +398,7 @@ public EnumTest outerEnum(@javax.annotation.Nullable OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OuterEnum getOuterEnum() { @@ -408,12 +408,12 @@ public OuterEnum getOuterEnum() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnum(@javax.annotation.Nullable OuterEnum outerEnum) { + public void setOuterEnum(@jakarta.annotation.Nullable OuterEnum outerEnum) { this.outerEnum = outerEnum; } - public EnumTest outerEnumInteger(@javax.annotation.Nullable OuterEnumInteger outerEnumInteger) { + public EnumTest outerEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; return this; } @@ -422,7 +422,7 @@ public EnumTest outerEnumInteger(@javax.annotation.Nullable OuterEnumInteger out * Get outerEnumInteger * @return outerEnumInteger */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OuterEnumInteger getOuterEnumInteger() { @@ -432,12 +432,12 @@ public OuterEnumInteger getOuterEnumInteger() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnumInteger(@javax.annotation.Nullable OuterEnumInteger outerEnumInteger) { + public void setOuterEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { + public EnumTest outerEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; return this; } @@ -446,7 +446,7 @@ public EnumTest outerEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaul * Get outerEnumDefaultValue * @return outerEnumDefaultValue */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OuterEnumDefaultValue getOuterEnumDefaultValue() { @@ -456,12 +456,12 @@ public OuterEnumDefaultValue getOuterEnumDefaultValue() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { + public void setOuterEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + public EnumTest outerEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; return this; } @@ -470,7 +470,7 @@ public EnumTest outerEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnu * Get outerEnumIntegerDefaultValue * @return outerEnumIntegerDefaultValue */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { @@ -480,7 +480,7 @@ public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + public void setOuterEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 3471b6d42b0c..5c0888966327 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -37,20 +37,20 @@ EquilateralTriangle.JSON_PROPERTY_SHAPE_TYPE, EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class EquilateralTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String triangleType; public EquilateralTriangle() { } - public EquilateralTriangle shapeType(@javax.annotation.Nonnull String shapeType) { + public EquilateralTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; return this; } @@ -59,7 +59,7 @@ public EquilateralTriangle shapeType(@javax.annotation.Nonnull String shapeType) * Get shapeType * @return shapeType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getShapeType() { @@ -69,12 +69,12 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(@javax.annotation.Nonnull String shapeType) { + public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } - public EquilateralTriangle triangleType(@javax.annotation.Nonnull String triangleType) { + public EquilateralTriangle triangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; return this; } @@ -83,7 +83,7 @@ public EquilateralTriangle triangleType(@javax.annotation.Nonnull String triangl * Get triangleType * @return triangleType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTriangleType() { @@ -93,7 +93,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 95492fd784e6..1bc494ada739 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -41,20 +41,20 @@ FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID, FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class FakeBigDecimalMap200Response { public static final String JSON_PROPERTY_SOME_ID = "someId"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal someId; public static final String JSON_PROPERTY_SOME_MAP = "someMap"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map someMap = new HashMap<>(); public FakeBigDecimalMap200Response() { } - public FakeBigDecimalMap200Response someId(@javax.annotation.Nullable BigDecimal someId) { + public FakeBigDecimalMap200Response someId(@jakarta.annotation.Nullable BigDecimal someId) { this.someId = someId; return this; } @@ -63,7 +63,7 @@ public FakeBigDecimalMap200Response someId(@javax.annotation.Nullable BigDecimal * Get someId * @return someId */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOME_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getSomeId() { @@ -73,12 +73,12 @@ public BigDecimal getSomeId() { @JsonProperty(value = JSON_PROPERTY_SOME_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSomeId(@javax.annotation.Nullable BigDecimal someId) { + public void setSomeId(@jakarta.annotation.Nullable BigDecimal someId) { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(@javax.annotation.Nullable Map someMap) { + public FakeBigDecimalMap200Response someMap(@jakarta.annotation.Nullable Map someMap) { this.someMap = someMap; return this; } @@ -95,7 +95,7 @@ public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMa * Get someMap * @return someMap */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOME_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getSomeMap() { @@ -105,7 +105,7 @@ public Map getSomeMap() { @JsonProperty(value = JSON_PROPERTY_SOME_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSomeMap(@javax.annotation.Nullable Map someMap) { + public void setSomeMap(@jakarta.annotation.Nullable Map someMap) { this.someMap = someMap; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e9f27418e886..b1ff615eb7d0 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -40,20 +40,20 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List files = new ArrayList<>(); public FileSchemaTestClass() { } - public FileSchemaTestClass _file(@javax.annotation.Nullable ModelFile _file) { + public FileSchemaTestClass _file(@jakarta.annotation.Nullable ModelFile _file) { this._file = _file; return this; } @@ -62,7 +62,7 @@ public FileSchemaTestClass _file(@javax.annotation.Nullable ModelFile _file) { * Get _file * @return _file */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public ModelFile getFile() { @@ -72,12 +72,12 @@ public ModelFile getFile() { @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFile(@javax.annotation.Nullable ModelFile _file) { + public void setFile(@jakarta.annotation.Nullable ModelFile _file) { this._file = _file; } - public FileSchemaTestClass files(@javax.annotation.Nullable List files) { + public FileSchemaTestClass files(@jakarta.annotation.Nullable List files) { this.files = files; return this; } @@ -94,7 +94,7 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { * Get files * @return files */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getFiles() { @@ -104,7 +104,7 @@ public List getFiles() { @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { + public void setFiles(@jakarta.annotation.Nullable List files) { this.files = files; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java index 390c46aa828d..748bed4966a9 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ Foo.JSON_PROPERTY_BAR }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String bar = "bar"; public Foo() { } - public Foo bar(@javax.annotation.Nullable String bar) { + public Foo bar(@jakarta.annotation.Nullable String bar) { this.bar = bar; return this; } @@ -54,7 +54,7 @@ public Foo bar(@javax.annotation.Nullable String bar) { * Get bar * @return bar */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getBar() { @@ -64,7 +64,7 @@ public String getBar() { @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBar(@javax.annotation.Nullable String bar) { + public void setBar(@jakarta.annotation.Nullable String bar) { this.bar = bar; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 79a7f646729f..e74f53cc28ec 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -38,16 +38,16 @@ @JsonPropertyOrder({ FooGetDefaultResponse.JSON_PROPERTY_STRING }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Foo string; public FooGetDefaultResponse() { } - public FooGetDefaultResponse string(@javax.annotation.Nullable Foo string) { + public FooGetDefaultResponse string(@jakarta.annotation.Nullable Foo string) { this.string = string; return this; } @@ -56,7 +56,7 @@ public FooGetDefaultResponse string(@javax.annotation.Nullable Foo string) { * Get string * @return string */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Foo getString() { @@ -66,7 +66,7 @@ public Foo getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setString(@javax.annotation.Nullable Foo string) { + public void setString(@jakarta.annotation.Nullable Foo string) { this.string = string; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java index b730e4859623..7ef86834185c 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -57,76 +57,76 @@ FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Double _double; public static final String JSON_PROPERTY_DECIMAL = "decimal"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal decimal; public static final String JSON_PROPERTY_STRING = "string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String string; public static final String JSON_PROPERTY_BYTE = "byte"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private File binary; public static final String JSON_PROPERTY_DATE = "date"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String password; public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String patternWithDigits; public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String patternWithDigitsAndDelimiter; public FormatTest() { } - public FormatTest integer(@javax.annotation.Nullable Integer integer) { + public FormatTest integer(@jakarta.annotation.Nullable Integer integer) { this.integer = integer; return this; } @@ -137,7 +137,7 @@ public FormatTest integer(@javax.annotation.Nullable Integer integer) { * maximum: 100 * @return integer */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getInteger() { @@ -147,12 +147,12 @@ public Integer getInteger() { @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInteger(@javax.annotation.Nullable Integer integer) { + public void setInteger(@jakarta.annotation.Nullable Integer integer) { this.integer = integer; } - public FormatTest int32(@javax.annotation.Nullable Integer int32) { + public FormatTest int32(@jakarta.annotation.Nullable Integer int32) { this.int32 = int32; return this; } @@ -163,7 +163,7 @@ public FormatTest int32(@javax.annotation.Nullable Integer int32) { * maximum: 200 * @return int32 */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getInt32() { @@ -173,12 +173,12 @@ public Integer getInt32() { @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt32(@javax.annotation.Nullable Integer int32) { + public void setInt32(@jakarta.annotation.Nullable Integer int32) { this.int32 = int32; } - public FormatTest int64(@javax.annotation.Nullable Long int64) { + public FormatTest int64(@jakarta.annotation.Nullable Long int64) { this.int64 = int64; return this; } @@ -187,7 +187,7 @@ public FormatTest int64(@javax.annotation.Nullable Long int64) { * Get int64 * @return int64 */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getInt64() { @@ -197,12 +197,12 @@ public Long getInt64() { @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt64(@javax.annotation.Nullable Long int64) { + public void setInt64(@jakarta.annotation.Nullable Long int64) { this.int64 = int64; } - public FormatTest number(@javax.annotation.Nonnull BigDecimal number) { + public FormatTest number(@jakarta.annotation.Nonnull BigDecimal number) { this.number = number; return this; } @@ -213,7 +213,7 @@ public FormatTest number(@javax.annotation.Nonnull BigDecimal number) { * maximum: 543.2 * @return number */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public BigDecimal getNumber() { @@ -223,12 +223,12 @@ public BigDecimal getNumber() { @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumber(@javax.annotation.Nonnull BigDecimal number) { + public void setNumber(@jakarta.annotation.Nonnull BigDecimal number) { this.number = number; } - public FormatTest _float(@javax.annotation.Nullable Float _float) { + public FormatTest _float(@jakarta.annotation.Nullable Float _float) { this._float = _float; return this; } @@ -239,7 +239,7 @@ public FormatTest _float(@javax.annotation.Nullable Float _float) { * maximum: 987.6 * @return _float */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Float getFloat() { @@ -249,12 +249,12 @@ public Float getFloat() { @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFloat(@javax.annotation.Nullable Float _float) { + public void setFloat(@jakarta.annotation.Nullable Float _float) { this._float = _float; } - public FormatTest _double(@javax.annotation.Nullable Double _double) { + public FormatTest _double(@jakarta.annotation.Nullable Double _double) { this._double = _double; return this; } @@ -265,7 +265,7 @@ public FormatTest _double(@javax.annotation.Nullable Double _double) { * maximum: 123.4 * @return _double */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Double getDouble() { @@ -275,12 +275,12 @@ public Double getDouble() { @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDouble(@javax.annotation.Nullable Double _double) { + public void setDouble(@jakarta.annotation.Nullable Double _double) { this._double = _double; } - public FormatTest decimal(@javax.annotation.Nullable BigDecimal decimal) { + public FormatTest decimal(@jakarta.annotation.Nullable BigDecimal decimal) { this.decimal = decimal; return this; } @@ -289,7 +289,7 @@ public FormatTest decimal(@javax.annotation.Nullable BigDecimal decimal) { * Get decimal * @return decimal */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getDecimal() { @@ -299,12 +299,12 @@ public BigDecimal getDecimal() { @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDecimal(@javax.annotation.Nullable BigDecimal decimal) { + public void setDecimal(@jakarta.annotation.Nullable BigDecimal decimal) { this.decimal = decimal; } - public FormatTest string(@javax.annotation.Nullable String string) { + public FormatTest string(@jakarta.annotation.Nullable String string) { this.string = string; return this; } @@ -313,7 +313,7 @@ public FormatTest string(@javax.annotation.Nullable String string) { * Get string * @return string */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getString() { @@ -323,12 +323,12 @@ public String getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setString(@javax.annotation.Nullable String string) { + public void setString(@jakarta.annotation.Nullable String string) { this.string = string; } - public FormatTest _byte(@javax.annotation.Nonnull byte[] _byte) { + public FormatTest _byte(@jakarta.annotation.Nonnull byte[] _byte) { this._byte = _byte; return this; } @@ -337,7 +337,7 @@ public FormatTest _byte(@javax.annotation.Nonnull byte[] _byte) { * Get _byte * @return _byte */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public byte[] getByte() { @@ -347,12 +347,12 @@ public byte[] getByte() { @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setByte(@javax.annotation.Nonnull byte[] _byte) { + public void setByte(@jakarta.annotation.Nonnull byte[] _byte) { this._byte = _byte; } - public FormatTest binary(@javax.annotation.Nullable File binary) { + public FormatTest binary(@jakarta.annotation.Nullable File binary) { this.binary = binary; return this; } @@ -361,7 +361,7 @@ public FormatTest binary(@javax.annotation.Nullable File binary) { * Get binary * @return binary */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public File getBinary() { @@ -371,12 +371,12 @@ public File getBinary() { @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBinary(@javax.annotation.Nullable File binary) { + public void setBinary(@jakarta.annotation.Nullable File binary) { this.binary = binary; } - public FormatTest date(@javax.annotation.Nonnull LocalDate date) { + public FormatTest date(@jakarta.annotation.Nonnull LocalDate date) { this.date = date; return this; } @@ -385,7 +385,7 @@ public FormatTest date(@javax.annotation.Nonnull LocalDate date) { * Get date * @return date */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public LocalDate getDate() { @@ -395,12 +395,12 @@ public LocalDate getDate() { @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDate(@javax.annotation.Nonnull LocalDate date) { + public void setDate(@jakarta.annotation.Nonnull LocalDate date) { this.date = date; } - public FormatTest dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + public FormatTest dateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } @@ -409,7 +409,7 @@ public FormatTest dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OffsetDateTime getDateTime() { @@ -419,12 +419,12 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + public void setDateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } - public FormatTest uuid(@javax.annotation.Nullable UUID uuid) { + public FormatTest uuid(@jakarta.annotation.Nullable UUID uuid) { this.uuid = uuid; return this; } @@ -433,7 +433,7 @@ public FormatTest uuid(@javax.annotation.Nullable UUID uuid) { * Get uuid * @return uuid */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public UUID getUuid() { @@ -443,12 +443,12 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(@javax.annotation.Nullable UUID uuid) { + public void setUuid(@jakarta.annotation.Nullable UUID uuid) { this.uuid = uuid; } - public FormatTest password(@javax.annotation.Nonnull String password) { + public FormatTest password(@jakarta.annotation.Nonnull String password) { this.password = password; return this; } @@ -457,7 +457,7 @@ public FormatTest password(@javax.annotation.Nonnull String password) { * Get password * @return password */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getPassword() { @@ -467,12 +467,12 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPassword(@javax.annotation.Nonnull String password) { + public void setPassword(@jakarta.annotation.Nonnull String password) { this.password = password; } - public FormatTest patternWithDigits(@javax.annotation.Nullable String patternWithDigits) { + public FormatTest patternWithDigits(@jakarta.annotation.Nullable String patternWithDigits) { this.patternWithDigits = patternWithDigits; return this; } @@ -481,7 +481,7 @@ public FormatTest patternWithDigits(@javax.annotation.Nullable String patternWit * A string that is a 10 digit number. Can have leading zeros. * @return patternWithDigits */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPatternWithDigits() { @@ -491,12 +491,12 @@ public String getPatternWithDigits() { @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPatternWithDigits(@javax.annotation.Nullable String patternWithDigits) { + public void setPatternWithDigits(@jakarta.annotation.Nullable String patternWithDigits) { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(@javax.annotation.Nullable String patternWithDigitsAndDelimiter) { + public FormatTest patternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; return this; } @@ -505,7 +505,7 @@ public FormatTest patternWithDigitsAndDelimiter(@javax.annotation.Nullable Strin * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. * @return patternWithDigitsAndDelimiter */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPatternWithDigitsAndDelimiter() { @@ -515,7 +515,7 @@ public String getPatternWithDigitsAndDelimiter() { @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String patternWithDigitsAndDelimiter) { + public void setPatternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java index ef58145880d7..ee58961181a2 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java @@ -55,7 +55,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = Fruit.FruitDeserializer.class) @JsonSerialize(using = Fruit.FruitSerializer.class) public class Fruit extends AbstractOpenApiSchema { @@ -94,19 +94,27 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack JsonToken token = tree.asToken(); // deserialize Apple try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Apple.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -120,19 +128,27 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack // deserialize Banana try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Banana.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -169,7 +185,7 @@ public Fruit() { } public Fruit(Apple o) { - super("oneOf", Boolean.FALSE); + super("oneOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java new file mode 100644 index 000000000000..79f7b00ddb0d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java @@ -0,0 +1,437 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.SerializationContext; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = FruitOrFruits.FruitOrFruitsDeserializer.class) +@JsonSerialize(using = FruitOrFruits.FruitOrFruitsSerializer.class) +public class FruitOrFruits extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FruitOrFruits.class.getName()); + + public static class FruitOrFruitsSerializer extends StdSerializer { + public FruitOrFruitsSerializer(Class t) { + super(t); + } + + public FruitOrFruitsSerializer() { + this(null); + } + + @Override + public void serialize(FruitOrFruits value, JsonGenerator jgen, SerializationContext serializationContext) throws JacksonException { + serializationContext.writeValue(jgen, value.getActualInstance()); + } + } + + public static class FruitOrFruitsDeserializer extends StdDeserializer { + public FruitOrFruitsDeserializer() { + this(FruitOrFruits.class); + } + + public FruitOrFruitsDeserializer(Class vc) { + super(vc); + } + + @Override + public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = ctxt.readTree(jp); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.asToken(); + // deserialize Apple + try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + // 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.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + // 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); + } + + // deserialize List + try { + final tools.jackson.core.type.TypeReference> candidateRef = new tools.jackson.core.type.TypeReference>() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + // 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 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + // deserialize List + try { + final tools.jackson.core.type.TypeReference> candidateRef = new tools.jackson.core.type.TypeReference>() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + // 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 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + if (match == 1) { + FruitOrFruits ret = new FruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for FruitOrFruits: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public FruitOrFruits getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "FruitOrFruits cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public FruitOrFruits() { + super("oneOf", Boolean.FALSE); + } + + public FruitOrFruits(Apple o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + + public FruitOrFruits(Banana o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + + public FruitOrFruits(java.util.List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("List", java.util.List.class); + schemas.put("Banana", Banana.class); + schemas.put("List", java.util.List.class); + JSON.registerDescendants(FruitOrFruits.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return FruitOrFruits.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Apple, Banana, List<Apple>, List<Banana> + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, List, List"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana, List<Apple>, List<Banana> + * + * @return The actual instance (Apple, Banana, List<Apple>, List<Banana>) + */ + @Override + public Object getActualInstance() { + return super.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` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Apple>`. If the actual instance is not `List<Apple>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Apple>` + * @throws ClassCastException if the instance is not `List<Apple>` + */ + public List getListApple() throws ClassCastException { + return (List)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` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Banana>`. If the actual instance is not `List<Banana>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Banana>` + * @throws ClassCastException if the instance is not `List<Banana>` + */ + public List getListBanana() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Apple) { + if (getActualInstance() != null) { + joiner.add(((Apple)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof List) { + if (getActualInstance() != null) { + List items = (List) getActualInstance(); + for (int i = 0; i < items.size(); i++) { + Apple item = items.get(i); + if (item != null) { + joiner.add(item.toUrlQueryString(String.format(java.util.Locale.ROOT, "%sone_of_1%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + return joiner.toString(); + } + if (getActualInstance() instanceof Banana) { + if (getActualInstance() != null) { + joiner.add(((Banana)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java index 1142650d73dc..f4bd680da8bb 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -55,7 +55,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = FruitReq.FruitReqDeserializer.class) @JsonSerialize(using = FruitReq.FruitReqSerializer.class) public class FruitReq extends AbstractOpenApiSchema { @@ -94,19 +94,27 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws J JsonToken token = tree.asToken(); // deserialize AppleReq try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, AppleReq.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -120,19 +128,27 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws J // deserialize BananaReq try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, BananaReq.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java index 09d8fadecf80..13eaa3aa2d5f 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -53,8 +53,8 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") -@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = GmFruit.GmFruitDeserializer.class) @JsonSerialize(using = GmFruit.GmFruitSerializer.class) public class GmFruit extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(GmFruit.class.getName()); @@ -90,7 +90,8 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Ja Object deserialized = null; // deserialize Apple try { - deserialized = ctxt.readTreeAsValue(tree, Apple.class); + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -101,7 +102,8 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Ja // deserialize Banana try { - deserialized = ctxt.readTreeAsValue(tree, Banana.class); + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -130,7 +132,7 @@ public GmFruit() { } public GmFruit(Apple o) { - super("anyOf", Boolean.FALSE); + super("anyOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java new file mode 100644 index 000000000000..4a4dcc5c7ad4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java @@ -0,0 +1,315 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.SerializationContext; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = GmFruitOrFruits.GmFruitOrFruitsDeserializer.class) +@JsonSerialize(using = GmFruitOrFruits.GmFruitOrFruitsSerializer.class) +public class GmFruitOrFruits extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GmFruitOrFruits.class.getName()); + + public static class GmFruitOrFruitsSerializer extends StdSerializer { + public GmFruitOrFruitsSerializer(Class t) { + super(t); + } + + public GmFruitOrFruitsSerializer() { + this(null); + } + + @Override + public void serialize(GmFruitOrFruits value, JsonGenerator jgen, SerializationContext serializationContext) throws JacksonException { + serializationContext.writeValue(jgen, value.getActualInstance()); + } + } + + public static class GmFruitOrFruitsDeserializer extends StdDeserializer { + public GmFruitOrFruitsDeserializer() { + this(GmFruitOrFruits.class); + } + + public GmFruitOrFruitsDeserializer(Class vc) { + super(vc); + } + + @Override + public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = ctxt.readTree(jp); + + Object deserialized = null; + // deserialize Apple + try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize Banana + try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize List + try { + final tools.jackson.core.type.TypeReference> candidateRef = new tools.jackson.core.type.TypeReference>() {}; + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize List + try { + final tools.jackson.core.type.TypeReference> candidateRef = new tools.jackson.core.type.TypeReference>() {}; + deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + throw DatabindException.from(jp, "Failed deserialization for GmFruitOrFruits: no match found"); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public GmFruitOrFruits getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "GmFruitOrFruits cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public GmFruitOrFruits() { + super("anyOf", Boolean.FALSE); + } + + public GmFruitOrFruits(Apple o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + + public GmFruitOrFruits(Banana o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + + public GmFruitOrFruits(java.util.List o) { + this(); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("List", java.util.List.class); + schemas.put("Banana", Banana.class); + schemas.put("List", java.util.List.class); + JSON.registerDescendants(GmFruitOrFruits.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return GmFruitOrFruits.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Apple, Banana, List<Apple>, List<Banana> + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, List, List"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana, List<Apple>, List<Banana> + * + * @return The actual instance (Apple, Banana, List<Apple>, List<Banana>) + */ + @Override + public Object getActualInstance() { + return super.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` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Apple>`. If the actual instance is not `List<Apple>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Apple>` + * @throws ClassCastException if the instance is not `List<Apple>` + */ + public List getListApple() throws ClassCastException { + return (List)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` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Banana>`. If the actual instance is not `List<Banana>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Banana>` + * @throws ClassCastException if the instance is not `List<Banana>` + */ + public List getListBanana() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index ded97334dfc0..0b5ab1ea54f5 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -40,7 +40,7 @@ @JsonPropertyOrder({ GrandparentAnimal.JSON_PROPERTY_PET_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonIgnoreProperties( value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization allowSetters = true // allows the pet_type to be set during deserialization @@ -53,13 +53,13 @@ public class GrandparentAnimal { public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String petType; public GrandparentAnimal() { } - public GrandparentAnimal petType(@javax.annotation.Nonnull String petType) { + public GrandparentAnimal petType(@jakarta.annotation.Nonnull String petType) { this.petType = petType; return this; } @@ -68,7 +68,7 @@ public GrandparentAnimal petType(@javax.annotation.Nonnull String petType) { * Get petType * @return petType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getPetType() { @@ -78,7 +78,7 @@ public String getPetType() { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPetType(@javax.annotation.Nonnull String petType) { + public void setPetType(@jakarta.annotation.Nonnull String petType) { this.petType = petType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ed95c2165e7f..39c313effa45 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -38,14 +38,14 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String bar; public static final String JSON_PROPERTY_FOO = "foo"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String foo; public HasOnlyReadOnly() { @@ -65,7 +65,7 @@ public HasOnlyReadOnly( * Get bar * @return bar */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getBar() { @@ -79,7 +79,7 @@ public String getBar() { * Get foo * @return foo */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getFoo() { diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 82f723e02933..5044d266c343 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String nullableMessage; public HealthCheckResult() { } - public HealthCheckResult nullableMessage(@javax.annotation.Nullable String nullableMessage) { + public HealthCheckResult nullableMessage(@jakarta.annotation.Nullable String nullableMessage) { this.nullableMessage = nullableMessage; return this; } @@ -54,7 +54,7 @@ public HealthCheckResult nullableMessage(@javax.annotation.Nullable String nulla * Get nullableMessage * @return nullableMessage */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NULLABLE_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getNullableMessage() { @@ -64,7 +64,7 @@ public String getNullableMessage() { @JsonProperty(value = JSON_PROPERTY_NULLABLE_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNullableMessage(@javax.annotation.Nullable String nullableMessage) { + public void setNullableMessage(@jakarta.annotation.Nullable String nullableMessage) { this.nullableMessage = nullableMessage; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index f756a896b817..f1a1b6fa55b7 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -37,20 +37,20 @@ IsoscelesTriangle.JSON_PROPERTY_SHAPE_TYPE, IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class IsoscelesTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String triangleType; public IsoscelesTriangle() { } - public IsoscelesTriangle shapeType(@javax.annotation.Nonnull String shapeType) { + public IsoscelesTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; return this; } @@ -59,7 +59,7 @@ public IsoscelesTriangle shapeType(@javax.annotation.Nonnull String shapeType) { * Get shapeType * @return shapeType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getShapeType() { @@ -69,12 +69,12 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(@javax.annotation.Nonnull String shapeType) { + public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } - public IsoscelesTriangle triangleType(@javax.annotation.Nonnull String triangleType) { + public IsoscelesTriangle triangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; return this; } @@ -83,7 +83,7 @@ public IsoscelesTriangle triangleType(@javax.annotation.Nonnull String triangleT * Get triangleType * @return triangleType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTriangleType() { @@ -93,7 +93,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java index 7550d70d6a6c..4bec4e00c970 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java @@ -58,7 +58,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = Mammal.MammalDeserializer.class) @JsonSerialize(using = Mammal.MammalSerializer.class) public class Mammal extends AbstractOpenApiSchema { @@ -97,19 +97,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws Jac JsonToken token = tree.asToken(); // deserialize Pig try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Pig.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -123,19 +131,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws Jac // deserialize Whale try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Whale.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -149,19 +165,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws Jac // deserialize Zebra try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Zebra.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -197,25 +221,25 @@ public Mammal() { super("oneOf", Boolean.FALSE); } - public Mammal(Pig o) { + public Mammal(Whale o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Mammal(Whale o) { + public Mammal(Zebra o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Mammal(Zebra o) { + public Mammal(Pig o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Pig", Pig.class); schemas.put("Whale", Whale.class); schemas.put("Zebra", Zebra.class); + schemas.put("Pig", Pig.class); JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -241,17 +265,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; } @@ -270,17 +294,6 @@ public Object getActualInstance() { return 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(); - } - /** * Get the actual instance of `Whale`. If the actual instance is not `Whale`, * the ClassCastException will be thrown. @@ -303,6 +316,17 @@ 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-jackson3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MapTest.java index 1493bc651335..e54492be847e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MapTest.java @@ -41,10 +41,10 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map> mapMapOfString = new HashMap<>(); /** @@ -83,21 +83,21 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map mapOfEnumString = new HashMap<>(); public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map directMap = new HashMap<>(); public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map indirectMap = new HashMap<>(); public MapTest() { } - public MapTest mapMapOfString(@javax.annotation.Nullable Map> mapMapOfString) { + public MapTest mapMapOfString(@jakarta.annotation.Nullable Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } @@ -114,7 +114,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map> getMapMapOfString() { @@ -124,12 +124,12 @@ public Map> getMapMapOfString() { @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapMapOfString(@javax.annotation.Nullable Map> mapMapOfString) { + public void setMapMapOfString(@jakarta.annotation.Nullable Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(@javax.annotation.Nullable Map mapOfEnumString) { + public MapTest mapOfEnumString(@jakarta.annotation.Nullable Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } @@ -146,7 +146,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getMapOfEnumString() { @@ -156,12 +156,12 @@ public Map getMapOfEnumString() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapOfEnumString(@javax.annotation.Nullable Map mapOfEnumString) { + public void setMapOfEnumString(@jakarta.annotation.Nullable Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(@javax.annotation.Nullable Map directMap) { + public MapTest directMap(@jakarta.annotation.Nullable Map directMap) { this.directMap = directMap; return this; } @@ -178,7 +178,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getDirectMap() { @@ -188,12 +188,12 @@ public Map getDirectMap() { @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDirectMap(@javax.annotation.Nullable Map directMap) { + public void setDirectMap(@jakarta.annotation.Nullable Map directMap) { this.directMap = directMap; } - public MapTest indirectMap(@javax.annotation.Nullable Map indirectMap) { + public MapTest indirectMap(@jakarta.annotation.Nullable Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -210,7 +210,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getIndirectMap() { @@ -220,7 +220,7 @@ public Map getIndirectMap() { @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndirectMap(@javax.annotation.Nullable Map indirectMap) { + public void setIndirectMap(@jakarta.annotation.Nullable Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5ec9f65fa66f..fb32442acb4e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,24 +43,24 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass() { } - public MixedPropertiesAndAdditionalPropertiesClass uuid(@javax.annotation.Nullable UUID uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(@jakarta.annotation.Nullable UUID uuid) { this.uuid = uuid; return this; } @@ -69,7 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@javax.annotation.Nullab * Get uuid * @return uuid */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public UUID getUuid() { @@ -79,12 +79,12 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(@javax.annotation.Nullable UUID uuid) { + public void setUuid(@jakarta.annotation.Nullable UUID uuid) { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + public MixedPropertiesAndAdditionalPropertiesClass dateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } @@ -93,7 +93,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@javax.annotation.Nu * Get dateTime * @return dateTime */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OffsetDateTime getDateTime() { @@ -103,12 +103,12 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + public void setDateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(@javax.annotation.Nullable Map map) { + public MixedPropertiesAndAdditionalPropertiesClass map(@jakarta.annotation.Nullable Map map) { this.map = map; return this; } @@ -125,7 +125,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getMap() { @@ -135,7 +135,7 @@ public Map getMap() { @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMap(@javax.annotation.Nullable Map map) { + public void setMap(@jakarta.annotation.Nullable Map map) { this.map = map; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java index 4752b3210d39..0413bff1eb30 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,20 +38,20 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String propertyClass; public Model200Response() { } - public Model200Response name(@javax.annotation.Nullable Integer name) { + public Model200Response name(@jakarta.annotation.Nullable Integer name) { this.name = name; return this; } @@ -60,7 +60,7 @@ public Model200Response name(@javax.annotation.Nullable Integer name) { * Get name * @return name */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getName() { @@ -70,12 +70,12 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable Integer name) { + public void setName(@jakarta.annotation.Nullable Integer name) { this.name = name; } - public Model200Response propertyClass(@javax.annotation.Nullable String propertyClass) { + public Model200Response propertyClass(@jakarta.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; return this; } @@ -84,7 +84,7 @@ public Model200Response propertyClass(@javax.annotation.Nullable String property * Get propertyClass * @return propertyClass */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPropertyClass() { @@ -94,7 +94,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { + public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d7b8de5735be..dfea53168dc3 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -39,24 +39,24 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String message; public ModelApiResponse() { } - public ModelApiResponse code(@javax.annotation.Nullable Integer code) { + public ModelApiResponse code(@jakarta.annotation.Nullable Integer code) { this.code = code; return this; } @@ -65,7 +65,7 @@ public ModelApiResponse code(@javax.annotation.Nullable Integer code) { * Get code * @return code */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getCode() { @@ -75,12 +75,12 @@ public Integer getCode() { @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCode(@javax.annotation.Nullable Integer code) { + public void setCode(@jakarta.annotation.Nullable Integer code) { this.code = code; } - public ModelApiResponse type(@javax.annotation.Nullable String type) { + public ModelApiResponse type(@jakarta.annotation.Nullable String type) { this.type = type; return this; } @@ -89,7 +89,7 @@ public ModelApiResponse type(@javax.annotation.Nullable String type) { * Get type * @return type */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getType() { @@ -99,12 +99,12 @@ public String getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { + public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } - public ModelApiResponse message(@javax.annotation.Nullable String message) { + public ModelApiResponse message(@jakarta.annotation.Nullable String message) { this.message = message; return this; } @@ -113,7 +113,7 @@ public ModelApiResponse message(@javax.annotation.Nullable String message) { * Get message * @return message */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getMessage() { @@ -123,7 +123,7 @@ public String getMessage() { @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { + public void setMessage(@jakarta.annotation.Nullable String message) { this.message = message; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java index 0a0bf1b4f57f..5146b4a4e1d2 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -37,16 +37,16 @@ @JsonPropertyOrder({ ModelFile.JSON_PROPERTY_SOURCE_U_R_I }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String sourceURI; public ModelFile() { } - public ModelFile sourceURI(@javax.annotation.Nullable String sourceURI) { + public ModelFile sourceURI(@jakarta.annotation.Nullable String sourceURI) { this.sourceURI = sourceURI; return this; } @@ -55,7 +55,7 @@ public ModelFile sourceURI(@javax.annotation.Nullable String sourceURI) { * Test capitalization * @return sourceURI */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getSourceURI() { @@ -65,7 +65,7 @@ public String getSourceURI() { @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceURI(@javax.annotation.Nullable String sourceURI) { + public void setSourceURI(@jakarta.annotation.Nullable String sourceURI) { this.sourceURI = sourceURI; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java index 756ac22ce3e6..61e8ba51da45 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java @@ -37,16 +37,16 @@ @JsonPropertyOrder({ ModelList.JSON_PROPERTY_123LIST }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String _123list; public ModelList() { } - public ModelList _123list(@javax.annotation.Nullable String _123list) { + public ModelList _123list(@jakarta.annotation.Nullable String _123list) { this._123list = _123list; return this; } @@ -55,7 +55,7 @@ public ModelList _123list(@javax.annotation.Nullable String _123list) { * Get _123list * @return _123list */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String get123list() { @@ -65,7 +65,7 @@ public String get123list() { @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set123list(@javax.annotation.Nullable String _123list) { + public void set123list(@jakarta.annotation.Nullable String _123list) { this._123list = _123list; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java index 1da8953b2a2a..524d09ab4094 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -37,16 +37,16 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer _return; public ModelReturn() { } - public ModelReturn _return(@javax.annotation.Nullable Integer _return) { + public ModelReturn _return(@jakarta.annotation.Nullable Integer _return) { this._return = _return; return this; } @@ -55,7 +55,7 @@ public ModelReturn _return(@javax.annotation.Nullable Integer _return) { * Get _return * @return _return */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getReturn() { @@ -65,7 +65,7 @@ public Integer getReturn() { @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReturn(@javax.annotation.Nullable Integer _return) { + public void setReturn(@jakarta.annotation.Nullable Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java index 3c7cb359a522..cedf53a554a1 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java @@ -39,22 +39,22 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Name { public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer _123number; public Name() { @@ -70,7 +70,7 @@ public Name( this._123number = _123number; } - public Name name(@javax.annotation.Nonnull Integer name) { + public Name name(@jakarta.annotation.Nonnull Integer name) { this.name = name; return this; } @@ -79,7 +79,7 @@ public Name name(@javax.annotation.Nonnull Integer name) { * Get name * @return name */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getName() { @@ -89,7 +89,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull Integer name) { + public void setName(@jakarta.annotation.Nonnull Integer name) { this.name = name; } @@ -98,7 +98,7 @@ public void setName(@javax.annotation.Nonnull Integer name) { * Get snakeCase * @return snakeCase */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getSnakeCase() { @@ -108,7 +108,7 @@ public Integer getSnakeCase() { - public Name property(@javax.annotation.Nullable String property) { + public Name property(@jakarta.annotation.Nullable String property) { this.property = property; return this; } @@ -117,7 +117,7 @@ public Name property(@javax.annotation.Nullable String property) { * Get property * @return property */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getProperty() { @@ -127,7 +127,7 @@ public String getProperty() { @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperty(@javax.annotation.Nullable String property) { + public void setProperty(@jakarta.annotation.Nullable String property) { this.property = property; } @@ -136,7 +136,7 @@ public void setProperty(@javax.annotation.Nullable String property) { * Get _123number * @return _123number */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer get123number() { diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java index d1f2be9b638d..716c8e4556c8 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -58,60 +58,60 @@ NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer integerProp; public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal numberProp; public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean booleanProp; public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String stringProp; public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private LocalDate dateProp; public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OffsetDateTime datetimeProp; public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List arrayNullableProp; public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List arrayAndItemsNullableProp; public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List arrayItemsNullable = new ArrayList<>(); public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map objectNullableProp; public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map objectAndItemsNullableProp; public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Map objectItemsNullable = new HashMap<>(); public NullableClass() { } - public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) { + public NullableClass integerProp(@jakarta.annotation.Nullable Integer integerProp) { this.integerProp = integerProp; return this; } @@ -120,7 +120,7 @@ public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) * Get integerProp * @return integerProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INTEGER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getIntegerProp() { @@ -130,12 +130,12 @@ public Integer getIntegerProp() { @JsonProperty(value = JSON_PROPERTY_INTEGER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIntegerProp(@javax.annotation.Nullable Integer integerProp) { + public void setIntegerProp(@jakarta.annotation.Nullable Integer integerProp) { this.integerProp = integerProp; } - public NullableClass numberProp(@javax.annotation.Nullable BigDecimal numberProp) { + public NullableClass numberProp(@jakarta.annotation.Nullable BigDecimal numberProp) { this.numberProp = numberProp; return this; } @@ -144,7 +144,7 @@ public NullableClass numberProp(@javax.annotation.Nullable BigDecimal numberProp * Get numberProp * @return numberProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NUMBER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getNumberProp() { @@ -154,12 +154,12 @@ public BigDecimal getNumberProp() { @JsonProperty(value = JSON_PROPERTY_NUMBER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumberProp(@javax.annotation.Nullable BigDecimal numberProp) { + public void setNumberProp(@jakarta.annotation.Nullable BigDecimal numberProp) { this.numberProp = numberProp; } - public NullableClass booleanProp(@javax.annotation.Nullable Boolean booleanProp) { + public NullableClass booleanProp(@jakarta.annotation.Nullable Boolean booleanProp) { this.booleanProp = booleanProp; return this; } @@ -168,7 +168,7 @@ public NullableClass booleanProp(@javax.annotation.Nullable Boolean booleanProp) * Get booleanProp * @return booleanProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BOOLEAN_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getBooleanProp() { @@ -178,12 +178,12 @@ public Boolean getBooleanProp() { @JsonProperty(value = JSON_PROPERTY_BOOLEAN_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBooleanProp(@javax.annotation.Nullable Boolean booleanProp) { + public void setBooleanProp(@jakarta.annotation.Nullable Boolean booleanProp) { this.booleanProp = booleanProp; } - public NullableClass stringProp(@javax.annotation.Nullable String stringProp) { + public NullableClass stringProp(@jakarta.annotation.Nullable String stringProp) { this.stringProp = stringProp; return this; } @@ -192,7 +192,7 @@ public NullableClass stringProp(@javax.annotation.Nullable String stringProp) { * Get stringProp * @return stringProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STRING_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getStringProp() { @@ -202,12 +202,12 @@ public String getStringProp() { @JsonProperty(value = JSON_PROPERTY_STRING_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStringProp(@javax.annotation.Nullable String stringProp) { + public void setStringProp(@jakarta.annotation.Nullable String stringProp) { this.stringProp = stringProp; } - public NullableClass dateProp(@javax.annotation.Nullable LocalDate dateProp) { + public NullableClass dateProp(@jakarta.annotation.Nullable LocalDate dateProp) { this.dateProp = dateProp; return this; } @@ -216,7 +216,7 @@ public NullableClass dateProp(@javax.annotation.Nullable LocalDate dateProp) { * Get dateProp * @return dateProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public LocalDate getDateProp() { @@ -226,12 +226,12 @@ public LocalDate getDateProp() { @JsonProperty(value = JSON_PROPERTY_DATE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDateProp(@javax.annotation.Nullable LocalDate dateProp) { + public void setDateProp(@jakarta.annotation.Nullable LocalDate dateProp) { this.dateProp = dateProp; } - public NullableClass datetimeProp(@javax.annotation.Nullable OffsetDateTime datetimeProp) { + public NullableClass datetimeProp(@jakarta.annotation.Nullable OffsetDateTime datetimeProp) { this.datetimeProp = datetimeProp; return this; } @@ -240,7 +240,7 @@ public NullableClass datetimeProp(@javax.annotation.Nullable OffsetDateTime date * Get datetimeProp * @return datetimeProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATETIME_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OffsetDateTime getDatetimeProp() { @@ -250,12 +250,12 @@ public OffsetDateTime getDatetimeProp() { @JsonProperty(value = JSON_PROPERTY_DATETIME_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDatetimeProp(@javax.annotation.Nullable OffsetDateTime datetimeProp) { + public void setDatetimeProp(@jakarta.annotation.Nullable OffsetDateTime datetimeProp) { this.datetimeProp = datetimeProp; } - public NullableClass arrayNullableProp(@javax.annotation.Nullable List arrayNullableProp) { + public NullableClass arrayNullableProp(@jakarta.annotation.Nullable List arrayNullableProp) { this.arrayNullableProp = arrayNullableProp; return this; } @@ -272,7 +272,7 @@ public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { * Get arrayNullableProp * @return arrayNullableProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getArrayNullableProp() { @@ -282,12 +282,12 @@ public List getArrayNullableProp() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayNullableProp(@javax.annotation.Nullable List arrayNullableProp) { + public void setArrayNullableProp(@jakarta.annotation.Nullable List arrayNullableProp) { this.arrayNullableProp = arrayNullableProp; } - public NullableClass arrayAndItemsNullableProp(@javax.annotation.Nullable List arrayAndItemsNullableProp) { + public NullableClass arrayAndItemsNullableProp(@jakarta.annotation.Nullable List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; return this; } @@ -304,7 +304,7 @@ public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullab * Get arrayAndItemsNullableProp * @return arrayAndItemsNullableProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getArrayAndItemsNullableProp() { @@ -314,12 +314,12 @@ public List getArrayAndItemsNullableProp() { @JsonProperty(value = JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayAndItemsNullableProp(@javax.annotation.Nullable List arrayAndItemsNullableProp) { + public void setArrayAndItemsNullableProp(@jakarta.annotation.Nullable List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; } - public NullableClass arrayItemsNullable(@javax.annotation.Nullable List arrayItemsNullable) { + public NullableClass arrayItemsNullable(@jakarta.annotation.Nullable List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; return this; } @@ -336,7 +336,7 @@ public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { * Get arrayItemsNullable * @return arrayItemsNullable */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getArrayItemsNullable() { @@ -346,12 +346,12 @@ public List getArrayItemsNullable() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayItemsNullable(@javax.annotation.Nullable List arrayItemsNullable) { + public void setArrayItemsNullable(@jakarta.annotation.Nullable List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(@javax.annotation.Nullable Map objectNullableProp) { + public NullableClass objectNullableProp(@jakarta.annotation.Nullable Map objectNullableProp) { this.objectNullableProp = objectNullableProp; return this; } @@ -368,7 +368,7 @@ public NullableClass putObjectNullablePropItem(String key, Object objectNullable * Get objectNullableProp * @return objectNullableProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Map getObjectNullableProp() { @@ -378,12 +378,12 @@ public Map getObjectNullableProp() { @JsonProperty(value = JSON_PROPERTY_OBJECT_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectNullableProp(@javax.annotation.Nullable Map objectNullableProp) { + public void setObjectNullableProp(@jakarta.annotation.Nullable Map objectNullableProp) { this.objectNullableProp = objectNullableProp; } - public NullableClass objectAndItemsNullableProp(@javax.annotation.Nullable Map objectAndItemsNullableProp) { + public NullableClass objectAndItemsNullableProp(@jakarta.annotation.Nullable Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = objectAndItemsNullableProp; return this; } @@ -400,7 +400,7 @@ public NullableClass putObjectAndItemsNullablePropItem(String key, Object object * Get objectAndItemsNullableProp * @return objectAndItemsNullableProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) public Map getObjectAndItemsNullableProp() { @@ -410,12 +410,12 @@ public Map getObjectAndItemsNullableProp() { @JsonProperty(value = JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectAndItemsNullableProp(@javax.annotation.Nullable Map objectAndItemsNullableProp) { + public void setObjectAndItemsNullableProp(@jakarta.annotation.Nullable Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = objectAndItemsNullableProp; } - public NullableClass objectItemsNullable(@javax.annotation.Nullable Map objectItemsNullable) { + public NullableClass objectItemsNullable(@jakarta.annotation.Nullable Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; return this; } @@ -432,7 +432,7 @@ public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNu * Get objectItemsNullable * @return objectItemsNullable */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) public Map getObjectItemsNullable() { @@ -442,7 +442,7 @@ public Map getObjectItemsNullable() { @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectItemsNullable(@javax.annotation.Nullable Map objectItemsNullable) { + public void setObjectItemsNullable(@jakarta.annotation.Nullable Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java index ee58beebfd5e..74284393cbc5 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -56,7 +56,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = NullableShape.NullableShapeDeserializer.class) @JsonSerialize(using = NullableShape.NullableShapeSerializer.class) public class NullableShape extends AbstractOpenApiSchema { @@ -95,20 +95,28 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr JsonToken token = tree.asToken(); // deserialize Quadrilateral try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Quadrilateral.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -122,20 +130,28 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize Triangle try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Triangle.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -171,19 +187,19 @@ public NullableShape() { super("oneOf", Boolean.TRUE); } - public NullableShape(Quadrilateral o) { - super("oneOf", Boolean.TRUE); + public NullableShape(Triangle o) { + super("oneOf", Boolean.FALSE); setActualInstance(o); } - public NullableShape(Triangle o) { - super("oneOf", Boolean.TRUE); + public NullableShape(Quadrilateral o) { + super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -213,12 +229,12 @@ public void setActualInstance(Object instance) { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -238,25 +254,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java index e950621661f5..83ca33a19644 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -37,16 +37,16 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal justNumber; public NumberOnly() { } - public NumberOnly justNumber(@javax.annotation.Nullable BigDecimal justNumber) { + public NumberOnly justNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { this.justNumber = justNumber; return this; } @@ -55,7 +55,7 @@ public NumberOnly justNumber(@javax.annotation.Nullable BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getJustNumber() { @@ -65,7 +65,7 @@ public BigDecimal getJustNumber() { @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { + public void setJustNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 9517cbf0660a..cc75b7c2da6c 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -43,28 +43,28 @@ ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, ObjectWithDeprecatedFields.JSON_PROPERTY_BARS }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_UUID = "uuid"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String uuid; public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal id; public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List bars = new ArrayList<>(); public ObjectWithDeprecatedFields() { } - public ObjectWithDeprecatedFields uuid(@javax.annotation.Nullable String uuid) { + public ObjectWithDeprecatedFields uuid(@jakarta.annotation.Nullable String uuid) { this.uuid = uuid; return this; } @@ -73,7 +73,7 @@ public ObjectWithDeprecatedFields uuid(@javax.annotation.Nullable String uuid) { * Get uuid * @return uuid */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getUuid() { @@ -83,12 +83,12 @@ public String getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(@javax.annotation.Nullable String uuid) { + public void setUuid(@jakarta.annotation.Nullable String uuid) { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(@javax.annotation.Nullable BigDecimal id) { + public ObjectWithDeprecatedFields id(@jakarta.annotation.Nullable BigDecimal id) { this.id = id; return this; } @@ -99,7 +99,7 @@ public ObjectWithDeprecatedFields id(@javax.annotation.Nullable BigDecimal id) { * @deprecated */ @Deprecated - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getId() { @@ -109,12 +109,12 @@ public BigDecimal getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable BigDecimal id) { + public void setId(@jakarta.annotation.Nullable BigDecimal id) { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(@javax.annotation.Nullable DeprecatedObject deprecatedRef) { + public ObjectWithDeprecatedFields deprecatedRef(@jakarta.annotation.Nullable DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; return this; } @@ -125,7 +125,7 @@ public ObjectWithDeprecatedFields deprecatedRef(@javax.annotation.Nullable Depre * @deprecated */ @Deprecated - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public DeprecatedObject getDeprecatedRef() { @@ -135,12 +135,12 @@ public DeprecatedObject getDeprecatedRef() { @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeprecatedRef(@javax.annotation.Nullable DeprecatedObject deprecatedRef) { + public void setDeprecatedRef(@jakarta.annotation.Nullable DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(@javax.annotation.Nullable List bars) { + public ObjectWithDeprecatedFields bars(@jakarta.annotation.Nullable List bars) { this.bars = bars; return this; } @@ -159,7 +159,7 @@ public ObjectWithDeprecatedFields addBarsItem(String barsItem) { * @deprecated */ @Deprecated - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getBars() { @@ -169,7 +169,7 @@ public List getBars() { @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBars(@javax.annotation.Nullable List bars) { + public void setBars(@jakarta.annotation.Nullable List bars) { this.bars = bars; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java index dc8125c8f7f2..0a412c00075b 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java @@ -42,22 +42,22 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Order { public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private OffsetDateTime shipDate; /** @@ -98,17 +98,17 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean complete = false; public Order() { } - public Order id(@javax.annotation.Nullable Long id) { + public Order id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -117,7 +117,7 @@ public Order id(@javax.annotation.Nullable Long id) { * Get id * @return id */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -127,12 +127,12 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable Long id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } - public Order petId(@javax.annotation.Nullable Long petId) { + public Order petId(@jakarta.annotation.Nullable Long petId) { this.petId = petId; return this; } @@ -141,7 +141,7 @@ public Order petId(@javax.annotation.Nullable Long petId) { * Get petId * @return petId */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getPetId() { @@ -151,12 +151,12 @@ public Long getPetId() { @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetId(@javax.annotation.Nullable Long petId) { + public void setPetId(@jakarta.annotation.Nullable Long petId) { this.petId = petId; } - public Order quantity(@javax.annotation.Nullable Integer quantity) { + public Order quantity(@jakarta.annotation.Nullable Integer quantity) { this.quantity = quantity; return this; } @@ -165,7 +165,7 @@ public Order quantity(@javax.annotation.Nullable Integer quantity) { * Get quantity * @return quantity */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getQuantity() { @@ -175,12 +175,12 @@ public Integer getQuantity() { @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuantity(@javax.annotation.Nullable Integer quantity) { + public void setQuantity(@jakarta.annotation.Nullable Integer quantity) { this.quantity = quantity; } - public Order shipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { + public Order shipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } @@ -189,7 +189,7 @@ public Order shipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public OffsetDateTime getShipDate() { @@ -199,12 +199,12 @@ public OffsetDateTime getShipDate() { @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { + public void setShipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; } - public Order status(@javax.annotation.Nullable StatusEnum status) { + public Order status(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; return this; } @@ -213,7 +213,7 @@ public Order status(@javax.annotation.Nullable StatusEnum status) { * Order Status * @return status */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public StatusEnum getStatus() { @@ -223,12 +223,12 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(@javax.annotation.Nullable StatusEnum status) { + public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; } - public Order complete(@javax.annotation.Nullable Boolean complete) { + public Order complete(@jakarta.annotation.Nullable Boolean complete) { this.complete = complete; return this; } @@ -237,7 +237,7 @@ public Order complete(@javax.annotation.Nullable Boolean complete) { * Get complete * @return complete */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getComplete() { @@ -247,7 +247,7 @@ public Boolean getComplete() { @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setComplete(@javax.annotation.Nullable Boolean complete) { + public void setComplete(@jakarta.annotation.Nullable Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java index 094a31712774..1930c095c531 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -39,24 +39,24 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean myBoolean; public OuterComposite() { } - public OuterComposite myNumber(@javax.annotation.Nullable BigDecimal myNumber) { + public OuterComposite myNumber(@jakarta.annotation.Nullable BigDecimal myNumber) { this.myNumber = myNumber; return this; } @@ -65,7 +65,7 @@ public OuterComposite myNumber(@javax.annotation.Nullable BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public BigDecimal getMyNumber() { @@ -75,12 +75,12 @@ public BigDecimal getMyNumber() { @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyNumber(@javax.annotation.Nullable BigDecimal myNumber) { + public void setMyNumber(@jakarta.annotation.Nullable BigDecimal myNumber) { this.myNumber = myNumber; } - public OuterComposite myString(@javax.annotation.Nullable String myString) { + public OuterComposite myString(@jakarta.annotation.Nullable String myString) { this.myString = myString; return this; } @@ -89,7 +89,7 @@ public OuterComposite myString(@javax.annotation.Nullable String myString) { * Get myString * @return myString */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getMyString() { @@ -99,12 +99,12 @@ public String getMyString() { @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyString(@javax.annotation.Nullable String myString) { + public void setMyString(@jakarta.annotation.Nullable String myString) { this.myString = myString; } - public OuterComposite myBoolean(@javax.annotation.Nullable Boolean myBoolean) { + public OuterComposite myBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { this.myBoolean = myBoolean; return this; } @@ -113,7 +113,7 @@ public OuterComposite myBoolean(@javax.annotation.Nullable Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getMyBoolean() { @@ -123,7 +123,7 @@ public Boolean getMyBoolean() { @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { + public void setMyBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java index 580068259d8f..d95b0107a0a0 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -40,7 +40,7 @@ */ @JsonPropertyOrder({ }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonIgnoreProperties( value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization allowSetters = true // allows the pet_type to be set during deserialization @@ -55,7 +55,7 @@ public ParentPet() { } @Override - public ParentPet petType(@javax.annotation.Nonnull String petType) { + public ParentPet petType(@jakarta.annotation.Nonnull String petType) { this.setPetType(petType); return this; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java index 208768caca38..559c05d4fa15 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java @@ -45,26 +45,26 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Pet { public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Category category; public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private List tags = new ArrayList<>(); /** @@ -105,13 +105,13 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private StatusEnum status; public Pet() { } - public Pet id(@javax.annotation.Nullable Long id) { + public Pet id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -120,7 +120,7 @@ public Pet id(@javax.annotation.Nullable Long id) { * Get id * @return id */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -130,12 +130,12 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable Long id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } - public Pet category(@javax.annotation.Nullable Category category) { + public Pet category(@jakarta.annotation.Nullable Category category) { this.category = category; return this; } @@ -144,7 +144,7 @@ public Pet category(@javax.annotation.Nullable Category category) { * Get category * @return category */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Category getCategory() { @@ -154,12 +154,12 @@ public Category getCategory() { @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategory(@javax.annotation.Nullable Category category) { + public void setCategory(@jakarta.annotation.Nullable Category category) { this.category = category; } - public Pet name(@javax.annotation.Nonnull String name) { + public Pet name(@jakarta.annotation.Nonnull String name) { this.name = name; return this; } @@ -168,7 +168,7 @@ public Pet name(@javax.annotation.Nonnull String name) { * Get name * @return name */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { @@ -178,12 +178,12 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { + public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } - public Pet photoUrls(@javax.annotation.Nonnull List photoUrls) { + public Pet photoUrls(@jakarta.annotation.Nonnull List photoUrls) { this.photoUrls = photoUrls; return this; } @@ -200,7 +200,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getPhotoUrls() { @@ -210,12 +210,12 @@ public List getPhotoUrls() { @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPhotoUrls(@javax.annotation.Nonnull List photoUrls) { + public void setPhotoUrls(@jakarta.annotation.Nonnull List photoUrls) { this.photoUrls = photoUrls; } - public Pet tags(@javax.annotation.Nullable List tags) { + public Pet tags(@jakarta.annotation.Nullable List tags) { this.tags = tags; return this; } @@ -232,7 +232,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List getTags() { @@ -242,12 +242,12 @@ public List getTags() { @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(@javax.annotation.Nullable List tags) { + public void setTags(@jakarta.annotation.Nullable List tags) { this.tags = tags; } - public Pet status(@javax.annotation.Nullable StatusEnum status) { + public Pet status(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; return this; } @@ -256,7 +256,7 @@ public Pet status(@javax.annotation.Nullable StatusEnum status) { * pet status in the store * @return status */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public StatusEnum getStatus() { @@ -266,7 +266,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(@javax.annotation.Nullable StatusEnum status) { + public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java index 8b0daec92aee..51899d544467 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java @@ -56,7 +56,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = Pig.PigDeserializer.class) @JsonSerialize(using = Pig.PigSerializer.class) public class Pig extends AbstractOpenApiSchema { @@ -95,19 +95,27 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws Jackso JsonToken token = tree.asToken(); // deserialize BasquePig try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, BasquePig.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -121,19 +129,27 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws Jackso // deserialize DanishPig try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, DanishPig.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java index ffb6dcadd269..60fe7096147e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -56,7 +56,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = Quadrilateral.QuadrilateralDeserializer.class) @JsonSerialize(using = Quadrilateral.QuadrilateralSerializer.class) public class Quadrilateral extends AbstractOpenApiSchema { @@ -95,19 +95,27 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr JsonToken token = tree.asToken(); // deserialize ComplexQuadrilateral try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, ComplexQuadrilateral.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -121,19 +129,27 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize SimpleQuadrilateral try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, SimpleQuadrilateral.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -169,19 +185,19 @@ public Quadrilateral() { super("oneOf", Boolean.FALSE); } - public Quadrilateral(ComplexQuadrilateral o) { + public Quadrilateral(SimpleQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Quadrilateral(SimpleQuadrilateral o) { + public Quadrilateral(ComplexQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); schemas.put("SimpleQuadrilateral", SimpleQuadrilateral.class); + schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -206,12 +222,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -231,25 +247,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `ComplexQuadrilateral` - * @throws ClassCastException if the instance is not `ComplexQuadrilateral` + * @return The actual instance of `SimpleQuadrilateral` + * @throws ClassCastException if the instance is not `SimpleQuadrilateral` */ - public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { - return (ComplexQuadrilateral)super.getActualInstance(); + public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { + return (SimpleQuadrilateral)super.getActualInstance(); } /** - * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `SimpleQuadrilateral` - * @throws ClassCastException if the instance is not `SimpleQuadrilateral` + * @return The actual instance of `ComplexQuadrilateral` + * @throws ClassCastException if the instance is not `ComplexQuadrilateral` */ - public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { - return (SimpleQuadrilateral)super.getActualInstance(); + public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { + return (ComplexQuadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index b0be7bb0874c..f52bb5e10212 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class QuadrilateralInterface { public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String quadrilateralType; public QuadrilateralInterface() { } - public QuadrilateralInterface quadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + public QuadrilateralInterface quadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; return this; } @@ -54,7 +54,7 @@ public QuadrilateralInterface quadrilateralType(@javax.annotation.Nonnull String * Get quadrilateralType * @return quadrilateralType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getQuadrilateralType() { @@ -64,7 +64,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index aed334b2ab74..c46a4dc5e5db 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,14 +37,14 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String baz; public ReadOnlyFirst() { @@ -62,7 +62,7 @@ public ReadOnlyFirst( * Get bar * @return bar */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getBar() { @@ -72,7 +72,7 @@ public String getBar() { - public ReadOnlyFirst baz(@javax.annotation.Nullable String baz) { + public ReadOnlyFirst baz(@jakarta.annotation.Nullable String baz) { this.baz = baz; return this; } @@ -81,7 +81,7 @@ public ReadOnlyFirst baz(@javax.annotation.Nullable String baz) { * Get baz * @return baz */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getBaz() { @@ -91,7 +91,7 @@ public String getBaz() { @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBaz(@javax.annotation.Nullable String baz) { + public void setBaz(@jakarta.annotation.Nullable String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 01cba8c2fc8a..915326aacfc4 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -37,20 +37,20 @@ ScaleneTriangle.JSON_PROPERTY_SHAPE_TYPE, ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ScaleneTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String triangleType; public ScaleneTriangle() { } - public ScaleneTriangle shapeType(@javax.annotation.Nonnull String shapeType) { + public ScaleneTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; return this; } @@ -59,7 +59,7 @@ public ScaleneTriangle shapeType(@javax.annotation.Nonnull String shapeType) { * Get shapeType * @return shapeType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getShapeType() { @@ -69,12 +69,12 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(@javax.annotation.Nonnull String shapeType) { + public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } - public ScaleneTriangle triangleType(@javax.annotation.Nonnull String triangleType) { + public ScaleneTriangle triangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; return this; } @@ -83,7 +83,7 @@ public ScaleneTriangle triangleType(@javax.annotation.Nonnull String triangleTyp * Get triangleType * @return triangleType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTriangleType() { @@ -93,7 +93,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java index 478d94c3e640..25e383b0bf63 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java @@ -56,7 +56,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = Shape.ShapeDeserializer.class) @JsonSerialize(using = Shape.ShapeSerializer.class) public class Shape extends AbstractOpenApiSchema { @@ -95,19 +95,27 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack JsonToken token = tree.asToken(); // deserialize Quadrilateral try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Quadrilateral.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -121,19 +129,27 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack // deserialize Triangle try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Triangle.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -169,19 +185,19 @@ public Shape() { super("oneOf", Boolean.FALSE); } - public Shape(Quadrilateral o) { + public Shape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Shape(Triangle o) { + public Shape(Quadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -206,12 +222,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -231,25 +247,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java index 03d7c1fd0ce3..91cd6681c5c1 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ ShapeInterface.JSON_PROPERTY_SHAPE_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class ShapeInterface { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String shapeType; public ShapeInterface() { } - public ShapeInterface shapeType(@javax.annotation.Nonnull String shapeType) { + public ShapeInterface shapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; return this; } @@ -54,7 +54,7 @@ public ShapeInterface shapeType(@javax.annotation.Nonnull String shapeType) { * Get shapeType * @return shapeType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getShapeType() { @@ -64,7 +64,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(@javax.annotation.Nonnull String shapeType) { + public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index a122682a5306..0e719e66e623 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -56,7 +56,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = ShapeOrNull.ShapeOrNullDeserializer.class) @JsonSerialize(using = ShapeOrNull.ShapeOrNullSerializer.class) public class ShapeOrNull extends AbstractOpenApiSchema { @@ -95,19 +95,27 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw JsonToken token = tree.asToken(); // deserialize Quadrilateral try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Quadrilateral.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -121,19 +129,27 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw // deserialize Triangle try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, Triangle.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -169,19 +185,19 @@ public ShapeOrNull() { super("oneOf", Boolean.FALSE); } - public ShapeOrNull(Quadrilateral o) { + public ShapeOrNull(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public ShapeOrNull(Triangle o) { + public ShapeOrNull(Quadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -206,12 +222,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -231,25 +247,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 4f3b6c96ee09..f0203bc74900 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -37,20 +37,20 @@ SimpleQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class SimpleQuadrilateral { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String quadrilateralType; public SimpleQuadrilateral() { } - public SimpleQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType) { + public SimpleQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; return this; } @@ -59,7 +59,7 @@ public SimpleQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType) * Get shapeType * @return shapeType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getShapeType() { @@ -69,12 +69,12 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(@javax.annotation.Nonnull String shapeType) { + public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } - public SimpleQuadrilateral quadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + public SimpleQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; return this; } @@ -83,7 +83,7 @@ public SimpleQuadrilateral quadrilateralType(@javax.annotation.Nonnull String qu * Get quadrilateralType * @return quadrilateralType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getQuadrilateralType() { @@ -93,7 +93,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java index a827b750ba3d..fbc934c7e6d3 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,20 +38,20 @@ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, SpecialModelName.JSON_PROPERTY_SPECIAL_MODEL_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long $specialPropertyName; public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String specialModelName; public SpecialModelName() { } - public SpecialModelName $specialPropertyName(@javax.annotation.Nullable Long $specialPropertyName) { + public SpecialModelName $specialPropertyName(@jakarta.annotation.Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; return this; } @@ -60,7 +60,7 @@ public SpecialModelName() { * Get $specialPropertyName * @return $specialPropertyName */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long get$SpecialPropertyName() { @@ -70,12 +70,12 @@ public SpecialModelName() { @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set$SpecialPropertyName(@javax.annotation.Nullable Long $specialPropertyName) { + public void set$SpecialPropertyName(@jakarta.annotation.Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } - public SpecialModelName specialModelName(@javax.annotation.Nullable String specialModelName) { + public SpecialModelName specialModelName(@jakarta.annotation.Nullable String specialModelName) { this.specialModelName = specialModelName; return this; } @@ -84,7 +84,7 @@ public SpecialModelName specialModelName(@javax.annotation.Nullable String speci * Get specialModelName * @return specialModelName */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getSpecialModelName() { @@ -94,7 +94,7 @@ public String getSpecialModelName() { @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSpecialModelName(@javax.annotation.Nullable String specialModelName) { + public void setSpecialModelName(@jakarta.annotation.Nullable String specialModelName) { this.specialModelName = specialModelName; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java index 5f668c9ff1e3..edf8fb871c86 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java @@ -37,20 +37,20 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Tag { public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String name; public Tag() { } - public Tag id(@javax.annotation.Nullable Long id) { + public Tag id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -59,7 +59,7 @@ public Tag id(@javax.annotation.Nullable Long id) { * Get id * @return id */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -69,12 +69,12 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable Long id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } - public Tag name(@javax.annotation.Nullable String name) { + public Tag name(@jakarta.annotation.Nullable String name) { this.name = name; return this; } @@ -83,7 +83,7 @@ public Tag name(@javax.annotation.Nullable String name) { * Get name * @return name */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { @@ -93,7 +93,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { + public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0f013861539b..a2eb291918cb 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -41,16 +41,16 @@ @JsonPropertyOrder({ TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { } - public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotation.Nullable String someProperty) { + public TestInlineFreeformAdditionalPropertiesRequest someProperty(@jakarta.annotation.Nullable String someProperty) { this.someProperty = someProperty; return this; } @@ -59,7 +59,7 @@ public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotat * Get someProperty * @return someProperty */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getSomeProperty() { @@ -69,7 +69,7 @@ public String getSomeProperty() { @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSomeProperty(@javax.annotation.Nullable String someProperty) { + public void setSomeProperty(@jakarta.annotation.Nullable String someProperty) { this.someProperty = someProperty; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java index 498f53733c84..9ae59269fc12 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java @@ -57,7 +57,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") @JsonDeserialize(using = Triangle.TriangleDeserializer.class) @JsonSerialize(using = Triangle.TriangleSerializer.class) public class Triangle extends AbstractOpenApiSchema { @@ -96,19 +96,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws J JsonToken token = tree.asToken(); // deserialize EquilateralTriangle try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, EquilateralTriangle.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -122,19 +130,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws J // deserialize IsoscelesTriangle try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, IsoscelesTriangle.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. @@ -148,19 +164,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws J // deserialize ScaleneTriangle try { + final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; + final tools.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, ScaleneTriangle.class); + deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java index 7b1de1ee785d..13e07f315cca 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -36,16 +36,16 @@ @JsonPropertyOrder({ TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class TriangleInterface { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String triangleType; public TriangleInterface() { } - public TriangleInterface triangleType(@javax.annotation.Nonnull String triangleType) { + public TriangleInterface triangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; return this; } @@ -54,7 +54,7 @@ public TriangleInterface triangleType(@javax.annotation.Nonnull String triangleT * Get triangleType * @return triangleType */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTriangleType() { @@ -64,7 +64,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java index 88d41f6a3911..0491f25b0fd2 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java @@ -47,60 +47,60 @@ User.JSON_PROPERTY_ANY_TYPE_PROP, User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class User { public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String password; public static final String JSON_PROPERTY_PHONE = "phone"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Integer userStatus; public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object objectWithNoDeclaredProps; public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object objectWithNoDeclaredPropsNullable; public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object anyTypeProp = null; public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Object anyTypePropNullable = null; public User() { } - public User id(@javax.annotation.Nullable Long id) { + public User id(@jakarta.annotation.Nullable Long id) { this.id = id; return this; } @@ -109,7 +109,7 @@ public User id(@javax.annotation.Nullable Long id) { * Get id * @return id */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Long getId() { @@ -119,12 +119,12 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(@javax.annotation.Nullable Long id) { + public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } - public User username(@javax.annotation.Nullable String username) { + public User username(@jakarta.annotation.Nullable String username) { this.username = username; return this; } @@ -133,7 +133,7 @@ public User username(@javax.annotation.Nullable String username) { * Get username * @return username */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getUsername() { @@ -143,12 +143,12 @@ public String getUsername() { @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(@javax.annotation.Nullable String username) { + public void setUsername(@jakarta.annotation.Nullable String username) { this.username = username; } - public User firstName(@javax.annotation.Nullable String firstName) { + public User firstName(@jakarta.annotation.Nullable String firstName) { this.firstName = firstName; return this; } @@ -157,7 +157,7 @@ public User firstName(@javax.annotation.Nullable String firstName) { * Get firstName * @return firstName */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getFirstName() { @@ -167,12 +167,12 @@ public String getFirstName() { @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFirstName(@javax.annotation.Nullable String firstName) { + public void setFirstName(@jakarta.annotation.Nullable String firstName) { this.firstName = firstName; } - public User lastName(@javax.annotation.Nullable String lastName) { + public User lastName(@jakarta.annotation.Nullable String lastName) { this.lastName = lastName; return this; } @@ -181,7 +181,7 @@ public User lastName(@javax.annotation.Nullable String lastName) { * Get lastName * @return lastName */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getLastName() { @@ -191,12 +191,12 @@ public String getLastName() { @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastName(@javax.annotation.Nullable String lastName) { + public void setLastName(@jakarta.annotation.Nullable String lastName) { this.lastName = lastName; } - public User email(@javax.annotation.Nullable String email) { + public User email(@jakarta.annotation.Nullable String email) { this.email = email; return this; } @@ -205,7 +205,7 @@ public User email(@javax.annotation.Nullable String email) { * Get email * @return email */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getEmail() { @@ -215,12 +215,12 @@ public String getEmail() { @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmail(@javax.annotation.Nullable String email) { + public void setEmail(@jakarta.annotation.Nullable String email) { this.email = email; } - public User password(@javax.annotation.Nullable String password) { + public User password(@jakarta.annotation.Nullable String password) { this.password = password; return this; } @@ -229,7 +229,7 @@ public User password(@javax.annotation.Nullable String password) { * Get password * @return password */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPassword() { @@ -239,12 +239,12 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(@javax.annotation.Nullable String password) { + public void setPassword(@jakarta.annotation.Nullable String password) { this.password = password; } - public User phone(@javax.annotation.Nullable String phone) { + public User phone(@jakarta.annotation.Nullable String phone) { this.phone = phone; return this; } @@ -253,7 +253,7 @@ public User phone(@javax.annotation.Nullable String phone) { * Get phone * @return phone */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getPhone() { @@ -263,12 +263,12 @@ public String getPhone() { @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhone(@javax.annotation.Nullable String phone) { + public void setPhone(@jakarta.annotation.Nullable String phone) { this.phone = phone; } - public User userStatus(@javax.annotation.Nullable Integer userStatus) { + public User userStatus(@jakarta.annotation.Nullable Integer userStatus) { this.userStatus = userStatus; return this; } @@ -277,7 +277,7 @@ public User userStatus(@javax.annotation.Nullable Integer userStatus) { * User Status * @return userStatus */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Integer getUserStatus() { @@ -287,12 +287,12 @@ public Integer getUserStatus() { @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUserStatus(@javax.annotation.Nullable Integer userStatus) { + public void setUserStatus(@jakarta.annotation.Nullable Integer userStatus) { this.userStatus = userStatus; } - public User objectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWithNoDeclaredProps) { + public User objectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; return this; } @@ -301,7 +301,7 @@ public User objectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWi * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. * @return objectWithNoDeclaredProps */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getObjectWithNoDeclaredProps() { @@ -311,12 +311,12 @@ public Object getObjectWithNoDeclaredProps() { @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWithNoDeclaredProps) { + public void setObjectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; } - public User objectWithNoDeclaredPropsNullable(@javax.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { + public User objectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; return this; } @@ -325,7 +325,7 @@ public User objectWithNoDeclaredPropsNullable(@javax.annotation.Nullable Object * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. * @return objectWithNoDeclaredPropsNullable */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getObjectWithNoDeclaredPropsNullable() { @@ -335,12 +335,12 @@ public Object getObjectWithNoDeclaredPropsNullable() { @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectWithNoDeclaredPropsNullable(@javax.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { + public void setObjectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; } - public User anyTypeProp(@javax.annotation.Nullable Object anyTypeProp) { + public User anyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { this.anyTypeProp = anyTypeProp; return this; } @@ -349,7 +349,7 @@ public User anyTypeProp(@javax.annotation.Nullable Object anyTypeProp) { * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 * @return anyTypeProp */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getAnyTypeProp() { @@ -359,12 +359,12 @@ public Object getAnyTypeProp() { @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAnyTypeProp(@javax.annotation.Nullable Object anyTypeProp) { + public void setAnyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { this.anyTypeProp = anyTypeProp; } - public User anyTypePropNullable(@javax.annotation.Nullable Object anyTypePropNullable) { + public User anyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropNullable) { this.anyTypePropNullable = anyTypePropNullable; return this; } @@ -373,7 +373,7 @@ public User anyTypePropNullable(@javax.annotation.Nullable Object anyTypePropNul * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. * @return anyTypePropNullable */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Object getAnyTypePropNullable() { @@ -383,7 +383,7 @@ public Object getAnyTypePropNullable() { @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAnyTypePropNullable(@javax.annotation.Nullable Object anyTypePropNullable) { + public void setAnyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropNullable) { this.anyTypePropNullable = anyTypePropNullable; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java index ff534012b5f5..6c961d0d32e0 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java @@ -39,24 +39,24 @@ Whale.JSON_PROPERTY_HAS_TEETH, Whale.JSON_PROPERTY_CLASS_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Whale { public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean hasBaleen; public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private Boolean hasTeeth; public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String className; public Whale() { } - public Whale hasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { + public Whale hasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { this.hasBaleen = hasBaleen; return this; } @@ -65,7 +65,7 @@ public Whale hasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { * Get hasBaleen * @return hasBaleen */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getHasBaleen() { @@ -75,12 +75,12 @@ public Boolean getHasBaleen() { @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { + public void setHasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { this.hasBaleen = hasBaleen; } - public Whale hasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { + public Whale hasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { this.hasTeeth = hasTeeth; return this; } @@ -89,7 +89,7 @@ public Whale hasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { * Get hasTeeth * @return hasTeeth */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getHasTeeth() { @@ -99,12 +99,12 @@ public Boolean getHasTeeth() { @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { + public void setHasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { this.hasTeeth = hasTeeth; } - public Whale className(@javax.annotation.Nonnull String className) { + public Whale className(@jakarta.annotation.Nonnull String className) { this.className = className; return this; } @@ -113,7 +113,7 @@ public Whale className(@javax.annotation.Nonnull String className) { * Get className * @return className */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getClassName() { @@ -123,7 +123,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(@javax.annotation.Nonnull String className) { + public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java index 369f8403fe8e..5ed4e5c7f39a 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java @@ -42,7 +42,7 @@ Zebra.JSON_PROPERTY_TYPE, Zebra.JSON_PROPERTY_CLASS_NAME }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") public class Zebra { /** * Gets or Sets type @@ -82,17 +82,17 @@ public static TypeEnum fromValue(String value) { } public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable + @jakarta.annotation.Nullable private TypeEnum type; public static final String JSON_PROPERTY_CLASS_NAME = "className"; - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull private String className; public Zebra() { } - public Zebra type(@javax.annotation.Nullable TypeEnum type) { + public Zebra type(@jakarta.annotation.Nullable TypeEnum type) { this.type = type; return this; } @@ -101,7 +101,7 @@ public Zebra type(@javax.annotation.Nullable TypeEnum type) { * Get type * @return type */ - @javax.annotation.Nullable + @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public TypeEnum getType() { @@ -111,12 +111,12 @@ public TypeEnum getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable TypeEnum type) { + public void setType(@jakarta.annotation.Nullable TypeEnum type) { this.type = type; } - public Zebra className(@javax.annotation.Nonnull String className) { + public Zebra className(@jakarta.annotation.Nonnull String className) { this.className = className; return this; } @@ -125,7 +125,7 @@ public Zebra className(@javax.annotation.Nonnull String className) { * Get className * @return className */ - @javax.annotation.Nonnull + @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getClassName() { @@ -135,7 +135,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(@javax.annotation.Nonnull String className) { + public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java new file mode 100644 index 000000000000..1f825fbe6b32 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FruitOrFruits + */ +class FruitOrFruitsTest { + private final FruitOrFruits model = new FruitOrFruits(); + + /** + * Model tests for FruitOrFruits + */ + @Test + void testFruitOrFruits() { + // TODO: test FruitOrFruits + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java new file mode 100644 index 000000000000..3e630b9349f2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GmFruitOrFruits + */ +class GmFruitOrFruitsTest { + private final GmFruitOrFruits model = new GmFruitOrFruits(); + + /** + * Model tests for GmFruitOrFruits + */ + @Test + void testGmFruitOrFruits() { + // TODO: test GmFruitOrFruits + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-jakarta/pom.xml b/samples/client/petstore/java/native-jakarta/pom.xml index e6079730dbec..a21dea4eeab5 100644 --- a/samples/client/petstore/java/native-jakarta/pom.xml +++ b/samples/client/petstore/java/native-jakarta/pom.xml @@ -253,10 +253,10 @@ UTF-8 11 11 - 2.21.6 - 2.21 + 2.22.3 + 2.22 0.2.12 - 2.1.1 + 3.0.0 3.0.2 4.5.14 5.10.2 diff --git a/samples/client/petstore/java/native-useGzipFeature/pom.xml b/samples/client/petstore/java/native-useGzipFeature/pom.xml index 793c19d8d253..ed8f4393f69a 100644 --- a/samples/client/petstore/java/native-useGzipFeature/pom.xml +++ b/samples/client/petstore/java/native-useGzipFeature/pom.xml @@ -248,10 +248,10 @@ UTF-8 11 11 - 2.21.6 - 2.21 + 2.22.3 + 2.22 0.2.12 - 2.1.1 + 3.0.0 3.0.2 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native/.openapi-generator/FILES b/samples/client/petstore/java/native/.openapi-generator/FILES index 8dc201491a16..8b1c02a8644f 100644 --- a/samples/client/petstore/java/native/.openapi-generator/FILES +++ b/samples/client/petstore/java/native/.openapi-generator/FILES @@ -43,8 +43,10 @@ docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md docs/Fruit.md +docs/FruitOrFruits.md docs/FruitReq.md docs/GmFruit.md +docs/GmFruitOrFruits.md docs/GrandparentAnimal.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md @@ -152,8 +154,10 @@ src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java src/main/java/org/openapitools/client/model/FormatTest.java src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitOrFruits.java src/main/java/org/openapitools/client/model/FruitReq.java src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GmFruitOrFruits.java src/main/java/org/openapitools/client/model/GrandparentAnimal.java src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java src/main/java/org/openapitools/client/model/HealthCheckResult.java diff --git a/samples/client/petstore/java/native/README.md b/samples/client/petstore/java/native/README.md index 77b979e85575..496f04e0eb54 100644 --- a/samples/client/petstore/java/native/README.md +++ b/samples/client/petstore/java/native/README.md @@ -233,8 +233,10 @@ Class | Method | HTTP request | Description - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) + - [FruitOrFruits](docs/FruitOrFruits.md) - [FruitReq](docs/FruitReq.md) - [GmFruit](docs/GmFruit.md) + - [GmFruitOrFruits](docs/GmFruitOrFruits.md) - [GrandparentAnimal](docs/GrandparentAnimal.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index c999de47bc75..5ff275a6e8b1 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -2040,6 +2040,21 @@ components: type: object type: object type: object + fruitOrFruits: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/apple" + - items: + $ref: "#/components/schemas/apple" + type: array + - $ref: "#/components/schemas/banana" + - items: + $ref: "#/components/schemas/banana" + type: array + properties: + color: + type: string + x-has-list-alternative: true fruit: additionalProperties: false oneOf: @@ -2115,6 +2130,21 @@ components: required: - className type: object + gmFruitOrFruits: + additionalProperties: false + anyOf: + - $ref: "#/components/schemas/apple" + - items: + $ref: "#/components/schemas/apple" + type: array + - $ref: "#/components/schemas/banana" + - items: + $ref: "#/components/schemas/banana" + type: array + properties: + color: + type: string + x-has-list-alternative: true gmFruit: additionalProperties: false anyOf: diff --git a/samples/client/petstore/java/native/docs/FruitOrFruits.md b/samples/client/petstore/java/native/docs/FruitOrFruits.md new file mode 100644 index 000000000000..a271b07800ac --- /dev/null +++ b/samples/client/petstore/java/native/docs/FruitOrFruits.md @@ -0,0 +1,55 @@ + + +# FruitOrFruits + +## oneOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) +* [List](List.md) +* [List](List.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.FruitOrFruits; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.openapitools.client.model.List; +import org.openapitools.client.model.List; + +public class Example { + public static void main(String[] args) { + FruitOrFruits exampleFruitOrFruits = new FruitOrFruits(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set FruitOrFruits to Apple + exampleFruitOrFruits.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleFruitOrFruits.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set FruitOrFruits to Banana + exampleFruitOrFruits.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set FruitOrFruits to List + exampleFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set FruitOrFruits to List + exampleFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleFruitOrFruits.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native/docs/GmFruitOrFruits.md b/samples/client/petstore/java/native/docs/GmFruitOrFruits.md new file mode 100644 index 000000000000..74b1e425d966 --- /dev/null +++ b/samples/client/petstore/java/native/docs/GmFruitOrFruits.md @@ -0,0 +1,55 @@ + + +# GmFruitOrFruits + +## anyOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) +* [List](List.md) +* [List](List.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.GmFruitOrFruits; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.openapitools.client.model.List; +import org.openapitools.client.model.List; + +public class Example { + public static void main(String[] args) { + GmFruitOrFruits exampleGmFruitOrFruits = new GmFruitOrFruits(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set GmFruitOrFruits to Apple + exampleGmFruitOrFruits.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleGmFruitOrFruits.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set GmFruitOrFruits to Banana + exampleGmFruitOrFruits.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleGmFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set GmFruitOrFruits to List + exampleGmFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleGmFruitOrFruits.getActualInstance(); + + // create a new List + List exampleList = new List(); + // set GmFruitOrFruits to List + exampleGmFruitOrFruits.setActualInstance(exampleList); + // to get back the List set earlier + List testList = (List) exampleGmFruitOrFruits.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index 1584dea78410..3a0fbc09b922 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -259,13 +259,13 @@ UTF-8 11 11 - 2.21.6 - 2.21 + 2.22.3 + 2.22 0.2.12 1.3.5 2.0.2 4.5.14 - 3.17.0 + 3.21.0 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java index c86eed9579ca..4e42b519fdab 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java @@ -96,19 +96,27 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Apple try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -122,19 +130,27 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx // deserialize Banana try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -171,7 +187,7 @@ public Fruit() { } public Fruit(Apple o) { - super("oneOf", Boolean.FALSE); + super("oneOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java new file mode 100644 index 000000000000..e10c70bb5064 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java @@ -0,0 +1,439 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = FruitOrFruits.FruitOrFruitsDeserializer.class) +@JsonSerialize(using = FruitOrFruits.FruitOrFruitsSerializer.class) +public class FruitOrFruits extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FruitOrFruits.class.getName()); + + public static class FruitOrFruitsSerializer extends StdSerializer { + public FruitOrFruitsSerializer(Class t) { + super(t); + } + + public FruitOrFruitsSerializer() { + this(null); + } + + @Override + public void serialize(FruitOrFruits value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class FruitOrFruitsDeserializer extends StdDeserializer { + public FruitOrFruitsDeserializer() { + this(FruitOrFruits.class); + } + + public FruitOrFruitsDeserializer(Class vc) { + super(vc); + } + + @Override + public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = ctxt.readTree(jp); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Apple + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); + boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; + // ensure that we respect type coercion as set on the client ObjectMapper + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + // 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 'List'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + if (match == 1) { + FruitOrFruits ret = new FruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for FruitOrFruits: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public FruitOrFruits getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "FruitOrFruits cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public FruitOrFruits() { + super("oneOf", Boolean.FALSE); + } + + public FruitOrFruits(Apple o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + + public FruitOrFruits(Banana o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + + public FruitOrFruits(java.util.List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("List", java.util.List.class); + schemas.put("Banana", Banana.class); + schemas.put("List", java.util.List.class); + JSON.registerDescendants(FruitOrFruits.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return FruitOrFruits.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Apple, Banana, List<Apple>, List<Banana> + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, List, List"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana, List<Apple>, List<Banana> + * + * @return The actual instance (Apple, Banana, List<Apple>, List<Banana>) + */ + @Override + public Object getActualInstance() { + return super.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` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Apple>`. If the actual instance is not `List<Apple>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Apple>` + * @throws ClassCastException if the instance is not `List<Apple>` + */ + public List getListApple() throws ClassCastException { + return (List)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` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Banana>`. If the actual instance is not `List<Banana>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Banana>` + * @throws ClassCastException if the instance is not `List<Banana>` + */ + public List getListBanana() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Apple) { + if (getActualInstance() != null) { + joiner.add(((Apple)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof List) { + if (getActualInstance() != null) { + List items = (List) getActualInstance(); + for (int i = 0; i < items.size(); i++) { + Apple item = items.get(i); + if (item != null) { + joiner.add(item.toUrlQueryString(String.format(java.util.Locale.ROOT, "%sone_of_1%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + return joiner.toString(); + } + if (getActualInstance() instanceof Banana) { + if (getActualInstance() != null) { + joiner.add(((Banana)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java index 539f66783ee8..327340db529f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java @@ -96,19 +96,27 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize AppleReq try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -122,19 +130,27 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize BananaReq try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java index 7c4097047665..c44d075f404e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java @@ -55,7 +55,7 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") -@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) +@JsonDeserialize(using = GmFruit.GmFruitDeserializer.class) @JsonSerialize(using = GmFruit.GmFruitSerializer.class) public class GmFruit extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(GmFruit.class.getName()); @@ -91,7 +91,8 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO Object deserialized = null; // deserialize Apple try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -102,7 +103,8 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO // deserialize Banana try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -131,7 +133,7 @@ public GmFruit() { } public GmFruit(Apple o) { - super("anyOf", Boolean.FALSE); + super("anyOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java new file mode 100644 index 000000000000..40c929be8a19 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java @@ -0,0 +1,316 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.27.0-SNAPSHOT") +@JsonDeserialize(using = GmFruitOrFruits.GmFruitOrFruitsDeserializer.class) +@JsonSerialize(using = GmFruitOrFruits.GmFruitOrFruitsSerializer.class) +public class GmFruitOrFruits extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GmFruitOrFruits.class.getName()); + + public static class GmFruitOrFruitsSerializer extends StdSerializer { + public GmFruitOrFruitsSerializer(Class t) { + super(t); + } + + public GmFruitOrFruitsSerializer() { + this(null); + } + + @Override + public void serialize(GmFruitOrFruits value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class GmFruitOrFruitsDeserializer extends StdDeserializer { + public GmFruitOrFruitsDeserializer() { + this(GmFruitOrFruits.class); + } + + public GmFruitOrFruitsDeserializer(Class vc) { + super(vc); + } + + @Override + public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = ctxt.readTree(jp); + + Object deserialized = null; + // deserialize Apple + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize Banana + try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + // deserialize List + try { + final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + GmFruitOrFruits ret = new GmFruitOrFruits(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruitOrFruits'", e); + } + + throw new IOException("Failed deserialization for GmFruitOrFruits: no match found"); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public GmFruitOrFruits getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "GmFruitOrFruits cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public GmFruitOrFruits() { + super("anyOf", Boolean.FALSE); + } + + public GmFruitOrFruits(Apple o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + + public GmFruitOrFruits(Banana o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + + public GmFruitOrFruits(java.util.List o) { + this(); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("List", java.util.List.class); + schemas.put("Banana", Banana.class); + schemas.put("List", java.util.List.class); + JSON.registerDescendants(GmFruitOrFruits.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return GmFruitOrFruits.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Apple, Banana, List<Apple>, List<Banana> + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(java.util.List.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, List, List"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana, List<Apple>, List<Banana> + * + * @return The actual instance (Apple, Banana, List<Apple>, List<Banana>) + */ + @Override + public Object getActualInstance() { + return super.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` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Apple>`. If the actual instance is not `List<Apple>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Apple>` + * @throws ClassCastException if the instance is not `List<Apple>` + */ + public List getListApple() throws ClassCastException { + return (List)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` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Banana>`. If the actual instance is not `List<Banana>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Banana>` + * @throws ClassCastException if the instance is not `List<Banana>` + */ + public List getListBanana() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java index 9b7545ada1d4..5cbb12123dfd 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java @@ -99,19 +99,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Pig try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -125,19 +133,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE // deserialize Whale try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -151,19 +167,27 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE // deserialize Zebra try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -199,25 +223,25 @@ public Mammal() { super("oneOf", Boolean.FALSE); } - public Mammal(Pig o) { + public Mammal(Whale o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Mammal(Whale o) { + public Mammal(Zebra o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Mammal(Zebra o) { + public Mammal(Pig o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Pig", Pig.class); schemas.put("Whale", Whale.class); schemas.put("Zebra", Zebra.class); + schemas.put("Pig", Pig.class); JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -243,17 +267,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; } @@ -272,17 +296,6 @@ public Object getActualInstance() { return 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(); - } - /** * Get the actual instance of `Whale`. If the actual instance is not `Whale`, * the ClassCastException will be thrown. @@ -305,6 +318,17 @@ 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/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java index 1139efe94fc1..dd48a089e39e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java @@ -98,20 +98,28 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -125,20 +133,28 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize Triangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -174,19 +190,19 @@ public NullableShape() { super("oneOf", Boolean.TRUE); } - public NullableShape(Quadrilateral o) { - super("oneOf", Boolean.TRUE); + public NullableShape(Triangle o) { + super("oneOf", Boolean.FALSE); setActualInstance(o); } - public NullableShape(Triangle o) { - super("oneOf", Boolean.TRUE); + public NullableShape(Quadrilateral o) { + super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -216,12 +232,12 @@ public void setActualInstance(Object instance) { return; } - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -241,25 +257,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java index 48738cadceec..8e922e77e1fd 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java @@ -98,19 +98,27 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize BasquePig try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -124,19 +132,27 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce // deserialize DanishPig try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java index 2481f960f347..070c9a17e895 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -98,19 +98,27 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize ComplexQuadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -124,19 +132,27 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize SimpleQuadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -172,19 +188,19 @@ public Quadrilateral() { super("oneOf", Boolean.FALSE); } - public Quadrilateral(ComplexQuadrilateral o) { + public Quadrilateral(SimpleQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Quadrilateral(SimpleQuadrilateral o) { + public Quadrilateral(ComplexQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); schemas.put("SimpleQuadrilateral", SimpleQuadrilateral.class); + schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -209,12 +225,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -234,25 +250,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `ComplexQuadrilateral` - * @throws ClassCastException if the instance is not `ComplexQuadrilateral` + * @return The actual instance of `SimpleQuadrilateral` + * @throws ClassCastException if the instance is not `SimpleQuadrilateral` */ - public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { - return (ComplexQuadrilateral)super.getActualInstance(); + public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { + return (SimpleQuadrilateral)super.getActualInstance(); } /** - * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `SimpleQuadrilateral` - * @throws ClassCastException if the instance is not `SimpleQuadrilateral` + * @return The actual instance of `ComplexQuadrilateral` + * @throws ClassCastException if the instance is not `ComplexQuadrilateral` */ - public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { - return (SimpleQuadrilateral)super.getActualInstance(); + public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { + return (ComplexQuadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java index 419eb8c69f7a..55c88d55bf37 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java @@ -98,19 +98,27 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -124,19 +132,27 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx // deserialize Triangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -172,19 +188,19 @@ public Shape() { super("oneOf", Boolean.FALSE); } - public Shape(Quadrilateral o) { + public Shape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public Shape(Triangle o) { + public Shape(Quadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -209,12 +225,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -234,25 +250,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 36e67ee7f2eb..e090e9207e3d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -98,19 +98,27 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -124,19 +132,27 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw // deserialize Triangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -172,19 +188,19 @@ public ShapeOrNull() { super("oneOf", Boolean.FALSE); } - public ShapeOrNull(Quadrilateral o) { + public ShapeOrNull(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public ShapeOrNull(Triangle o) { + public ShapeOrNull(Quadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("Quadrilateral", Quadrilateral.class); schemas.put("Triangle", Triangle.class); + schemas.put("Quadrilateral", Quadrilateral.class); JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap>(); @@ -209,12 +225,12 @@ public Map> getSchemas() { */ @Override public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } @@ -234,25 +250,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, * the ClassCastException will be thrown. * - * @return The actual instance of `Quadrilateral` - * @throws ClassCastException if the instance is not `Quadrilateral` + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` */ - public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, * the ClassCastException will be thrown. * - * @return The actual instance of `Triangle` - * @throws ClassCastException if the instance is not `Triangle` + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` */ - public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java index e2a83519e12c..06f3fc3d5e07 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java @@ -99,19 +99,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize EquilateralTriangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -125,19 +133,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize IsoscelesTriangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. @@ -151,19 +167,27 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize ScaleneTriangle try { + final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; + final com.fasterxml.jackson.databind.JavaType candidateType = ctxt.getTypeFactory().constructType(candidateRef); + final Class candidateClass = candidateType.getRawClass(); boolean attemptParsing = true; + // containers (List/Set/Map) must match the JSON shape; element types are checked while binding + if (candidateType.isCollectionLikeType()) { + attemptParsing = token == JsonToken.START_ARRAY; + } else if (candidateType.isMapLikeType()) { + attemptParsing = token == JsonToken.START_OBJECT; // ensure that we respect type coercion as set on the client ObjectMapper - if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) { + } else if (candidateClass.equals(Integer.class) || candidateClass.equals(Long.class) || candidateClass.equals(Float.class) || candidateClass.equals(Double.class) || candidateClass.equals(Boolean.class) || candidateClass.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= ((candidateClass.equals(Integer.class) || candidateClass.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((candidateClass.equals(Float.class) || candidateClass.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (candidateClass.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (candidateClass.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); // 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. diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java new file mode 100644 index 000000000000..1f825fbe6b32 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitOrFruitsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FruitOrFruits + */ +class FruitOrFruitsTest { + private final FruitOrFruits model = new FruitOrFruits(); + + /** + * Model tests for FruitOrFruits + */ + @Test + void testFruitOrFruits() { + // TODO: test FruitOrFruits + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java new file mode 100644 index 000000000000..3e630b9349f2 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitOrFruitsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GmFruitOrFruits + */ +class GmFruitOrFruitsTest { + private final GmFruitOrFruits model = new GmFruitOrFruits(); + + /** + * Model tests for GmFruitOrFruits + */ + @Test + void testGmFruitOrFruits() { + // TODO: test GmFruitOrFruits + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index 740a9839ee85..fd3532558449 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -277,11 +277,6 @@ play-ahc-ws_2.12 ${play-version} - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - jakarta.annotation jakarta.annotation-api From dfe2f8c98d898fb248901ccdeb234f9609b55a22 Mon Sep 17 00:00:00 2001 From: William Dutton Date: Fri, 16 Oct 2026 07:00:00 +1000 Subject: [PATCH 2/2] [#12911] [JAVA][Native] PR review fixes --- .../resources/Java/libraries/native/anyof_model.mustache | 4 ++-- .../Java/libraries/native/model_anyof_doc.mustache | 6 +++--- .../Java/libraries/native/model_oneof_doc.mustache | 6 +++--- .../resources/Java/libraries/native/oneof_model.mustache | 4 ++-- .../petstore/java/native-async/docs/FruitOrFruits.md | 4 ++-- .../petstore/java/native-async/docs/GmFruitOrFruits.md | 4 ++-- samples/client/petstore/java/native-async/docs/Mammal.md | 2 +- .../petstore/java/native-async/docs/NullableShape.md | 2 +- .../petstore/java/native-async/docs/Quadrilateral.md | 2 +- samples/client/petstore/java/native-async/docs/Shape.md | 2 +- .../client/petstore/java/native-async/docs/ShapeOrNull.md | 2 +- .../main/java/org/openapitools/client/model/Fruit.java | 4 ++-- .../java/org/openapitools/client/model/FruitOrFruits.java | 8 ++++---- .../main/java/org/openapitools/client/model/FruitReq.java | 4 ++-- .../main/java/org/openapitools/client/model/GmFruit.java | 4 ++-- .../org/openapitools/client/model/GmFruitOrFruits.java | 8 ++++---- .../main/java/org/openapitools/client/model/Mammal.java | 6 +++--- .../java/org/openapitools/client/model/NullableShape.java | 4 ++-- .../src/main/java/org/openapitools/client/model/Pig.java | 4 ++-- .../java/org/openapitools/client/model/Quadrilateral.java | 4 ++-- .../main/java/org/openapitools/client/model/Shape.java | 4 ++-- .../java/org/openapitools/client/model/ShapeOrNull.java | 4 ++-- .../main/java/org/openapitools/client/model/Triangle.java | 6 +++--- .../petstore/java/native-jackson3/docs/FruitOrFruits.md | 4 ++-- .../petstore/java/native-jackson3/docs/GmFruitOrFruits.md | 4 ++-- .../client/petstore/java/native-jackson3/docs/Mammal.md | 2 +- .../petstore/java/native-jackson3/docs/NullableShape.md | 2 +- .../petstore/java/native-jackson3/docs/Quadrilateral.md | 2 +- .../client/petstore/java/native-jackson3/docs/Shape.md | 2 +- .../petstore/java/native-jackson3/docs/ShapeOrNull.md | 2 +- .../main/java/org/openapitools/client/model/Fruit.java | 4 ++-- .../java/org/openapitools/client/model/FruitOrFruits.java | 8 ++++---- .../main/java/org/openapitools/client/model/FruitReq.java | 4 ++-- .../main/java/org/openapitools/client/model/GmFruit.java | 4 ++-- .../org/openapitools/client/model/GmFruitOrFruits.java | 8 ++++---- .../main/java/org/openapitools/client/model/Mammal.java | 6 +++--- .../java/org/openapitools/client/model/NullableShape.java | 4 ++-- .../src/main/java/org/openapitools/client/model/Pig.java | 4 ++-- .../java/org/openapitools/client/model/Quadrilateral.java | 4 ++-- .../main/java/org/openapitools/client/model/Shape.java | 4 ++-- .../java/org/openapitools/client/model/ShapeOrNull.java | 4 ++-- .../main/java/org/openapitools/client/model/Triangle.java | 6 +++--- samples/client/petstore/java/native/docs/FruitOrFruits.md | 4 ++-- .../client/petstore/java/native/docs/GmFruitOrFruits.md | 4 ++-- samples/client/petstore/java/native/docs/Mammal.md | 2 +- samples/client/petstore/java/native/docs/NullableShape.md | 2 +- samples/client/petstore/java/native/docs/Quadrilateral.md | 2 +- samples/client/petstore/java/native/docs/Shape.md | 2 +- samples/client/petstore/java/native/docs/ShapeOrNull.md | 2 +- .../main/java/org/openapitools/client/model/Fruit.java | 4 ++-- .../java/org/openapitools/client/model/FruitOrFruits.java | 8 ++++---- .../main/java/org/openapitools/client/model/FruitReq.java | 4 ++-- .../main/java/org/openapitools/client/model/GmFruit.java | 4 ++-- .../org/openapitools/client/model/GmFruitOrFruits.java | 8 ++++---- .../main/java/org/openapitools/client/model/Mammal.java | 6 +++--- .../java/org/openapitools/client/model/NullableShape.java | 4 ++-- .../src/main/java/org/openapitools/client/model/Pig.java | 4 ++-- .../java/org/openapitools/client/model/Quadrilateral.java | 4 ++-- .../main/java/org/openapitools/client/model/Shape.java | 4 ++-- .../java/org/openapitools/client/model/ShapeOrNull.java | 4 ++-- .../main/java/org/openapitools/client/model/Triangle.java | 6 +++--- 61 files changed, 127 insertions(+), 127 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache index 178c71f8e1c7..3c4f6cdc97df 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache @@ -92,10 +92,10 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im try { final {{jacksonPackage}}.core.type.TypeReference<{{{.}}}> candidateRef = new {{jacksonPackage}}.core.type.TypeReference<{{{.}}}>() {}; {{^useJackson3}} - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); {{/useJackson3}} {{#useJackson3}} - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); {{/useJackson3}} {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/model_anyof_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/model_anyof_doc.mustache index e360aa56e6c3..ed07069162e8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/model_anyof_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/model_anyof_doc.mustache @@ -5,9 +5,9 @@ {{/description}} ## anyOf schemas -{{#anyOf}} -* [{{{.}}}]({{{.}}}.md) -{{/anyOf}} +{{#composedSchemas.anyOf}} +* [{{dataType}}]({{#isArray}}{{#uniqueItems}}{{items.dataType}}{{/uniqueItems}}{{^uniqueItems}}{{items.dataType}}{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}{{items.dataType}}{{/isMap}}{{^isMap}}{{dataType}}{{/isMap}}{{/isArray}}.md) +{{/composedSchemas.anyOf}} {{#isNullable}} NOTE: this class is nullable. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/model_oneof_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/model_oneof_doc.mustache index 5fff76c9efa0..62edfbb27428 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/model_oneof_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/model_oneof_doc.mustache @@ -5,9 +5,9 @@ {{/description}} ## oneOf schemas -{{#oneOf}} -* [{{{.}}}]({{{.}}}.md) -{{/oneOf}} +{{#composedSchemas.oneOf}} +* [{{dataType}}]({{#isArray}}{{#uniqueItems}}{{items.dataType}}{{/uniqueItems}}{{^uniqueItems}}{{items.dataType}}{{/uniqueItems}}{{/isArray}}{{^isArray}}{{#isMap}}{{items.dataType}}{{/isMap}}{{^isMap}}{{dataType}}{{/isMap}}{{/isArray}}.md) +{{/composedSchemas.oneOf}} {{#isNullable}} NOTE: this class is nullable. diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache index 3517fcfb0315..ae9bbbb3b0a0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache @@ -139,10 +139,10 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } if (attemptParsing) { {{^useJackson3}} - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); {{/useJackson3}} {{#useJackson3}} - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); {{/useJackson3}} // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON diff --git a/samples/client/petstore/java/native-async/docs/FruitOrFruits.md b/samples/client/petstore/java/native-async/docs/FruitOrFruits.md index a271b07800ac..dde7d8de0797 100644 --- a/samples/client/petstore/java/native-async/docs/FruitOrFruits.md +++ b/samples/client/petstore/java/native-async/docs/FruitOrFruits.md @@ -4,9 +4,9 @@ ## oneOf schemas * [Apple](Apple.md) +* [List<Apple>](Apple.md) * [Banana](Banana.md) -* [List](List.md) -* [List](List.md) +* [List<Banana>](Banana.md) ## Example ```java diff --git a/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md b/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md index 74b1e425d966..3ba095c93714 100644 --- a/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md +++ b/samples/client/petstore/java/native-async/docs/GmFruitOrFruits.md @@ -4,9 +4,9 @@ ## anyOf schemas * [Apple](Apple.md) +* [List<Apple>](Apple.md) * [Banana](Banana.md) -* [List](List.md) -* [List](List.md) +* [List<Banana>](Banana.md) ## Example ```java diff --git a/samples/client/petstore/java/native-async/docs/Mammal.md b/samples/client/petstore/java/native-async/docs/Mammal.md index 11bbff5e2ba9..ab860c23fc24 100644 --- a/samples/client/petstore/java/native-async/docs/Mammal.md +++ b/samples/client/petstore/java/native-async/docs/Mammal.md @@ -3,9 +3,9 @@ # Mammal ## oneOf schemas -* [Pig](Pig.md) * [Whale](Whale.md) * [Zebra](Zebra.md) +* [Pig](Pig.md) ## Example ```java diff --git a/samples/client/petstore/java/native-async/docs/NullableShape.md b/samples/client/petstore/java/native-async/docs/NullableShape.md index 60c45b268406..6870fdd82f5c 100644 --- a/samples/client/petstore/java/native-async/docs/NullableShape.md +++ b/samples/client/petstore/java/native-async/docs/NullableShape.md @@ -5,8 +5,8 @@ The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) NOTE: this class is nullable. diff --git a/samples/client/petstore/java/native-async/docs/Quadrilateral.md b/samples/client/petstore/java/native-async/docs/Quadrilateral.md index 83ffea0c742f..4e206f422dce 100644 --- a/samples/client/petstore/java/native-async/docs/Quadrilateral.md +++ b/samples/client/petstore/java/native-async/docs/Quadrilateral.md @@ -3,8 +3,8 @@ # Quadrilateral ## oneOf schemas -* [ComplexQuadrilateral](ComplexQuadrilateral.md) * [SimpleQuadrilateral](SimpleQuadrilateral.md) +* [ComplexQuadrilateral](ComplexQuadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native-async/docs/Shape.md b/samples/client/petstore/java/native-async/docs/Shape.md index 9c237eefb048..464bf45c280f 100644 --- a/samples/client/petstore/java/native-async/docs/Shape.md +++ b/samples/client/petstore/java/native-async/docs/Shape.md @@ -3,8 +3,8 @@ # Shape ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native-async/docs/ShapeOrNull.md b/samples/client/petstore/java/native-async/docs/ShapeOrNull.md index 0bb9b8b9025f..31bc51e8e5aa 100644 --- a/samples/client/petstore/java/native-async/docs/ShapeOrNull.md +++ b/samples/client/petstore/java/native-async/docs/ShapeOrNull.md @@ -5,8 +5,8 @@ The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java index a23627bc8c7f..8a98a3e00acc 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Fruit.java @@ -114,7 +114,7 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -148,7 +148,7 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java index 0573c1064128..8b6487cd4a5f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitOrFruits.java @@ -115,7 +115,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -149,7 +149,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -183,7 +183,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -217,7 +217,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java index 31dcae532dfe..548302a14233 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FruitReq.java @@ -114,7 +114,7 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -148,7 +148,7 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java index fd66bad0eacd..27f838e51925 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruit.java @@ -90,7 +90,7 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO // deserialize Apple try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -102,7 +102,7 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO // deserialize Banana try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java index a8212e46a313..175e4287a608 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java @@ -91,7 +91,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize Apple try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -103,7 +103,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize Banana try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -115,7 +115,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize List try { final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -127,7 +127,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize List try { final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java index c2c212fce434..48ea9092cc03 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Mammal.java @@ -117,7 +117,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -151,7 +151,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -185,7 +185,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java index d44b4ad3011a..99e35469923c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NullableShape.java @@ -117,7 +117,7 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -152,7 +152,7 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java index b7a7f9f1f972..4ea1fd3b6f8f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pig.java @@ -116,7 +116,7 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -150,7 +150,7 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java index e01edaac22e3..8d79dbf38757 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -116,7 +116,7 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -150,7 +150,7 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java index 764973fb0984..4edfd1042b64 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Shape.java @@ -116,7 +116,7 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -150,7 +150,7 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java index cbbe1e63bd61..7f8c22ff4d4b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -116,7 +116,7 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -150,7 +150,7 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java index 3d4ef7bf2196..dd3de13203bf 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Triangle.java @@ -117,7 +117,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -151,7 +151,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -185,7 +185,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md b/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md index a271b07800ac..dde7d8de0797 100644 --- a/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md +++ b/samples/client/petstore/java/native-jackson3/docs/FruitOrFruits.md @@ -4,9 +4,9 @@ ## oneOf schemas * [Apple](Apple.md) +* [List<Apple>](Apple.md) * [Banana](Banana.md) -* [List](List.md) -* [List](List.md) +* [List<Banana>](Banana.md) ## Example ```java diff --git a/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md b/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md index 74b1e425d966..3ba095c93714 100644 --- a/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md +++ b/samples/client/petstore/java/native-jackson3/docs/GmFruitOrFruits.md @@ -4,9 +4,9 @@ ## anyOf schemas * [Apple](Apple.md) +* [List<Apple>](Apple.md) * [Banana](Banana.md) -* [List](List.md) -* [List](List.md) +* [List<Banana>](Banana.md) ## Example ```java diff --git a/samples/client/petstore/java/native-jackson3/docs/Mammal.md b/samples/client/petstore/java/native-jackson3/docs/Mammal.md index 11bbff5e2ba9..ab860c23fc24 100644 --- a/samples/client/petstore/java/native-jackson3/docs/Mammal.md +++ b/samples/client/petstore/java/native-jackson3/docs/Mammal.md @@ -3,9 +3,9 @@ # Mammal ## oneOf schemas -* [Pig](Pig.md) * [Whale](Whale.md) * [Zebra](Zebra.md) +* [Pig](Pig.md) ## Example ```java diff --git a/samples/client/petstore/java/native-jackson3/docs/NullableShape.md b/samples/client/petstore/java/native-jackson3/docs/NullableShape.md index 60c45b268406..6870fdd82f5c 100644 --- a/samples/client/petstore/java/native-jackson3/docs/NullableShape.md +++ b/samples/client/petstore/java/native-jackson3/docs/NullableShape.md @@ -5,8 +5,8 @@ The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) NOTE: this class is nullable. diff --git a/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md b/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md index 83ffea0c742f..4e206f422dce 100644 --- a/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md +++ b/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md @@ -3,8 +3,8 @@ # Quadrilateral ## oneOf schemas -* [ComplexQuadrilateral](ComplexQuadrilateral.md) * [SimpleQuadrilateral](SimpleQuadrilateral.md) +* [ComplexQuadrilateral](ComplexQuadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native-jackson3/docs/Shape.md b/samples/client/petstore/java/native-jackson3/docs/Shape.md index 9c237eefb048..464bf45c280f 100644 --- a/samples/client/petstore/java/native-jackson3/docs/Shape.md +++ b/samples/client/petstore/java/native-jackson3/docs/Shape.md @@ -3,8 +3,8 @@ # Shape ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md b/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md index 0bb9b8b9025f..31bc51e8e5aa 100644 --- a/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md +++ b/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md @@ -5,8 +5,8 @@ The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java index ee58961181a2..4aa5b6478f24 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java @@ -114,7 +114,7 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -148,7 +148,7 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java index 79f7b00ddb0d..90d4d7634f27 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitOrFruits.java @@ -115,7 +115,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -149,7 +149,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -183,7 +183,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -217,7 +217,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java index f4bd680da8bb..d516f4f5916a 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -114,7 +114,7 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws J } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -148,7 +148,7 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws J } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java index 13eaa3aa2d5f..9077713e693c 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -91,7 +91,7 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Ja // deserialize Apple try { final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -103,7 +103,7 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws Ja // deserialize Banana try { final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java index 4a4dcc5c7ad4..f6ceee3a679a 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java @@ -92,7 +92,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize Apple try { final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -104,7 +104,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize Banana try { final tools.jackson.core.type.TypeReference candidateRef = new tools.jackson.core.type.TypeReference() {}; - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -116,7 +116,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize List try { final tools.jackson.core.type.TypeReference> candidateRef = new tools.jackson.core.type.TypeReference>() {}; - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -128,7 +128,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize List try { final tools.jackson.core.type.TypeReference> candidateRef = new tools.jackson.core.type.TypeReference>() {}; - deserialized = ctxt.readTreeAsValue(tree, candidateRef.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateRef.getType())); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java index 4bec4e00c970..f2c3a9d55d3d 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java @@ -117,7 +117,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws Jac } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -151,7 +151,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws Jac } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -185,7 +185,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws Jac } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java index 74284393cbc5..6bdd7117628f 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -116,7 +116,7 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -151,7 +151,7 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java index 51899d544467..9240e6fcfb8b 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java @@ -115,7 +115,7 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws Jackso } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -149,7 +149,7 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws Jackso } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java index 60fe7096147e..11828185180c 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -115,7 +115,7 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -149,7 +149,7 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java index 25e383b0bf63..e3ab402dbc75 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java @@ -115,7 +115,7 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -149,7 +149,7 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws Jack } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 0e719e66e623..051741d3ca1e 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -115,7 +115,7 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -149,7 +149,7 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java index 9ae59269fc12..80217e747456 100644 --- a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java @@ -116,7 +116,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws J } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -150,7 +150,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws J } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. @@ -184,7 +184,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws J } } if (attemptParsing) { - deserialized = ctxt.readTreeAsValue(tree, candidateType.getClass()); + deserialized = ctxt.readTreeAsValue(tree, ctxt.constructType(candidateType)); // 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. diff --git a/samples/client/petstore/java/native/docs/FruitOrFruits.md b/samples/client/petstore/java/native/docs/FruitOrFruits.md index a271b07800ac..dde7d8de0797 100644 --- a/samples/client/petstore/java/native/docs/FruitOrFruits.md +++ b/samples/client/petstore/java/native/docs/FruitOrFruits.md @@ -4,9 +4,9 @@ ## oneOf schemas * [Apple](Apple.md) +* [List<Apple>](Apple.md) * [Banana](Banana.md) -* [List](List.md) -* [List](List.md) +* [List<Banana>](Banana.md) ## Example ```java diff --git a/samples/client/petstore/java/native/docs/GmFruitOrFruits.md b/samples/client/petstore/java/native/docs/GmFruitOrFruits.md index 74b1e425d966..3ba095c93714 100644 --- a/samples/client/petstore/java/native/docs/GmFruitOrFruits.md +++ b/samples/client/petstore/java/native/docs/GmFruitOrFruits.md @@ -4,9 +4,9 @@ ## anyOf schemas * [Apple](Apple.md) +* [List<Apple>](Apple.md) * [Banana](Banana.md) -* [List](List.md) -* [List](List.md) +* [List<Banana>](Banana.md) ## Example ```java diff --git a/samples/client/petstore/java/native/docs/Mammal.md b/samples/client/petstore/java/native/docs/Mammal.md index 11bbff5e2ba9..ab860c23fc24 100644 --- a/samples/client/petstore/java/native/docs/Mammal.md +++ b/samples/client/petstore/java/native/docs/Mammal.md @@ -3,9 +3,9 @@ # Mammal ## oneOf schemas -* [Pig](Pig.md) * [Whale](Whale.md) * [Zebra](Zebra.md) +* [Pig](Pig.md) ## Example ```java diff --git a/samples/client/petstore/java/native/docs/NullableShape.md b/samples/client/petstore/java/native/docs/NullableShape.md index 60c45b268406..6870fdd82f5c 100644 --- a/samples/client/petstore/java/native/docs/NullableShape.md +++ b/samples/client/petstore/java/native/docs/NullableShape.md @@ -5,8 +5,8 @@ The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) NOTE: this class is nullable. diff --git a/samples/client/petstore/java/native/docs/Quadrilateral.md b/samples/client/petstore/java/native/docs/Quadrilateral.md index 83ffea0c742f..4e206f422dce 100644 --- a/samples/client/petstore/java/native/docs/Quadrilateral.md +++ b/samples/client/petstore/java/native/docs/Quadrilateral.md @@ -3,8 +3,8 @@ # Quadrilateral ## oneOf schemas -* [ComplexQuadrilateral](ComplexQuadrilateral.md) * [SimpleQuadrilateral](SimpleQuadrilateral.md) +* [ComplexQuadrilateral](ComplexQuadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native/docs/Shape.md b/samples/client/petstore/java/native/docs/Shape.md index 9c237eefb048..464bf45c280f 100644 --- a/samples/client/petstore/java/native/docs/Shape.md +++ b/samples/client/petstore/java/native/docs/Shape.md @@ -3,8 +3,8 @@ # Shape ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native/docs/ShapeOrNull.md b/samples/client/petstore/java/native/docs/ShapeOrNull.md index 0bb9b8b9025f..31bc51e8e5aa 100644 --- a/samples/client/petstore/java/native/docs/ShapeOrNull.md +++ b/samples/client/petstore/java/native/docs/ShapeOrNull.md @@ -5,8 +5,8 @@ The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. ## oneOf schemas -* [Quadrilateral](Quadrilateral.md) * [Triangle](Triangle.md) +* [Quadrilateral](Quadrilateral.md) ## Example ```java diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java index 4e42b519fdab..370779373786 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java @@ -116,7 +116,7 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -150,7 +150,7 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java index e10c70bb5064..670c97ad6fe1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitOrFruits.java @@ -117,7 +117,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -151,7 +151,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -185,7 +185,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -219,7 +219,7 @@ public FruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java index 327340db529f..4b575de72deb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java @@ -116,7 +116,7 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -150,7 +150,7 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java index c44d075f404e..c8ddfb81ffdf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java @@ -92,7 +92,7 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO // deserialize Apple try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; @@ -104,7 +104,7 @@ public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IO // deserialize Banana try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); return ret; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java index 40c929be8a19..d185395994a0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruitOrFruits.java @@ -93,7 +93,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize Apple try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -105,7 +105,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize Banana try { final com.fasterxml.jackson.core.type.TypeReference candidateRef = new com.fasterxml.jackson.core.type.TypeReference() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -117,7 +117,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize List try { final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; @@ -129,7 +129,7 @@ public GmFruitOrFruits deserialize(JsonParser jp, DeserializationContext ctxt) t // deserialize List try { final com.fasterxml.jackson.core.type.TypeReference> candidateRef = new com.fasterxml.jackson.core.type.TypeReference>() {}; - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); GmFruitOrFruits ret = new GmFruitOrFruits(); ret.setActualInstance(deserialized); return ret; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java index 5cbb12123dfd..5c0f93519932 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java @@ -119,7 +119,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -153,7 +153,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -187,7 +187,7 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java index dd48a089e39e..0a781815452b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java @@ -119,7 +119,7 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -154,7 +154,7 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java index 8e922e77e1fd..b4023c12a453 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java @@ -118,7 +118,7 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -152,7 +152,7 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java index 070c9a17e895..25cacf24a47f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -118,7 +118,7 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -152,7 +152,7 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java index 55c88d55bf37..be7c89d16c71 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java @@ -118,7 +118,7 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -152,7 +152,7 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java index e090e9207e3d..38d224f98e77 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -118,7 +118,7 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -152,7 +152,7 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java index 06f3fc3d5e07..8768e5043df4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java @@ -119,7 +119,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -153,7 +153,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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. @@ -187,7 +187,7 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef.getClass()); + deserialized = tree.traverse(jp.getCodec()).readValueAs(candidateRef); // 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.