diff --git a/bin/configs/java-jersey2-8-oas2.yaml b/bin/configs/java-jersey2-8-oas2.yaml index 4d3253e23ee5..12380d7eac2d 100644 --- a/bin/configs/java-jersey2-8-oas2.yaml +++ b/bin/configs/java-jersey2-8-oas2.yaml @@ -4,6 +4,7 @@ library: jersey2 inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: + withXml: true artifactId: petstore-jersey2-java8 hideGenerationTimestamp: true serverPort: "8082" diff --git a/bin/configs/java-jersey2-8.yaml b/bin/configs/java-jersey2-8.yaml index 259b88e07ceb..fa45c492245c 100644 --- a/bin/configs/java-jersey2-8.yaml +++ b/bin/configs/java-jersey2-8.yaml @@ -4,6 +4,7 @@ library: jersey2 inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: + withXml: true artifactId: petstore-openapi3-jersey2-java8 hideGenerationTimestamp: true serverPort: "8082" diff --git a/bin/configs/java-jersey3.yaml b/bin/configs/java-jersey3.yaml index 513f3889d3c7..d3f99584d8de 100644 --- a/bin/configs/java-jersey3.yaml +++ b/bin/configs/java-jersey3.yaml @@ -4,6 +4,7 @@ library: jersey3 inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: + withXml: true useBeanValidation: true artifactId: petstore-jersey3 hideGenerationTimestamp: true diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 59edec001d2d..0d2a81e62fb9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -51,6 +51,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -922,8 +923,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -933,12 +933,19 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index 6184941c80dc..f205e2d0893f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -124,6 +124,14 @@ ext { {{#useReflectionEqualsHashCode}} commons_lang3_version = "3.17.0" {{/useReflectionEqualsHashCode}} + {{#withXml}} + {{#useJakartaEe}} + jaxb_version = "4.0.6" + {{/useJakartaEe}} + {{^useJakartaEe}} + jaxb_version = "2.3.9" + {{/useJakartaEe}} + {{/withXml}} } dependencies { @@ -142,6 +150,13 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + {{#withXml}} + implementation "org.glassfish.jersey.media:jersey-media-jaxb:$jersey_version" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_databind_version" + if (JavaVersion.current().isJava11Compatible()) { + implementation "org.glassfish.jaxb:jaxb-runtime:$jaxb_version" + } + {{/withXml}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index feaa5f58ef0a..573b712afcc6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -255,6 +255,23 @@ + {{#withXml}} + + jaxb-runtime + + + [11,) + + + + + org.glassfish.jaxb + jaxb-runtime + ${jaxb-version} + + + + {{/withXml}} @@ -332,6 +349,13 @@ jersey-media-jaxb ${jersey-version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + ${jackson-databind-version} + {{/withXml}} {{#joda}} @@ -411,10 +435,16 @@ {{#useJakartaEe}} 2.1.1 3.0.2 + {{#withXml}} + 4.0.6 + {{/withXml}} {{/useJakartaEe}} {{^useJakartaEe}} 1.3.5 2.0.2 + {{#withXml}} + 2.3.9 + {{/withXml}} {{/useJakartaEe}} 5.10.0 {{#hasHttpSignatureMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index 68d5f9476bc9..80fd185af7b2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -51,6 +51,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -922,8 +923,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -933,12 +933,19 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 4b29031a8546..29c30e0e3334 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -119,6 +119,14 @@ ext { {{#useReflectionEqualsHashCode}} commons_lang3_version = "3.17.0" {{/useReflectionEqualsHashCode}} + {{#withXml}} + {{#useJakartaEe}} + jaxb_version = "4.0.6" + {{/useJakartaEe}} + {{^useJakartaEe}} + jaxb_version = "2.3.9" + {{/useJakartaEe}} + {{/withXml}} } dependencies { @@ -132,6 +140,13 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + {{#withXml}} + implementation "org.glassfish.jersey.media:jersey-media-jaxb:$jersey_version" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_databind_version" + if (JavaVersion.current().isJava11Compatible()) { + implementation "org.glassfish.jaxb:jaxb-runtime:$jaxb_version" + } + {{/withXml}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache index 75ba090dfff3..af88bcd41974 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache @@ -255,6 +255,23 @@ + {{#withXml}} + + jaxb-runtime + + + [11,) + + + + + org.glassfish.jaxb + jaxb-runtime + ${jaxb-version} + + + + {{/withXml}} @@ -332,6 +349,13 @@ jersey-media-jaxb ${jersey-version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + ${jackson-databind-version} + {{/withXml}} {{#joda}} @@ -411,10 +435,16 @@ {{#useJakartaEe}} 2.1.1 3.0.2 + {{#withXml}} + 4.0.6 + {{/withXml}} {{/useJakartaEe}} {{^useJakartaEe}} 1.3.5 2.0.2 + {{#withXml}} + 2.3.9 + {{/withXml}} {{/useJakartaEe}} 5.10.0 {{#hasHttpSignatureMethods}} diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java index a8f10c8bf5ed..61d4c1df6686 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/jersey2-oneOf-Mixed/src/main/java/org/openapitools/client/ApiClient.java @@ -59,6 +59,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -700,8 +701,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -711,12 +711,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java index a8f10c8bf5ed..61d4c1df6686 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/jersey2-oneOf-duplicates/src/main/java/org/openapitools/client/ApiClient.java @@ -59,6 +59,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -700,8 +701,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -711,12 +711,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java index 827cc999a461..878b2b9e1d24 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java @@ -60,6 +60,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -841,8 +842,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -852,12 +852,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 1626b9f51a08..ff255f94bd4a 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -105,6 +105,7 @@ ext { jersey_version = "2.35" junit_version = "5.8.2" scribejava_apis_version = "8.3.1" + jaxb_version = "2.3.9" } dependencies { @@ -117,6 +118,11 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "org.glassfish.jersey.media:jersey-media-jaxb:$jersey_version" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_databind_version" + if (JavaVersion.current().isJava11Compatible()) { + implementation "org.glassfish.jaxb:jaxb-runtime:$jaxb_version" + } implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index ac6f882f5fff..89c2145b08e2 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -248,6 +248,21 @@ + + jaxb-runtime + + + [11,) + + + + + org.glassfish.jaxb + jaxb-runtime + ${jaxb-version} + + + @@ -302,6 +317,19 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey-version} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + ${jackson-databind-version} + com.fasterxml.jackson.datatype jackson-datatype-jsr310 @@ -340,6 +368,7 @@ 0.2.7 1.3.5 2.0.2 + 2.3.9 5.10.0 8.3.3 2.21.0 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 827cc999a461..878b2b9e1d24 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -60,6 +60,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -841,8 +842,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -852,12 +852,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index a278e8f59447..a382797fca28 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesAnyType") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesAnyType") public class AdditionalPropertiesAnyType { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -58,6 +64,7 @@ public AdditionalPropertiesAnyType name(@javax.annotation.Nullable String name) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -66,6 +73,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 325faf16efa5..e8d49fb38e64 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesArray") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesArray") public class AdditionalPropertiesArray { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -59,6 +65,7 @@ public AdditionalPropertiesArray name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -67,6 +74,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 6a597589ea1b..184d8744bdf6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesBoolean") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesBoolean") public class AdditionalPropertiesBoolean { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -58,6 +64,7 @@ public AdditionalPropertiesBoolean name(@javax.annotation.Nullable String name) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -66,6 +73,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5717fb5ea410..c956cf5352d8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -28,6 +28,8 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -48,48 +50,62 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @XmlElement(name = "map_string") @javax.annotation.Nullable private Map mapString = new HashMap<>(); public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @XmlElement(name = "map_number") @javax.annotation.Nullable private Map mapNumber = new HashMap<>(); public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @XmlElement(name = "map_integer") @javax.annotation.Nullable private Map mapInteger = new HashMap<>(); public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @XmlElement(name = "map_boolean") @javax.annotation.Nullable private Map mapBoolean = new HashMap<>(); public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @XmlElement(name = "map_array_integer") @javax.annotation.Nullable private Map> mapArrayInteger = new HashMap<>(); public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @XmlElement(name = "map_array_anytype") @javax.annotation.Nullable private Map> mapArrayAnytype = new HashMap<>(); public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @XmlElement(name = "map_map_string") @javax.annotation.Nullable private Map> mapMapString = new HashMap<>(); public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @XmlElement(name = "map_map_anytype") @javax.annotation.Nullable private Map> mapMapAnytype = new HashMap<>(); public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @XmlElement(name = "anytype_1") @javax.annotation.Nullable private Object anytype1; public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @XmlElement(name = "anytype_2") @javax.annotation.Nullable private Object anytype2; public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @XmlElement(name = "anytype_3") @javax.annotation.Nullable private Object anytype3; @@ -116,6 +132,8 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapString() { return mapString; @@ -124,6 +142,8 @@ public Map getMapString() { @JsonProperty(value = JSON_PROPERTY_MAP_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapString(@javax.annotation.Nullable Map mapString) { this.mapString = mapString; } @@ -149,6 +169,8 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_number") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapNumber() { return mapNumber; @@ -157,6 +179,8 @@ public Map getMapNumber() { @JsonProperty(value = JSON_PROPERTY_MAP_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_number") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapNumber(@javax.annotation.Nullable Map mapNumber) { this.mapNumber = mapNumber; } @@ -182,6 +206,8 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_integer") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapInteger() { return mapInteger; @@ -190,6 +216,8 @@ public Map getMapInteger() { @JsonProperty(value = JSON_PROPERTY_MAP_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_integer") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapInteger(@javax.annotation.Nullable Map mapInteger) { this.mapInteger = mapInteger; } @@ -215,6 +243,8 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_boolean") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapBoolean() { return mapBoolean; @@ -223,6 +253,8 @@ public Map getMapBoolean() { @JsonProperty(value = JSON_PROPERTY_MAP_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_boolean") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapBoolean(@javax.annotation.Nullable Map mapBoolean) { this.mapBoolean = mapBoolean; } @@ -248,6 +280,8 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -256,6 +290,8 @@ public Map> getMapArrayInteger() { @JsonProperty(value = JSON_PROPERTY_MAP_ARRAY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_array_integer") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapArrayInteger(@javax.annotation.Nullable Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } @@ -281,6 +317,8 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_ARRAY_ANYTYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_array_anytype") + @JacksonXmlElementWrapper(useWrapping = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; @@ -289,6 +327,8 @@ public Map> getMapArrayAnytype() { @JsonProperty(value = JSON_PROPERTY_MAP_ARRAY_ANYTYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_array_anytype") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapArrayAnytype(@javax.annotation.Nullable Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } @@ -314,6 +354,8 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -322,6 +364,8 @@ public Map> getMapMapString() { @JsonProperty(value = JSON_PROPERTY_MAP_MAP_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapMapString(@javax.annotation.Nullable Map> mapMapString) { this.mapMapString = mapMapString; } @@ -347,6 +391,8 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -355,6 +401,8 @@ public Map> getMapMapAnytype() { @JsonProperty(value = JSON_PROPERTY_MAP_MAP_ANYTYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_anytype") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapMapAnytype(@javax.annotation.Nullable Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } @@ -372,6 +420,7 @@ public AdditionalPropertiesClass anytype1(@javax.annotation.Nullable Object anyt @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_1") public Object getAnytype1() { return anytype1; @@ -380,6 +429,7 @@ public Object getAnytype1() { @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_1") public void setAnytype1(@javax.annotation.Nullable Object anytype1) { this.anytype1 = anytype1; } @@ -397,6 +447,7 @@ public AdditionalPropertiesClass anytype2(@javax.annotation.Nullable Object anyt @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_2") public Object getAnytype2() { return anytype2; @@ -405,6 +456,7 @@ public Object getAnytype2() { @JsonProperty(value = JSON_PROPERTY_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_2") public void setAnytype2(@javax.annotation.Nullable Object anytype2) { this.anytype2 = anytype2; } @@ -422,6 +474,7 @@ public AdditionalPropertiesClass anytype3(@javax.annotation.Nullable Object anyt @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANYTYPE3, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_3") public Object getAnytype3() { return anytype3; @@ -430,6 +483,7 @@ public Object getAnytype3() { @JsonProperty(value = JSON_PROPERTY_ANYTYPE3, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_3") public void setAnytype3(@javax.annotation.Nullable Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index cd26ac6cf21a..9d780328db34 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesInteger") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesInteger") public class AdditionalPropertiesInteger { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -58,6 +64,7 @@ public AdditionalPropertiesInteger name(@javax.annotation.Nullable String name) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -66,6 +73,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 9c5adf1a095d..15086334cb85 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,6 +29,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesNumber") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesNumber") public class AdditionalPropertiesNumber { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -59,6 +65,7 @@ public AdditionalPropertiesNumber name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -67,6 +74,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e873492400f6..475cf233ffda 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesObject") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesObject") public class AdditionalPropertiesObject { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -59,6 +65,7 @@ public AdditionalPropertiesObject name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -67,6 +74,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 6f12b33b7add..717159ba3989 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ AdditionalPropertiesString.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesString") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesString") public class AdditionalPropertiesString { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -58,6 +64,7 @@ public AdditionalPropertiesString name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -66,6 +73,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index aa377a8d8c17..e95d83030e6f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -27,6 +27,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -49,12 +51,17 @@ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) +@XmlRootElement(name = "Animal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Animal") public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @javax.annotation.Nonnull private String className; public static final String JSON_PROPERTY_COLOR = "color"; + @XmlElement(name = "color") @javax.annotation.Nullable private String color = "red"; @@ -73,6 +80,7 @@ public Animal className(@javax.annotation.Nonnull String className) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -81,6 +89,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@javax.annotation.Nonnull String className) { this.className = className; } @@ -98,6 +107,7 @@ public Animal color(@javax.annotation.Nullable String color) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") public String getColor() { return color; @@ -106,6 +116,7 @@ public String getColor() { @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") public void setColor(@javax.annotation.Nullable String color) { this.color = color; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 63c874e3bd08..ede932a8c9a0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -27,6 +27,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,8 +39,12 @@ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayOfArrayOfNumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @XmlElement(name = "ArrayArrayNumber") @javax.annotation.Nullable private List> arrayArrayNumber = new ArrayList<>(); @@ -65,6 +71,8 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -73,6 +81,8 @@ public List> getArrayArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayNumber(@javax.annotation.Nullable List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9ab3663a0f5d..965c9bc26aac 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -27,6 +27,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,8 +39,12 @@ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayOfNumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @XmlElement(name = "ArrayNumber") @javax.annotation.Nullable private List arrayNumber = new ArrayList<>(); @@ -65,6 +71,8 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayNumber() { return arrayNumber; @@ -73,6 +81,8 @@ public List getArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayNumber(@javax.annotation.Nullable List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index d13c57eb6ae7..aed67e56696f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -27,6 +27,8 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,16 +41,22 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @XmlElement(name = "array_of_string") @javax.annotation.Nullable private List arrayOfString = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @XmlElement(name = "array_array_of_integer") @javax.annotation.Nullable private List> arrayArrayOfInteger = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @XmlElement(name = "array_array_of_model") @javax.annotation.Nullable private List> arrayArrayOfModel = new ArrayList<>(); @@ -75,6 +83,8 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayOfString() { return arrayOfString; @@ -83,6 +93,8 @@ public List getArrayOfString() { @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayOfString(@javax.annotation.Nullable List arrayOfString) { this.arrayOfString = arrayOfString; } @@ -108,6 +120,8 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_integer") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -116,6 +130,8 @@ public List> getArrayArrayOfInteger() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_integer") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayOfInteger(@javax.annotation.Nullable List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } @@ -141,6 +157,8 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_model") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -149,6 +167,8 @@ public List> getArrayArrayOfModel() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_model") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayOfModel(@javax.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java index c6eb1bf08a0f..300af3e2a1a8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -28,6 +28,8 @@ import java.util.Arrays; import org.openapitools.client.model.Cat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -44,17 +46,26 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@XmlRootElement(name = "BigCat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BigCat") public class BigCat extends Cat { /** * Gets or Sets kind */ + @XmlType(name="KindEnum") + @XmlEnum(String.class) public enum KindEnum { + @XmlEnumValue("lions") LIONS(String.valueOf("lions")), + @XmlEnumValue("tigers") TIGERS(String.valueOf("tigers")), + @XmlEnumValue("leopards") LEOPARDS(String.valueOf("leopards")), + @XmlEnumValue("jaguars") JAGUARS(String.valueOf("jaguars")); private String value; @@ -85,6 +96,7 @@ public static KindEnum fromValue(String value) { } public static final String JSON_PROPERTY_KIND = "kind"; + @XmlElement(name = "kind") @javax.annotation.Nullable private KindEnum kind; @@ -103,6 +115,7 @@ public BigCat kind(@javax.annotation.Nullable KindEnum kind) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_KIND, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "kind") public KindEnum getKind() { return kind; @@ -111,6 +124,7 @@ public KindEnum getKind() { @JsonProperty(value = JSON_PROPERTY_KIND, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "kind") public void setKind(@javax.annotation.Nullable KindEnum kind) { this.kind = kind; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index 0043e03d70d4..3f6b20870f70 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,28 +41,37 @@ Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Capitalization") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Capitalization") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @XmlElement(name = "smallCamel") @javax.annotation.Nullable private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @XmlElement(name = "CapitalCamel") @javax.annotation.Nullable private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @XmlElement(name = "small_Snake") @javax.annotation.Nullable private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @XmlElement(name = "Capital_Snake") @javax.annotation.Nullable private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @XmlElement(name = "SCA_ETH_Flow_Points") @javax.annotation.Nullable private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @XmlElement(name = "ATT_NAME") @javax.annotation.Nullable private String ATT_NAME; @@ -79,6 +90,7 @@ public Capitalization smallCamel(@javax.annotation.Nullable String smallCamel) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") public String getSmallCamel() { return smallCamel; @@ -87,6 +99,7 @@ public String getSmallCamel() { @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") public void setSmallCamel(@javax.annotation.Nullable String smallCamel) { this.smallCamel = smallCamel; } @@ -104,6 +117,7 @@ public Capitalization capitalCamel(@javax.annotation.Nullable String capitalCame @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") public String getCapitalCamel() { return capitalCamel; @@ -112,6 +126,7 @@ public String getCapitalCamel() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") public void setCapitalCamel(@javax.annotation.Nullable String capitalCamel) { this.capitalCamel = capitalCamel; } @@ -129,6 +144,7 @@ public Capitalization smallSnake(@javax.annotation.Nullable String smallSnake) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") public String getSmallSnake() { return smallSnake; @@ -137,6 +153,7 @@ public String getSmallSnake() { @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") public void setSmallSnake(@javax.annotation.Nullable String smallSnake) { this.smallSnake = smallSnake; } @@ -154,6 +171,7 @@ public Capitalization capitalSnake(@javax.annotation.Nullable String capitalSnak @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") public String getCapitalSnake() { return capitalSnake; @@ -162,6 +180,7 @@ public String getCapitalSnake() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") public void setCapitalSnake(@javax.annotation.Nullable String capitalSnake) { this.capitalSnake = capitalSnake; } @@ -179,6 +198,7 @@ public Capitalization scAETHFlowPoints(@javax.annotation.Nullable String scAETHF @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -187,6 +207,7 @@ public String getScAETHFlowPoints() { @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@javax.annotation.Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } @@ -204,6 +225,7 @@ public Capitalization ATT_NAME(@javax.annotation.Nullable String ATT_NAME) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") public String getATTNAME() { return ATT_NAME; @@ -212,6 +234,7 @@ public String getATTNAME() { @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") public void setATTNAME(@javax.annotation.Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 80d60c4ad556..e398d1e51fbc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -28,6 +28,8 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -47,8 +49,12 @@ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) +@XmlRootElement(name = "Cat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Cat") public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @XmlElement(name = "declawed") @javax.annotation.Nullable private Boolean declawed; @@ -67,6 +73,7 @@ public Cat declawed(@javax.annotation.Nullable Boolean declawed) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") public Boolean getDeclawed() { return declawed; @@ -75,6 +82,7 @@ public Boolean getDeclawed() { @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") public void setDeclawed(@javax.annotation.Nullable Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index f0c756ac6374..695cc8f7c011 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,12 +37,17 @@ Category.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Category") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Category") public class Category { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nonnull private String name = "default-name"; @@ -59,6 +66,7 @@ public Category id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -67,6 +75,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -84,6 +93,7 @@ public Category name(@javax.annotation.Nonnull String name) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -92,6 +102,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nonnull String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index ac17b3557ee2..aab8b6bf5d1d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -34,8 +36,12 @@ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ClassModel") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ClassModel") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @XmlElement(name = "_class") @javax.annotation.Nullable private String propertyClass; @@ -54,6 +60,7 @@ public ClassModel propertyClass(@javax.annotation.Nullable String propertyClass) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") public String getPropertyClass() { return propertyClass; @@ -62,6 +69,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index be5e0bfa2b80..f9dbac2cf812 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -34,8 +36,12 @@ Client.JSON_PROPERTY_CLIENT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Client") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Client") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; + @XmlElement(name = "client") @javax.annotation.Nullable private String client; @@ -54,6 +60,7 @@ public Client client(@javax.annotation.Nullable String client) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") public String getClient() { return client; @@ -62,6 +69,7 @@ public String getClient() { @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") public void setClient(@javax.annotation.Nullable String client) { this.client = client; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 4fe34f00c2d5..065b96e22fc4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -28,6 +28,8 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -44,8 +46,12 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@XmlRootElement(name = "Dog") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Dog") public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; + @XmlElement(name = "breed") @javax.annotation.Nullable private String breed; @@ -64,6 +70,7 @@ public Dog breed(@javax.annotation.Nullable String breed) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") public String getBreed() { return breed; @@ -72,6 +79,7 @@ public String getBreed() { @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") public void setBreed(@javax.annotation.Nullable String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index d1bc7b16637d..d678058a3c4c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -26,6 +26,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,13 +39,20 @@ EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EnumArrays") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EnumArrays") public class EnumArrays { /** * Gets or Sets justSymbol */ + @XmlType(name="JustSymbolEnum") + @XmlEnum(String.class) public enum JustSymbolEnum { + @XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), + @XmlEnumValue("$") DOLLAR(String.valueOf("$")); private String value; @@ -74,15 +83,20 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @XmlElement(name = "just_symbol") @javax.annotation.Nullable private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum */ + @XmlType(name="ArrayEnumEnum") + @XmlEnum(String.class) public enum ArrayEnumEnum { + @XmlEnumValue("fish") FISH(String.valueOf("fish")), + @XmlEnumValue("crab") CRAB(String.valueOf("crab")); private String value; @@ -113,6 +127,7 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @XmlElement(name = "array_enum") @javax.annotation.Nullable private List arrayEnum = new ArrayList<>(); @@ -131,6 +146,7 @@ public EnumArrays justSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbo @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -139,6 +155,7 @@ public JustSymbolEnum getJustSymbol() { @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") public void setJustSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } @@ -164,6 +181,8 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_enum") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayEnum() { return arrayEnum; @@ -172,6 +191,8 @@ public List getArrayEnum() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_enum") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayEnum(@javax.annotation.Nullable List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java index 3678af295368..1a2d62666bad 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java @@ -18,6 +18,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -30,10 +32,13 @@ */ public enum EnumClass { + @XmlEnumValue("_abc") _ABC("_abc"), + @XmlEnumValue("-efg") _EFG("-efg"), + @XmlEnumValue("(xyz)") _XYZ_("(xyz)"); private String value; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 2fd6851d5067..ecddd10a61e8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -25,6 +25,8 @@ import java.util.Arrays; import org.openapitools.client.model.OuterEnum; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -40,15 +42,23 @@ }) @JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EnumTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EnumTest") public class EnumTest { /** * Gets or Sets enumString */ + @XmlType(name="EnumStringEnum") + @XmlEnum(String.class) public enum EnumStringEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")), + @XmlEnumValue("") EMPTY(String.valueOf("")); private String value; @@ -79,17 +89,23 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @XmlElement(name = "enum_string") @javax.annotation.Nullable private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired */ + @XmlType(name="EnumStringRequiredEnum") + @XmlEnum(String.class) public enum EnumStringRequiredEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")), + @XmlEnumValue("") EMPTY(String.valueOf("")); private String value; @@ -120,15 +136,20 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @XmlElement(name = "enum_string_required") @javax.annotation.Nonnull private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger */ + @XmlType(name="EnumIntegerEnum") + @XmlEnum(Integer.class) public enum EnumIntegerEnum { + @XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), + @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -159,15 +180,20 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @XmlElement(name = "enum_integer") @javax.annotation.Nullable private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber */ + @XmlType(name="EnumNumberEnum") + @XmlEnum(Double.class) public enum EnumNumberEnum { + @XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), + @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; @@ -198,10 +224,12 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @XmlElement(name = "enum_number") @javax.annotation.Nullable private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @XmlElement(name = "outerEnum") @javax.annotation.Nullable private OuterEnum outerEnum; @@ -220,6 +248,7 @@ public EnumTest enumString(@javax.annotation.Nullable EnumStringEnum enumString) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") public EnumStringEnum getEnumString() { return enumString; @@ -228,6 +257,7 @@ public EnumStringEnum getEnumString() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") public void setEnumString(@javax.annotation.Nullable EnumStringEnum enumString) { this.enumString = enumString; } @@ -245,6 +275,7 @@ public EnumTest enumStringRequired(@javax.annotation.Nonnull EnumStringRequiredE @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; @@ -253,6 +284,7 @@ public EnumStringRequiredEnum getEnumStringRequired() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") public void setEnumStringRequired(@javax.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } @@ -270,6 +302,7 @@ public EnumTest enumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteg @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -278,6 +311,7 @@ public EnumIntegerEnum getEnumInteger() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") public void setEnumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } @@ -295,6 +329,7 @@ public EnumTest enumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -303,6 +338,7 @@ public EnumNumberEnum getEnumNumber() { @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") public void setEnumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @@ -320,6 +356,7 @@ public EnumTest outerEnum(@javax.annotation.Nullable OuterEnum outerEnum) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnum") public OuterEnum getOuterEnum() { return outerEnum; @@ -328,6 +365,7 @@ public OuterEnum getOuterEnum() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnum") public void setOuterEnum(@javax.annotation.Nullable OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 1d78aa1457d0..7b645c832535 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -27,6 +27,8 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,12 +40,17 @@ FileSchemaTestClass.JSON_PROPERTY_FILES }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FileSchemaTestClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FileSchemaTestClass") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; + @XmlElement(name = "file") @javax.annotation.Nullable private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; + @XmlElement(name = "files") @javax.annotation.Nullable private List files = new ArrayList<>(); @@ -62,6 +69,7 @@ public FileSchemaTestClass _file(@javax.annotation.Nullable ModelFile _file) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") public ModelFile getFile() { return _file; @@ -70,6 +78,7 @@ public ModelFile getFile() { @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") public void setFile(@javax.annotation.Nullable ModelFile _file) { this._file = _file; } @@ -95,6 +104,8 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "files") + @JacksonXmlElementWrapper(useWrapping = false) public List getFiles() { return files; @@ -103,6 +114,8 @@ public List getFiles() { @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "files") + @JacksonXmlElementWrapper(useWrapping = false) public void setFiles(@javax.annotation.Nullable List files) { this.files = files; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 307fff67b90d..c949cec93943 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -53,60 +55,77 @@ }) @JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FormatTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FormatTest") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; + @XmlElement(name = "integer") @javax.annotation.Nullable private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; + @XmlElement(name = "int32") @javax.annotation.Nullable private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; + @XmlElement(name = "int64") @javax.annotation.Nullable private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; + @XmlElement(name = "number") @javax.annotation.Nonnull private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; + @XmlElement(name = "float") @javax.annotation.Nullable private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; + @XmlElement(name = "double") @javax.annotation.Nullable private Double _double; public static final String JSON_PROPERTY_STRING = "string"; + @XmlElement(name = "string") @javax.annotation.Nullable private String string; public static final String JSON_PROPERTY_BYTE = "byte"; + @XmlElement(name = "byte") @javax.annotation.Nonnull private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; + @XmlElement(name = "binary") @javax.annotation.Nullable private File binary; public static final String JSON_PROPERTY_DATE = "date"; + @XmlElement(name = "date") @javax.annotation.Nonnull private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @XmlElement(name = "dateTime") @javax.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @javax.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; + @XmlElement(name = "password") @javax.annotation.Nonnull private String password; public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; + @XmlElement(name = "BigDecimal") @javax.annotation.Nullable private BigDecimal bigDecimal; @@ -127,6 +146,7 @@ public FormatTest integer(@javax.annotation.Nullable Integer integer) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") public Integer getInteger() { return integer; @@ -135,6 +155,7 @@ public Integer getInteger() { @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") public void setInteger(@javax.annotation.Nullable Integer integer) { this.integer = integer; } @@ -154,6 +175,7 @@ public FormatTest int32(@javax.annotation.Nullable Integer int32) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") public Integer getInt32() { return int32; @@ -162,6 +184,7 @@ public Integer getInt32() { @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") public void setInt32(@javax.annotation.Nullable Integer int32) { this.int32 = int32; } @@ -179,6 +202,7 @@ public FormatTest int64(@javax.annotation.Nullable Long int64) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") public Long getInt64() { return int64; @@ -187,6 +211,7 @@ public Long getInt64() { @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") public void setInt64(@javax.annotation.Nullable Long int64) { this.int64 = int64; } @@ -206,6 +231,7 @@ public FormatTest number(@javax.annotation.Nonnull BigDecimal number) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") public BigDecimal getNumber() { return number; @@ -214,6 +240,7 @@ public BigDecimal getNumber() { @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") public void setNumber(@javax.annotation.Nonnull BigDecimal number) { this.number = number; } @@ -233,6 +260,7 @@ public FormatTest _float(@javax.annotation.Nullable Float _float) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") public Float getFloat() { return _float; @@ -241,6 +269,7 @@ public Float getFloat() { @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") public void setFloat(@javax.annotation.Nullable Float _float) { this._float = _float; } @@ -260,6 +289,7 @@ public FormatTest _double(@javax.annotation.Nullable Double _double) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") public Double getDouble() { return _double; @@ -268,6 +298,7 @@ public Double getDouble() { @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") public void setDouble(@javax.annotation.Nullable Double _double) { this._double = _double; } @@ -285,6 +316,7 @@ public FormatTest string(@javax.annotation.Nullable String string) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public String getString() { return string; @@ -293,6 +325,7 @@ public String getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public void setString(@javax.annotation.Nullable String string) { this.string = string; } @@ -310,6 +343,7 @@ public FormatTest _byte(@javax.annotation.Nonnull byte[] _byte) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") public byte[] getByte() { return _byte; @@ -318,6 +352,7 @@ public byte[] getByte() { @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") public void setByte(@javax.annotation.Nonnull byte[] _byte) { this._byte = _byte; } @@ -335,6 +370,7 @@ public FormatTest binary(@javax.annotation.Nullable File binary) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") public File getBinary() { return binary; @@ -343,6 +379,7 @@ public File getBinary() { @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") public void setBinary(@javax.annotation.Nullable File binary) { this.binary = binary; } @@ -360,6 +397,7 @@ public FormatTest date(@javax.annotation.Nonnull LocalDate date) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") public LocalDate getDate() { return date; @@ -368,6 +406,7 @@ public LocalDate getDate() { @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") public void setDate(@javax.annotation.Nonnull LocalDate date) { this.date = date; } @@ -385,6 +424,7 @@ public FormatTest dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public OffsetDateTime getDateTime() { return dateTime; @@ -393,6 +433,7 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -410,6 +451,7 @@ public FormatTest uuid(@javax.annotation.Nullable UUID uuid) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public UUID getUuid() { return uuid; @@ -418,6 +460,7 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@javax.annotation.Nullable UUID uuid) { this.uuid = uuid; } @@ -435,6 +478,7 @@ public FormatTest password(@javax.annotation.Nonnull String password) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") public String getPassword() { return password; @@ -443,6 +487,7 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") public void setPassword(@javax.annotation.Nonnull String password) { this.password = password; } @@ -460,6 +505,7 @@ public FormatTest bigDecimal(@javax.annotation.Nullable BigDecimal bigDecimal) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BIG_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "BigDecimal") public BigDecimal getBigDecimal() { return bigDecimal; @@ -468,6 +514,7 @@ public BigDecimal getBigDecimal() { @JsonProperty(value = JSON_PROPERTY_BIG_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "BigDecimal") public void setBigDecimal(@javax.annotation.Nullable BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 69d7a9099e3c..f10562a10927 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,28 +38,23 @@ }) @JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "HasOnlyReadOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "HasOnlyReadOnly") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @javax.annotation.Nullable private String bar; public static final String JSON_PROPERTY_FOO = "foo"; + @XmlElement(name = "foo") @javax.annotation.Nullable private String foo; public HasOnlyReadOnly() { } - @JsonCreator - public HasOnlyReadOnly( - @JsonProperty(JSON_PROPERTY_BAR) String bar, - @JsonProperty(JSON_PROPERTY_FOO) String foo - ) { - this(); - this.bar = bar; - this.foo = foo; - } - /** * Get bar * @return bar @@ -65,6 +62,7 @@ public HasOnlyReadOnly( @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -80,6 +78,7 @@ public String getBar() { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "foo") public String getFoo() { return foo; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index 91ea0552a38c..d160acb6dfb2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,17 +41,25 @@ MapTest.JSON_PROPERTY_INDIRECT_MAP }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MapTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MapTest") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @XmlElement(name = "map_map_of_string") @javax.annotation.Nullable private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner */ + @XmlType(name="InnerEnum") + @XmlEnum(String.class) public enum InnerEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")); private String value; @@ -80,14 +90,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @XmlElement(name = "map_of_enum_string") @javax.annotation.Nullable private Map mapOfEnumString = new HashMap<>(); public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @XmlElement(name = "direct_map") @javax.annotation.Nullable private Map directMap = new HashMap<>(); public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @XmlElement(name = "indirect_map") @javax.annotation.Nullable private Map indirectMap = new HashMap<>(); @@ -114,6 +127,8 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map> getMapMapOfString() { return mapMapOfString; @@ -122,6 +137,8 @@ public Map> getMapMapOfString() { @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapMapOfString(@javax.annotation.Nullable Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } @@ -147,6 +164,8 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_enum_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapOfEnumString() { return mapOfEnumString; @@ -155,6 +174,8 @@ public Map getMapOfEnumString() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_enum_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapOfEnumString(@javax.annotation.Nullable Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } @@ -180,6 +201,8 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "direct_map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getDirectMap() { return directMap; @@ -188,6 +211,8 @@ public Map getDirectMap() { @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "direct_map") + @JacksonXmlElementWrapper(useWrapping = false) public void setDirectMap(@javax.annotation.Nullable Map directMap) { this.directMap = directMap; } @@ -213,6 +238,8 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "indirect_map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getIndirectMap() { return indirectMap; @@ -221,6 +248,8 @@ public Map getIndirectMap() { @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "indirect_map") + @JacksonXmlElementWrapper(useWrapping = false) public void setIndirectMap(@javax.annotation.Nullable Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 444331032736..6ede0ed064b4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -29,6 +29,8 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,16 +43,22 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @javax.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @XmlElement(name = "dateTime") @javax.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; + @XmlElement(name = "map") @javax.annotation.Nullable private Map map = new HashMap<>(); @@ -69,6 +77,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@javax.annotation.Nullab @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public UUID getUuid() { return uuid; @@ -77,6 +86,7 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@javax.annotation.Nullable UUID uuid) { this.uuid = uuid; } @@ -94,6 +104,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@javax.annotation.Nu @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public OffsetDateTime getDateTime() { return dateTime; @@ -102,6 +113,7 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -127,6 +139,8 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMap() { return map; @@ -135,6 +149,8 @@ public Map getMap() { @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map") + @JacksonXmlElementWrapper(useWrapping = false) public void setMap(@javax.annotation.Nullable Map map) { this.map = map; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 41d8942194f7..44caf1d78170 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,12 +38,17 @@ }) @JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Name") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Name") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @XmlElement(name = "class") @javax.annotation.Nullable private String propertyClass; @@ -60,6 +67,7 @@ public Model200Response name(@javax.annotation.Nullable Integer name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public Integer getName() { return name; @@ -68,6 +76,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable Integer name) { this.name = name; } @@ -85,6 +94,7 @@ public Model200Response propertyClass(@javax.annotation.Nullable String property @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") public String getPropertyClass() { return propertyClass; @@ -93,6 +103,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d93e59783b94..c8467867cc5c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,16 +39,22 @@ }) @JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelApiResponse") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelApiResponse") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; + @XmlElement(name = "code") @javax.annotation.Nullable private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; + @XmlElement(name = "type") @javax.annotation.Nullable private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; + @XmlElement(name = "message") @javax.annotation.Nullable private String message; @@ -65,6 +73,7 @@ public ModelApiResponse code(@javax.annotation.Nullable Integer code) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") public Integer getCode() { return code; @@ -73,6 +82,7 @@ public Integer getCode() { @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") public void setCode(@javax.annotation.Nullable Integer code) { this.code = code; } @@ -90,6 +100,7 @@ public ModelApiResponse type(@javax.annotation.Nullable String type) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public String getType() { return type; @@ -98,6 +109,7 @@ public String getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public void setType(@javax.annotation.Nullable String type) { this.type = type; } @@ -115,6 +127,7 @@ public ModelApiResponse message(@javax.annotation.Nullable String message) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") public String getMessage() { return message; @@ -123,6 +136,7 @@ public String getMessage() { @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") public void setMessage(@javax.annotation.Nullable String message) { this.message = message; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index a1b6c7e7bd65..c03c22907345 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,8 +37,12 @@ }) @JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelFile") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelFile") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + @XmlElement(name = "sourceURI") @javax.annotation.Nullable private String sourceURI; @@ -55,6 +61,7 @@ public ModelFile sourceURI(@javax.annotation.Nullable String sourceURI) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") public String getSourceURI() { return sourceURI; @@ -63,6 +70,7 @@ public String getSourceURI() { @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") public void setSourceURI(@javax.annotation.Nullable String sourceURI) { this.sourceURI = sourceURI; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index d781b026876b..9b80addd5419 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,8 +37,12 @@ }) @JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelList") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelList") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; + @XmlElement(name = "123-list") @javax.annotation.Nullable private String _123list; @@ -55,6 +61,7 @@ public ModelList _123list(@javax.annotation.Nullable String _123list) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") public String get123list() { return _123list; @@ -63,6 +70,7 @@ public String get123list() { @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") public void set123list(@javax.annotation.Nullable String _123list) { this._123list = _123list; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 6b9190a99b19..fd19873b72e5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,8 +37,12 @@ }) @JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Return") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Return") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; + @XmlElement(name = "return") @javax.annotation.Nullable private Integer _return; @@ -55,6 +61,7 @@ public ModelReturn _return(@javax.annotation.Nullable Integer _return) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") public Integer getReturn() { return _return; @@ -63,6 +70,7 @@ public Integer getReturn() { @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") public void setReturn(@javax.annotation.Nullable Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 3b142cae47f8..7fda615e38a8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,36 +39,33 @@ Name.JSON_PROPERTY_123NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Name") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Name") public class Name { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nonnull private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @XmlElement(name = "snake_case") @javax.annotation.Nullable private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; + @XmlElement(name = "property") @javax.annotation.Nullable private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @XmlElement(name = "123Number") @javax.annotation.Nullable private Integer _123number; public Name() { } - @JsonCreator - public Name( - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, - @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number - ) { - this(); - this.snakeCase = snakeCase; - this._123number = _123number; - } - public Name name(@javax.annotation.Nonnull Integer name) { this.name = name; return this; @@ -79,6 +78,7 @@ public Name name(@javax.annotation.Nonnull Integer name) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public Integer getName() { return name; @@ -87,6 +87,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nonnull Integer name) { this.name = name; } @@ -99,6 +100,7 @@ public void setName(@javax.annotation.Nonnull Integer name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "snake_case") public Integer getSnakeCase() { return snakeCase; @@ -119,6 +121,7 @@ public Name property(@javax.annotation.Nullable String property) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") public String getProperty() { return property; @@ -127,6 +130,7 @@ public String getProperty() { @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") public void setProperty(@javax.annotation.Nullable String property) { this.property = property; } @@ -139,6 +143,7 @@ public void setProperty(@javax.annotation.Nullable String property) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123Number") public Integer get123number() { return _123number; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index 74b565dba652..83c8f865289f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -25,6 +25,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,8 +37,12 @@ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NumberOnly") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @XmlElement(name = "JustNumber") @javax.annotation.Nullable private BigDecimal justNumber; @@ -55,6 +61,7 @@ public NumberOnly justNumber(@javax.annotation.Nullable BigDecimal justNumber) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") public BigDecimal getJustNumber() { return justNumber; @@ -63,6 +70,7 @@ public BigDecimal getJustNumber() { @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index ec471476285c..5cd7cc6d4cc9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -25,6 +25,8 @@ import java.time.OffsetDateTime; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -40,31 +42,43 @@ Order.JSON_PROPERTY_COMPLETE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Order") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Order") public class Order { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; + @XmlElement(name = "petId") @javax.annotation.Nullable private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @XmlElement(name = "quantity") @javax.annotation.Nullable private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @XmlElement(name = "shipDate") @javax.annotation.Nullable private OffsetDateTime shipDate; /** * Order Status */ + @XmlType(name="StatusEnum") + @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), + @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), + @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); private String value; @@ -95,10 +109,12 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @XmlElement(name = "status") @javax.annotation.Nullable private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; + @XmlElement(name = "complete") @javax.annotation.Nullable private Boolean complete = false; @@ -117,6 +133,7 @@ public Order id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -125,6 +142,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -142,6 +160,7 @@ public Order petId(@javax.annotation.Nullable Long petId) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") public Long getPetId() { return petId; @@ -150,6 +169,7 @@ public Long getPetId() { @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") public void setPetId(@javax.annotation.Nullable Long petId) { this.petId = petId; } @@ -167,6 +187,7 @@ public Order quantity(@javax.annotation.Nullable Integer quantity) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") public Integer getQuantity() { return quantity; @@ -175,6 +196,7 @@ public Integer getQuantity() { @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") public void setQuantity(@javax.annotation.Nullable Integer quantity) { this.quantity = quantity; } @@ -192,6 +214,7 @@ public Order shipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") public OffsetDateTime getShipDate() { return shipDate; @@ -200,6 +223,7 @@ public OffsetDateTime getShipDate() { @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") public void setShipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; } @@ -217,6 +241,7 @@ public Order status(@javax.annotation.Nullable StatusEnum status) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public StatusEnum getStatus() { return status; @@ -225,6 +250,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public void setStatus(@javax.annotation.Nullable StatusEnum status) { this.status = status; } @@ -242,6 +268,7 @@ public Order complete(@javax.annotation.Nullable Boolean complete) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") public Boolean getComplete() { return complete; @@ -250,6 +277,7 @@ public Boolean getComplete() { @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") public void setComplete(@javax.annotation.Nullable Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 56bbc57eb340..d3a886b5f28d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -25,6 +25,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,16 +39,22 @@ OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "OuterComposite") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "OuterComposite") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @XmlElement(name = "my_number") @javax.annotation.Nullable private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @XmlElement(name = "my_string") @javax.annotation.Nullable private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @XmlElement(name = "my_boolean") @javax.annotation.Nullable private Boolean myBoolean; @@ -65,6 +73,7 @@ public OuterComposite myNumber(@javax.annotation.Nullable BigDecimal myNumber) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") public BigDecimal getMyNumber() { return myNumber; @@ -73,6 +82,7 @@ public BigDecimal getMyNumber() { @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") public void setMyNumber(@javax.annotation.Nullable BigDecimal myNumber) { this.myNumber = myNumber; } @@ -90,6 +100,7 @@ public OuterComposite myString(@javax.annotation.Nullable String myString) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") public String getMyString() { return myString; @@ -98,6 +109,7 @@ public String getMyString() { @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") public void setMyString(@javax.annotation.Nullable String myString) { this.myString = myString; } @@ -115,6 +127,7 @@ public OuterComposite myBoolean(@javax.annotation.Nullable Boolean myBoolean) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") public Boolean getMyBoolean() { return myBoolean; @@ -123,6 +136,7 @@ public Boolean getMyBoolean() { @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java index 71524fbd6711..9337d128e725 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -18,6 +18,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -30,10 +32,13 @@ */ public enum OuterEnum { + @XmlEnumValue("placed") PLACED("placed"), + @XmlEnumValue("approved") APPROVED("approved"), + @XmlEnumValue("delivered") DELIVERED("delivered"); private String value; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 5e5007c21cf7..868c3b372009 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -31,6 +31,8 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -46,35 +48,50 @@ Pet.JSON_PROPERTY_STATUS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Pet") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Pet") public class Pet { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; + @XmlElement(name = "Category") @javax.annotation.Nullable private Category category; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nonnull private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrl") @javax.annotation.Nonnull private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; + @XmlElement(name = "Tag") + @XmlElementWrapper(name = "tag") @javax.annotation.Nullable private List tags = new ArrayList<>(); /** * pet status in the store */ + @XmlType(name="StatusEnum") + @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), + @XmlEnumValue("pending") PENDING(String.valueOf("pending")), + @XmlEnumValue("sold") SOLD(String.valueOf("sold")); private String value; @@ -105,6 +122,7 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @XmlElement(name = "status") @javax.annotation.Nullable private StatusEnum status; @@ -123,6 +141,7 @@ public Pet id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -131,6 +150,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -148,6 +168,7 @@ public Pet category(@javax.annotation.Nullable Category category) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Category") public Category getCategory() { return category; @@ -156,6 +177,7 @@ public Category getCategory() { @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Category") public void setCategory(@javax.annotation.Nullable Category category) { this.category = category; } @@ -173,6 +195,7 @@ public Pet name(@javax.annotation.Nonnull String name) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -181,6 +204,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nonnull String name) { this.name = name; } @@ -206,6 +230,8 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public Set getPhotoUrls() { return photoUrls; @@ -215,6 +241,8 @@ public Set getPhotoUrls() { @JsonDeserialize(as = LinkedHashSet.class) @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public void setPhotoUrls(@javax.annotation.Nonnull Set photoUrls) { this.photoUrls = photoUrls; } @@ -240,6 +268,8 @@ public Pet addTagsItem(Tag tagsItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public List getTags() { return tags; @@ -248,6 +278,8 @@ public List getTags() { @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public void setTags(@javax.annotation.Nullable List tags) { this.tags = tags; } @@ -265,6 +297,7 @@ public Pet status(@javax.annotation.Nullable StatusEnum status) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public StatusEnum getStatus() { return status; @@ -273,6 +306,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public void setStatus(@javax.annotation.Nullable StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index cd94f2a5387a..78094e6ab3df 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,26 +37,23 @@ ReadOnlyFirst.JSON_PROPERTY_BAZ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ReadOnlyFirst") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ReadOnlyFirst") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @javax.annotation.Nullable private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; + @XmlElement(name = "baz") @javax.annotation.Nullable private String baz; public ReadOnlyFirst() { } - @JsonCreator - public ReadOnlyFirst( - @JsonProperty(JSON_PROPERTY_BAR) String bar - ) { - this(); - this.bar = bar; - } - /** * Get bar * @return bar @@ -62,6 +61,7 @@ public ReadOnlyFirst( @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -82,6 +82,7 @@ public ReadOnlyFirst baz(@javax.annotation.Nullable String baz) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") public String getBaz() { return baz; @@ -90,6 +91,7 @@ public String getBaz() { @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") public void setBaz(@javax.annotation.Nullable String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index d00f2fd6e1b3..14d32bdcfcfb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,8 +37,12 @@ }) @JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "$special[model.name]") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "$special[model.name]") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @XmlElement(name = "$special[property.name]") @javax.annotation.Nullable private Long $specialPropertyName; @@ -55,6 +61,7 @@ public SpecialModelName() { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; @@ -63,6 +70,7 @@ public SpecialModelName() { @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") public void set$SpecialPropertyName(@javax.annotation.Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 8f1438abd7c3..5d00eeffc2c7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -35,12 +37,17 @@ Tag.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Tag") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Tag") public class Tag { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -59,6 +66,7 @@ public Tag id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -67,6 +75,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -84,6 +93,7 @@ public Tag name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -92,6 +102,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 12ac3c998893..4225c3eacccd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -27,6 +27,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,24 +43,32 @@ TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "TypeHolderDefault") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TypeHolderDefault") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @XmlElement(name = "string_item") @javax.annotation.Nonnull private String stringItem = "what"; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @XmlElement(name = "number_item") @javax.annotation.Nonnull private BigDecimal numberItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @XmlElement(name = "integer_item") @javax.annotation.Nonnull private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @XmlElement(name = "bool_item") @javax.annotation.Nonnull private Boolean boolItem = true; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @XmlElement(name = "array_item") @javax.annotation.Nonnull private List arrayItem = new ArrayList<>(); @@ -77,6 +87,7 @@ public TypeHolderDefault stringItem(@javax.annotation.Nonnull String stringItem) @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_STRING_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "string_item") public String getStringItem() { return stringItem; @@ -85,6 +96,7 @@ public String getStringItem() { @JsonProperty(value = JSON_PROPERTY_STRING_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "string_item") public void setStringItem(@javax.annotation.Nonnull String stringItem) { this.stringItem = stringItem; } @@ -102,6 +114,7 @@ public TypeHolderDefault numberItem(@javax.annotation.Nonnull BigDecimal numberI @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NUMBER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number_item") public BigDecimal getNumberItem() { return numberItem; @@ -110,6 +123,7 @@ public BigDecimal getNumberItem() { @JsonProperty(value = JSON_PROPERTY_NUMBER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number_item") public void setNumberItem(@javax.annotation.Nonnull BigDecimal numberItem) { this.numberItem = numberItem; } @@ -127,6 +141,7 @@ public TypeHolderDefault integerItem(@javax.annotation.Nonnull Integer integerIt @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_INTEGER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "integer_item") public Integer getIntegerItem() { return integerItem; @@ -135,6 +150,7 @@ public Integer getIntegerItem() { @JsonProperty(value = JSON_PROPERTY_INTEGER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "integer_item") public void setIntegerItem(@javax.annotation.Nonnull Integer integerItem) { this.integerItem = integerItem; } @@ -152,6 +168,7 @@ public TypeHolderDefault boolItem(@javax.annotation.Nonnull Boolean boolItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BOOL_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "bool_item") public Boolean getBoolItem() { return boolItem; @@ -160,6 +177,7 @@ public Boolean getBoolItem() { @JsonProperty(value = JSON_PROPERTY_BOOL_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "bool_item") public void setBoolItem(@javax.annotation.Nonnull Boolean boolItem) { this.boolItem = boolItem; } @@ -185,6 +203,8 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "array_item") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayItem() { return arrayItem; @@ -193,6 +213,8 @@ public List getArrayItem() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "array_item") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayItem(@javax.annotation.Nonnull List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 50fb06cbf3ae..a6fb82da854b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -27,6 +27,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -42,28 +44,37 @@ TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "TypeHolderExample") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TypeHolderExample") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @XmlElement(name = "string_item") @javax.annotation.Nonnull private String stringItem; public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @XmlElement(name = "number_item") @javax.annotation.Nonnull private BigDecimal numberItem; public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + @XmlElement(name = "float_item") @javax.annotation.Nonnull private Float floatItem; public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @XmlElement(name = "integer_item") @javax.annotation.Nonnull private Integer integerItem; public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @XmlElement(name = "bool_item") @javax.annotation.Nonnull private Boolean boolItem; public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @XmlElement(name = "array_item") @javax.annotation.Nonnull private List arrayItem = new ArrayList<>(); @@ -82,6 +93,7 @@ public TypeHolderExample stringItem(@javax.annotation.Nonnull String stringItem) @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_STRING_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "string_item") public String getStringItem() { return stringItem; @@ -90,6 +102,7 @@ public String getStringItem() { @JsonProperty(value = JSON_PROPERTY_STRING_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "string_item") public void setStringItem(@javax.annotation.Nonnull String stringItem) { this.stringItem = stringItem; } @@ -107,6 +120,7 @@ public TypeHolderExample numberItem(@javax.annotation.Nonnull BigDecimal numberI @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NUMBER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number_item") public BigDecimal getNumberItem() { return numberItem; @@ -115,6 +129,7 @@ public BigDecimal getNumberItem() { @JsonProperty(value = JSON_PROPERTY_NUMBER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number_item") public void setNumberItem(@javax.annotation.Nonnull BigDecimal numberItem) { this.numberItem = numberItem; } @@ -132,6 +147,7 @@ public TypeHolderExample floatItem(@javax.annotation.Nonnull Float floatItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_FLOAT_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "float_item") public Float getFloatItem() { return floatItem; @@ -140,6 +156,7 @@ public Float getFloatItem() { @JsonProperty(value = JSON_PROPERTY_FLOAT_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "float_item") public void setFloatItem(@javax.annotation.Nonnull Float floatItem) { this.floatItem = floatItem; } @@ -157,6 +174,7 @@ public TypeHolderExample integerItem(@javax.annotation.Nonnull Integer integerIt @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_INTEGER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "integer_item") public Integer getIntegerItem() { return integerItem; @@ -165,6 +183,7 @@ public Integer getIntegerItem() { @JsonProperty(value = JSON_PROPERTY_INTEGER_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "integer_item") public void setIntegerItem(@javax.annotation.Nonnull Integer integerItem) { this.integerItem = integerItem; } @@ -182,6 +201,7 @@ public TypeHolderExample boolItem(@javax.annotation.Nonnull Boolean boolItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BOOL_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "bool_item") public Boolean getBoolItem() { return boolItem; @@ -190,6 +210,7 @@ public Boolean getBoolItem() { @JsonProperty(value = JSON_PROPERTY_BOOL_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "bool_item") public void setBoolItem(@javax.annotation.Nonnull Boolean boolItem) { this.boolItem = boolItem; } @@ -215,6 +236,8 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "array_item") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayItem() { return arrayItem; @@ -223,6 +246,8 @@ public List getArrayItem() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "array_item") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayItem(@javax.annotation.Nonnull List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index c1c068e3bb04..b9e2343c5a6e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,36 +43,47 @@ User.JSON_PROPERTY_USER_STATUS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "User") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "User") public class User { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; + @XmlElement(name = "username") @javax.annotation.Nullable private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @XmlElement(name = "firstName") @javax.annotation.Nullable private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @XmlElement(name = "lastName") @javax.annotation.Nullable private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; + @XmlElement(name = "email") @javax.annotation.Nullable private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; + @XmlElement(name = "password") @javax.annotation.Nullable private String password; public static final String JSON_PROPERTY_PHONE = "phone"; + @XmlElement(name = "phone") @javax.annotation.Nullable private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @XmlElement(name = "userStatus") @javax.annotation.Nullable private Integer userStatus; @@ -89,6 +102,7 @@ public User id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -97,6 +111,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -114,6 +129,7 @@ public User username(@javax.annotation.Nullable String username) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") public String getUsername() { return username; @@ -122,6 +138,7 @@ public String getUsername() { @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") public void setUsername(@javax.annotation.Nullable String username) { this.username = username; } @@ -139,6 +156,7 @@ public User firstName(@javax.annotation.Nullable String firstName) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") public String getFirstName() { return firstName; @@ -147,6 +165,7 @@ public String getFirstName() { @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") public void setFirstName(@javax.annotation.Nullable String firstName) { this.firstName = firstName; } @@ -164,6 +183,7 @@ public User lastName(@javax.annotation.Nullable String lastName) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") public String getLastName() { return lastName; @@ -172,6 +192,7 @@ public String getLastName() { @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") public void setLastName(@javax.annotation.Nullable String lastName) { this.lastName = lastName; } @@ -189,6 +210,7 @@ public User email(@javax.annotation.Nullable String email) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") public String getEmail() { return email; @@ -197,6 +219,7 @@ public String getEmail() { @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") public void setEmail(@javax.annotation.Nullable String email) { this.email = email; } @@ -214,6 +237,7 @@ public User password(@javax.annotation.Nullable String password) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") public String getPassword() { return password; @@ -222,6 +246,7 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") public void setPassword(@javax.annotation.Nullable String password) { this.password = password; } @@ -239,6 +264,7 @@ public User phone(@javax.annotation.Nullable String phone) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") public String getPhone() { return phone; @@ -247,6 +273,7 @@ public String getPhone() { @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") public void setPhone(@javax.annotation.Nullable String phone) { this.phone = phone; } @@ -264,6 +291,7 @@ public User userStatus(@javax.annotation.Nullable Integer userStatus) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") public Integer getUserStatus() { return userStatus; @@ -272,6 +300,7 @@ public Integer getUserStatus() { @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") public void setUserStatus(@javax.annotation.Nullable Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index 4d0650989307..d0a072ffa5a2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -27,6 +27,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -65,120 +67,157 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(namespace="http://a.com/schema", name = "XmlItem") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(namespace="http://a.com/schema", localName = "XmlItem") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @XmlAttribute(name = "attribute_string") @javax.annotation.Nullable private String attributeString; public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @XmlAttribute(name = "attribute_number") @javax.annotation.Nullable private BigDecimal attributeNumber; public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @XmlAttribute(name = "attribute_integer") @javax.annotation.Nullable private Integer attributeInteger; public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @XmlAttribute(name = "attribute_boolean") @javax.annotation.Nullable private Boolean attributeBoolean; public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @XmlElement(name = "wrapped_array") + @XmlElementWrapper(name = "wrapped_array") @javax.annotation.Nullable private List wrappedArray = new ArrayList<>(); public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @XmlElement(name = "xml_name_string") @javax.annotation.Nullable private String nameString; public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @XmlElement(name = "xml_name_number") @javax.annotation.Nullable private BigDecimal nameNumber; public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @XmlElement(name = "xml_name_integer") @javax.annotation.Nullable private Integer nameInteger; public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @XmlElement(name = "xml_name_boolean") @javax.annotation.Nullable private Boolean nameBoolean; public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @XmlElement(name = "xml_name_array_item") @javax.annotation.Nullable private List nameArray = new ArrayList<>(); public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @XmlElement(name = "xml_name_wrapped_array_item") + @XmlElementWrapper(name = "xml_name_wrapped_array") @javax.annotation.Nullable private List nameWrappedArray = new ArrayList<>(); public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @XmlElement(name = "prefix_string") @javax.annotation.Nullable private String prefixString; public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @XmlElement(name = "prefix_number") @javax.annotation.Nullable private BigDecimal prefixNumber; public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @XmlElement(name = "prefix_integer") @javax.annotation.Nullable private Integer prefixInteger; public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @XmlElement(name = "prefix_boolean") @javax.annotation.Nullable private Boolean prefixBoolean; public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @XmlElement(name = "prefix_array") @javax.annotation.Nullable private List prefixArray = new ArrayList<>(); public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @XmlElement(name = "prefix_wrapped_array") + @XmlElementWrapper(name = "prefix_wrapped_array") @javax.annotation.Nullable private List prefixWrappedArray = new ArrayList<>(); public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @XmlElement(name = "namespace_string", namespace = "http://a.com/schema") @javax.annotation.Nullable private String namespaceString; public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @XmlElement(name = "namespace_number", namespace = "http://b.com/schema") @javax.annotation.Nullable private BigDecimal namespaceNumber; public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @XmlElement(name = "namespace_integer", namespace = "http://c.com/schema") @javax.annotation.Nullable private Integer namespaceInteger; public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @XmlElement(name = "namespace_boolean", namespace = "http://d.com/schema") @javax.annotation.Nullable private Boolean namespaceBoolean; public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @XmlElement(name = "namespace_array") @javax.annotation.Nullable private List namespaceArray = new ArrayList<>(); public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @XmlElement(name = "namespace_wrapped_array", namespace = "http://f.com/schema") + @XmlElementWrapper(name = "namespace_wrapped_array", namespace = "http://f.com/schema") @javax.annotation.Nullable private List namespaceWrappedArray = new ArrayList<>(); public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @XmlElement(name = "prefix_ns_string", namespace = "http://a.com/schema") @javax.annotation.Nullable private String prefixNsString; public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @XmlElement(name = "prefix_ns_number", namespace = "http://b.com/schema") @javax.annotation.Nullable private BigDecimal prefixNsNumber; public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @XmlElement(name = "prefix_ns_integer", namespace = "http://c.com/schema") @javax.annotation.Nullable private Integer prefixNsInteger; public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @XmlElement(name = "prefix_ns_boolean", namespace = "http://d.com/schema") @javax.annotation.Nullable private Boolean prefixNsBoolean; public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @XmlElement(name = "prefix_ns_array") @javax.annotation.Nullable private List prefixNsArray = new ArrayList<>(); public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @XmlElement(name = "prefix_ns_wrapped_array", namespace = "http://f.com/schema") + @XmlElementWrapper(name = "prefix_ns_wrapped_array", namespace = "http://f.com/schema") @javax.annotation.Nullable private List prefixNsWrappedArray = new ArrayList<>(); @@ -197,6 +236,7 @@ public XmlItem attributeString(@javax.annotation.Nullable String attributeString @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_string", isAttribute = true) public String getAttributeString() { return attributeString; @@ -205,6 +245,7 @@ public String getAttributeString() { @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_string", isAttribute = true) public void setAttributeString(@javax.annotation.Nullable String attributeString) { this.attributeString = attributeString; } @@ -222,6 +263,7 @@ public XmlItem attributeNumber(@javax.annotation.Nullable BigDecimal attributeNu @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_number", isAttribute = true) public BigDecimal getAttributeNumber() { return attributeNumber; @@ -230,6 +272,7 @@ public BigDecimal getAttributeNumber() { @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_number", isAttribute = true) public void setAttributeNumber(@javax.annotation.Nullable BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } @@ -247,6 +290,7 @@ public XmlItem attributeInteger(@javax.annotation.Nullable Integer attributeInte @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_integer", isAttribute = true) public Integer getAttributeInteger() { return attributeInteger; @@ -255,6 +299,7 @@ public Integer getAttributeInteger() { @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_integer", isAttribute = true) public void setAttributeInteger(@javax.annotation.Nullable Integer attributeInteger) { this.attributeInteger = attributeInteger; } @@ -272,6 +317,7 @@ public XmlItem attributeBoolean(@javax.annotation.Nullable Boolean attributeBool @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_boolean", isAttribute = true) public Boolean getAttributeBoolean() { return attributeBoolean; @@ -280,6 +326,7 @@ public Boolean getAttributeBoolean() { @JsonProperty(value = JSON_PROPERTY_ATTRIBUTE_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "attribute_boolean", isAttribute = true) public void setAttributeBoolean(@javax.annotation.Nullable Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } @@ -305,6 +352,8 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "wrapped_array") + @JacksonXmlElementWrapper(localName = "wrapped_array", useWrapping = true) public List getWrappedArray() { return wrappedArray; @@ -313,6 +362,8 @@ public List getWrappedArray() { @JsonProperty(value = JSON_PROPERTY_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "wrapped_array") + @JacksonXmlElementWrapper(localName = "wrapped_array", useWrapping = true) public void setWrappedArray(@javax.annotation.Nullable List wrappedArray) { this.wrappedArray = wrappedArray; } @@ -330,6 +381,7 @@ public XmlItem nameString(@javax.annotation.Nullable String nameString) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_string") public String getNameString() { return nameString; @@ -338,6 +390,7 @@ public String getNameString() { @JsonProperty(value = JSON_PROPERTY_NAME_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_string") public void setNameString(@javax.annotation.Nullable String nameString) { this.nameString = nameString; } @@ -355,6 +408,7 @@ public XmlItem nameNumber(@javax.annotation.Nullable BigDecimal nameNumber) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_number") public BigDecimal getNameNumber() { return nameNumber; @@ -363,6 +417,7 @@ public BigDecimal getNameNumber() { @JsonProperty(value = JSON_PROPERTY_NAME_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_number") public void setNameNumber(@javax.annotation.Nullable BigDecimal nameNumber) { this.nameNumber = nameNumber; } @@ -380,6 +435,7 @@ public XmlItem nameInteger(@javax.annotation.Nullable Integer nameInteger) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_integer") public Integer getNameInteger() { return nameInteger; @@ -388,6 +444,7 @@ public Integer getNameInteger() { @JsonProperty(value = JSON_PROPERTY_NAME_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_integer") public void setNameInteger(@javax.annotation.Nullable Integer nameInteger) { this.nameInteger = nameInteger; } @@ -405,6 +462,7 @@ public XmlItem nameBoolean(@javax.annotation.Nullable Boolean nameBoolean) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_boolean") public Boolean getNameBoolean() { return nameBoolean; @@ -413,6 +471,7 @@ public Boolean getNameBoolean() { @JsonProperty(value = JSON_PROPERTY_NAME_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_boolean") public void setNameBoolean(@javax.annotation.Nullable Boolean nameBoolean) { this.nameBoolean = nameBoolean; } @@ -438,6 +497,8 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_array_item") + @JacksonXmlElementWrapper(useWrapping = false) public List getNameArray() { return nameArray; @@ -446,6 +507,8 @@ public List getNameArray() { @JsonProperty(value = JSON_PROPERTY_NAME_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_array_item") + @JacksonXmlElementWrapper(useWrapping = false) public void setNameArray(@javax.annotation.Nullable List nameArray) { this.nameArray = nameArray; } @@ -471,6 +534,8 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_wrapped_array_item") + @JacksonXmlElementWrapper(localName = "xml_name_wrapped_array", useWrapping = true) public List getNameWrappedArray() { return nameWrappedArray; @@ -479,6 +544,8 @@ public List getNameWrappedArray() { @JsonProperty(value = JSON_PROPERTY_NAME_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "xml_name_wrapped_array_item") + @JacksonXmlElementWrapper(localName = "xml_name_wrapped_array", useWrapping = true) public void setNameWrappedArray(@javax.annotation.Nullable List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } @@ -496,6 +563,7 @@ public XmlItem prefixString(@javax.annotation.Nullable String prefixString) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_string") public String getPrefixString() { return prefixString; @@ -504,6 +572,7 @@ public String getPrefixString() { @JsonProperty(value = JSON_PROPERTY_PREFIX_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_string") public void setPrefixString(@javax.annotation.Nullable String prefixString) { this.prefixString = prefixString; } @@ -521,6 +590,7 @@ public XmlItem prefixNumber(@javax.annotation.Nullable BigDecimal prefixNumber) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_number") public BigDecimal getPrefixNumber() { return prefixNumber; @@ -529,6 +599,7 @@ public BigDecimal getPrefixNumber() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_number") public void setPrefixNumber(@javax.annotation.Nullable BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } @@ -546,6 +617,7 @@ public XmlItem prefixInteger(@javax.annotation.Nullable Integer prefixInteger) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_integer") public Integer getPrefixInteger() { return prefixInteger; @@ -554,6 +626,7 @@ public Integer getPrefixInteger() { @JsonProperty(value = JSON_PROPERTY_PREFIX_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_integer") public void setPrefixInteger(@javax.annotation.Nullable Integer prefixInteger) { this.prefixInteger = prefixInteger; } @@ -571,6 +644,7 @@ public XmlItem prefixBoolean(@javax.annotation.Nullable Boolean prefixBoolean) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; @@ -579,6 +653,7 @@ public Boolean getPrefixBoolean() { @JsonProperty(value = JSON_PROPERTY_PREFIX_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_boolean") public void setPrefixBoolean(@javax.annotation.Nullable Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } @@ -604,6 +679,8 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_array") + @JacksonXmlElementWrapper(useWrapping = false) public List getPrefixArray() { return prefixArray; @@ -612,6 +689,8 @@ public List getPrefixArray() { @JsonProperty(value = JSON_PROPERTY_PREFIX_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_array") + @JacksonXmlElementWrapper(useWrapping = false) public void setPrefixArray(@javax.annotation.Nullable List prefixArray) { this.prefixArray = prefixArray; } @@ -637,6 +716,8 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_wrapped_array") + @JacksonXmlElementWrapper(localName = "prefix_wrapped_array", useWrapping = true) public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -645,6 +726,8 @@ public List getPrefixWrappedArray() { @JsonProperty(value = JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_wrapped_array") + @JacksonXmlElementWrapper(localName = "prefix_wrapped_array", useWrapping = true) public void setPrefixWrappedArray(@javax.annotation.Nullable List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } @@ -662,6 +745,7 @@ public XmlItem namespaceString(@javax.annotation.Nullable String namespaceString @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAMESPACE_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_string", namespace = "http://a.com/schema") public String getNamespaceString() { return namespaceString; @@ -670,6 +754,7 @@ public String getNamespaceString() { @JsonProperty(value = JSON_PROPERTY_NAMESPACE_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_string", namespace = "http://a.com/schema") public void setNamespaceString(@javax.annotation.Nullable String namespaceString) { this.namespaceString = namespaceString; } @@ -687,6 +772,7 @@ public XmlItem namespaceNumber(@javax.annotation.Nullable BigDecimal namespaceNu @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAMESPACE_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_number", namespace = "http://b.com/schema") public BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -695,6 +781,7 @@ public BigDecimal getNamespaceNumber() { @JsonProperty(value = JSON_PROPERTY_NAMESPACE_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_number", namespace = "http://b.com/schema") public void setNamespaceNumber(@javax.annotation.Nullable BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } @@ -712,6 +799,7 @@ public XmlItem namespaceInteger(@javax.annotation.Nullable Integer namespaceInte @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAMESPACE_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_integer", namespace = "http://c.com/schema") public Integer getNamespaceInteger() { return namespaceInteger; @@ -720,6 +808,7 @@ public Integer getNamespaceInteger() { @JsonProperty(value = JSON_PROPERTY_NAMESPACE_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_integer", namespace = "http://c.com/schema") public void setNamespaceInteger(@javax.annotation.Nullable Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } @@ -737,6 +826,7 @@ public XmlItem namespaceBoolean(@javax.annotation.Nullable Boolean namespaceBool @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAMESPACE_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_boolean", namespace = "http://d.com/schema") public Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -745,6 +835,7 @@ public Boolean getNamespaceBoolean() { @JsonProperty(value = JSON_PROPERTY_NAMESPACE_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_boolean", namespace = "http://d.com/schema") public void setNamespaceBoolean(@javax.annotation.Nullable Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } @@ -770,6 +861,8 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAMESPACE_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_array") + @JacksonXmlElementWrapper(useWrapping = false) public List getNamespaceArray() { return namespaceArray; @@ -778,6 +871,8 @@ public List getNamespaceArray() { @JsonProperty(value = JSON_PROPERTY_NAMESPACE_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_array") + @JacksonXmlElementWrapper(useWrapping = false) public void setNamespaceArray(@javax.annotation.Nullable List namespaceArray) { this.namespaceArray = namespaceArray; } @@ -803,6 +898,8 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_wrapped_array", namespace = "http://f.com/schema") + @JacksonXmlElementWrapper(localName = "namespace_wrapped_array", namespace = "http://f.com/schema", useWrapping = true) public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -811,6 +908,8 @@ public List getNamespaceWrappedArray() { @JsonProperty(value = JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "namespace_wrapped_array", namespace = "http://f.com/schema") + @JacksonXmlElementWrapper(localName = "namespace_wrapped_array", namespace = "http://f.com/schema", useWrapping = true) public void setNamespaceWrappedArray(@javax.annotation.Nullable List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } @@ -828,6 +927,7 @@ public XmlItem prefixNsString(@javax.annotation.Nullable String prefixNsString) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_string", namespace = "http://a.com/schema") public String getPrefixNsString() { return prefixNsString; @@ -836,6 +936,7 @@ public String getPrefixNsString() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_string", namespace = "http://a.com/schema") public void setPrefixNsString(@javax.annotation.Nullable String prefixNsString) { this.prefixNsString = prefixNsString; } @@ -853,6 +954,7 @@ public XmlItem prefixNsNumber(@javax.annotation.Nullable BigDecimal prefixNsNumb @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_number", namespace = "http://b.com/schema") public BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -861,6 +963,7 @@ public BigDecimal getPrefixNsNumber() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_number", namespace = "http://b.com/schema") public void setPrefixNsNumber(@javax.annotation.Nullable BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } @@ -878,6 +981,7 @@ public XmlItem prefixNsInteger(@javax.annotation.Nullable Integer prefixNsIntege @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_integer", namespace = "http://c.com/schema") public Integer getPrefixNsInteger() { return prefixNsInteger; @@ -886,6 +990,7 @@ public Integer getPrefixNsInteger() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_integer", namespace = "http://c.com/schema") public void setPrefixNsInteger(@javax.annotation.Nullable Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } @@ -903,6 +1008,7 @@ public XmlItem prefixNsBoolean(@javax.annotation.Nullable Boolean prefixNsBoolea @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_boolean", namespace = "http://d.com/schema") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -911,6 +1017,7 @@ public Boolean getPrefixNsBoolean() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_boolean", namespace = "http://d.com/schema") public void setPrefixNsBoolean(@javax.annotation.Nullable Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } @@ -936,6 +1043,8 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_array") + @JacksonXmlElementWrapper(useWrapping = false) public List getPrefixNsArray() { return prefixNsArray; @@ -944,6 +1053,8 @@ public List getPrefixNsArray() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_array") + @JacksonXmlElementWrapper(useWrapping = false) public void setPrefixNsArray(@javax.annotation.Nullable List prefixNsArray) { this.prefixNsArray = prefixNsArray; } @@ -969,6 +1080,8 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_wrapped_array", namespace = "http://f.com/schema") + @JacksonXmlElementWrapper(localName = "prefix_ns_wrapped_array", namespace = "http://f.com/schema", useWrapping = true) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; @@ -977,6 +1090,8 @@ public List getPrefixNsWrappedArray() { @JsonProperty(value = JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "prefix_ns_wrapped_array", namespace = "http://f.com/schema") + @JacksonXmlElementWrapper(localName = "prefix_ns_wrapped_array", namespace = "http://f.com/schema", useWrapping = true) public void setPrefixNsWrappedArray(@javax.annotation.Nullable List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java index e67f9023ed9a..f694c501785c 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java @@ -59,6 +59,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -700,8 +701,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -711,12 +711,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index c09c64c2863e..b56ce0c96b1e 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -109,6 +109,7 @@ ext { scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" commons_lang3_version = "3.17.0" + jaxb_version = "4.0.6" } dependencies { @@ -122,6 +123,11 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "org.glassfish.jersey.media:jersey-media-jaxb:$jersey_version" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_databind_version" + if (JavaVersion.current().isJava11Compatible()) { + implementation "org.glassfish.jaxb:jaxb-runtime:$jaxb_version" + } implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index 158ad60f29be..770b052f53bc 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -248,6 +248,21 @@ + + jaxb-runtime + + + [11,) + + + + + org.glassfish.jaxb + jaxb-runtime + ${jaxb-version} + + + @@ -302,6 +317,19 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey-version} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + ${jackson-databind-version} + com.fasterxml.jackson.datatype jackson-datatype-jsr310 @@ -358,6 +386,7 @@ 0.2.7 2.1.1 3.0.2 + 4.0.6 5.10.0 1.8 8.3.3 diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 3ff3205ed5c5..37f9f83b2b3d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -60,6 +60,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -923,8 +924,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -934,12 +934,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 27cc9bb20c74..27307a43a281 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -32,6 +32,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,35 +53,46 @@ AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + @XmlElement(name = "map_property") @jakarta.annotation.Nullable private Map mapProperty = new HashMap<>(); public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + @XmlElement(name = "map_of_map_property") @jakarta.annotation.Nullable private Map> mapOfMapProperty = new HashMap<>(); public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @XmlElement(name = "anytype_1") private JsonNullable anytype1 = JsonNullable.of(null); public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; + @XmlElement(name = "map_with_undeclared_properties_anytype_1") @jakarta.annotation.Nullable private Object mapWithUndeclaredPropertiesAnytype1; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; + @XmlElement(name = "map_with_undeclared_properties_anytype_2") @jakarta.annotation.Nullable private Object mapWithUndeclaredPropertiesAnytype2; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; + @XmlElement(name = "map_with_undeclared_properties_anytype_3") @jakarta.annotation.Nullable private Map mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; + @XmlElement(name = "empty_map") @jakarta.annotation.Nullable private Object emptyMap; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; + @XmlElement(name = "map_with_undeclared_properties_string") @jakarta.annotation.Nullable private Map mapWithUndeclaredPropertiesString = new HashMap<>(); @@ -107,6 +120,8 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_property") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapProperty() { return mapProperty; @@ -115,6 +130,8 @@ public Map getMapProperty() { @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_property") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapProperty(@jakarta.annotation.Nullable Map mapProperty) { this.mapProperty = mapProperty; } @@ -142,6 +159,8 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; @@ -150,6 +169,8 @@ public Map> getMapOfMapProperty() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_map_property") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapOfMapProperty(@jakarta.annotation.Nullable Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } @@ -174,6 +195,7 @@ public Object getAnytype1() { @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_1") public JsonNullable getAnytype1_JsonNullable() { return anytype1; @@ -202,6 +224,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(@jakarta.an @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_1") public Object getMapWithUndeclaredPropertiesAnytype1() { return mapWithUndeclaredPropertiesAnytype1; @@ -210,6 +233,7 @@ public Object getMapWithUndeclaredPropertiesAnytype1() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_1") public void setMapWithUndeclaredPropertiesAnytype1(@jakarta.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; } @@ -228,6 +252,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(@jakarta.an @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_2") public Object getMapWithUndeclaredPropertiesAnytype2() { return mapWithUndeclaredPropertiesAnytype2; @@ -236,6 +261,7 @@ public Object getMapWithUndeclaredPropertiesAnytype2() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_2") public void setMapWithUndeclaredPropertiesAnytype2(@jakarta.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; } @@ -262,6 +288,8 @@ public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(Stri @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_3") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapWithUndeclaredPropertiesAnytype3() { return mapWithUndeclaredPropertiesAnytype3; @@ -270,6 +298,8 @@ public Map getMapWithUndeclaredPropertiesAnytype3() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_3") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapWithUndeclaredPropertiesAnytype3(@jakarta.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; } @@ -288,6 +318,7 @@ public AdditionalPropertiesClass emptyMap(@jakarta.annotation.Nullable Object em @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "empty_map") public Object getEmptyMap() { return emptyMap; @@ -296,6 +327,7 @@ public Object getEmptyMap() { @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "empty_map") public void setEmptyMap(@jakarta.annotation.Nullable Object emptyMap) { this.emptyMap = emptyMap; } @@ -322,6 +354,8 @@ public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapWithUndeclaredPropertiesString() { return mapWithUndeclaredPropertiesString; @@ -330,6 +364,8 @@ public Map getMapWithUndeclaredPropertiesString() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapWithUndeclaredPropertiesString(@jakarta.annotation.Nullable Map mapWithUndeclaredPropertiesString) { this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index c5b8c2c97fa1..c9bf81967bd2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -29,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -52,12 +54,17 @@ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) +@XmlRootElement(name = "Animal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Animal") public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @jakarta.annotation.Nonnull private String className; public static final String JSON_PROPERTY_COLOR = "color"; + @XmlElement(name = "color") @jakarta.annotation.Nullable private String color = "red"; @@ -78,6 +85,7 @@ public Animal className(@jakarta.annotation.Nonnull String className) { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -86,6 +94,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } @@ -104,6 +113,7 @@ public Animal color(@jakarta.annotation.Nullable String color) { @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") public String getColor() { return color; @@ -112,6 +122,7 @@ public String getColor() { @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") public void setColor(@jakarta.annotation.Nullable String color) { this.color = color; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java index c3c11007873c..1f84dd911ab9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,12 +42,17 @@ }) @JsonTypeName("apple") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Apple") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Apple") public class Apple { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + @XmlElement(name = "cultivar") @jakarta.annotation.Nullable private String cultivar; public static final String JSON_PROPERTY_ORIGIN = "origin"; + @XmlElement(name = "origin") @jakarta.annotation.Nullable private String origin; @@ -65,6 +72,7 @@ public Apple cultivar(@jakarta.annotation.Nullable String cultivar) { @Pattern(regexp="^[a-zA-Z\\s]*$") @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "cultivar") public String getCultivar() { return cultivar; @@ -73,6 +81,7 @@ public String getCultivar() { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "cultivar") public void setCultivar(@jakarta.annotation.Nullable String cultivar) { this.cultivar = cultivar; } @@ -91,6 +100,7 @@ public Apple origin(@jakarta.annotation.Nullable String origin) { @Pattern(regexp="/^[A-Z\\s]*$/i") @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "origin") public String getOrigin() { return origin; @@ -99,6 +109,7 @@ public String getOrigin() { @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "origin") public void setOrigin(@jakarta.annotation.Nullable String origin) { this.origin = origin; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java index acc8b330f392..ac7ca175c451 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,12 +42,17 @@ }) @JsonTypeName("appleReq") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AppleReq") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AppleReq") public class AppleReq { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + @XmlElement(name = "cultivar") @jakarta.annotation.Nonnull private String cultivar; public static final String JSON_PROPERTY_MEALY = "mealy"; + @XmlElement(name = "mealy") @jakarta.annotation.Nullable private Boolean mealy; @@ -66,6 +73,7 @@ public AppleReq cultivar(@jakarta.annotation.Nonnull String cultivar) { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "cultivar") public String getCultivar() { return cultivar; @@ -74,6 +82,7 @@ public String getCultivar() { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "cultivar") public void setCultivar(@jakarta.annotation.Nonnull String cultivar) { this.cultivar = cultivar; } @@ -92,6 +101,7 @@ public AppleReq mealy(@jakarta.annotation.Nullable Boolean mealy) { @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mealy") public Boolean getMealy() { return mealy; @@ -100,6 +110,7 @@ public Boolean getMealy() { @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mealy") public void setMealy(@jakarta.annotation.Nullable Boolean mealy) { this.mealy = mealy; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index db6f376b364b..81e486156c81 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,8 +43,12 @@ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayOfArrayOfNumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @XmlElement(name = "ArrayArrayNumber") @jakarta.annotation.Nullable private List> arrayArrayNumber = new ArrayList<>(); @@ -71,6 +77,8 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -79,6 +87,8 @@ public List> getArrayArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayNumber(@jakarta.annotation.Nullable List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 60e9dc7d7414..a479209f2bc1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,8 +43,12 @@ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayOfNumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @XmlElement(name = "ArrayNumber") @jakarta.annotation.Nullable private List arrayNumber = new ArrayList<>(); @@ -71,6 +77,8 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayNumber() { return arrayNumber; @@ -79,6 +87,8 @@ public List getArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayNumber(@jakarta.annotation.Nullable List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index 165e14b25d06..cfba33b6519d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,6 +29,8 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,16 +45,22 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @XmlElement(name = "array_of_string") @jakarta.annotation.Nullable private List arrayOfString = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @XmlElement(name = "array_array_of_integer") @jakarta.annotation.Nullable private List> arrayArrayOfInteger = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @XmlElement(name = "array_array_of_model") @jakarta.annotation.Nullable private List> arrayArrayOfModel = new ArrayList<>(); @@ -80,6 +88,8 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayOfString() { return arrayOfString; @@ -88,6 +98,8 @@ public List getArrayOfString() { @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayOfString(@jakarta.annotation.Nullable List arrayOfString) { this.arrayOfString = arrayOfString; } @@ -115,6 +127,8 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_integer") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -123,6 +137,8 @@ public List> getArrayArrayOfInteger() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_integer") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayOfInteger(@jakarta.annotation.Nullable List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } @@ -150,6 +166,8 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_model") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -158,6 +176,8 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_model") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java index 50a96dbd2803..0a377c226113 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,8 +42,12 @@ }) @JsonTypeName("banana") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Banana") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Banana") public class Banana { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + @XmlElement(name = "lengthCm") @jakarta.annotation.Nullable private BigDecimal lengthCm; @@ -62,6 +68,7 @@ public Banana lengthCm(@jakarta.annotation.Nullable BigDecimal lengthCm) { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lengthCm") public BigDecimal getLengthCm() { return lengthCm; @@ -70,6 +77,7 @@ public BigDecimal getLengthCm() { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lengthCm") public void setLengthCm(@jakarta.annotation.Nullable BigDecimal lengthCm) { this.lengthCm = lengthCm; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java index b3972c8ffae6..740dd33a0244 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BananaReq.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,12 +43,17 @@ }) @JsonTypeName("bananaReq") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "BananaReq") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BananaReq") public class BananaReq { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + @XmlElement(name = "lengthCm") @jakarta.annotation.Nonnull private BigDecimal lengthCm; public static final String JSON_PROPERTY_SWEET = "sweet"; + @XmlElement(name = "sweet") @jakarta.annotation.Nullable private Boolean sweet; @@ -68,6 +75,7 @@ public BananaReq lengthCm(@jakarta.annotation.Nonnull BigDecimal lengthCm) { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "lengthCm") public BigDecimal getLengthCm() { return lengthCm; @@ -76,6 +84,7 @@ public BigDecimal getLengthCm() { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "lengthCm") public void setLengthCm(@jakarta.annotation.Nonnull BigDecimal lengthCm) { this.lengthCm = lengthCm; } @@ -94,6 +103,7 @@ public BananaReq sweet(@jakarta.annotation.Nullable Boolean sweet) { @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sweet") public Boolean getSweet() { return sweet; @@ -102,6 +112,7 @@ public Boolean getSweet() { @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sweet") public void setSweet(@jakarta.annotation.Nullable Boolean sweet) { this.sweet = sweet; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java index 4af57a0aedb2..1a1187a0c4a2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/BasquePig.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ BasquePig.JSON_PROPERTY_CLASS_NAME }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "BasquePig") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BasquePig") public class BasquePig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @jakarta.annotation.Nonnull private String className; @@ -60,6 +66,7 @@ public BasquePig className(@jakarta.annotation.Nonnull String className) { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -68,6 +75,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java index fe260e8f652c..aa7eba2d2e8a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,28 +45,37 @@ Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Capitalization") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Capitalization") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @XmlElement(name = "smallCamel") @jakarta.annotation.Nullable private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @XmlElement(name = "CapitalCamel") @jakarta.annotation.Nullable private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @XmlElement(name = "small_Snake") @jakarta.annotation.Nullable private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @XmlElement(name = "Capital_Snake") @jakarta.annotation.Nullable private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @XmlElement(name = "SCA_ETH_Flow_Points") @jakarta.annotation.Nullable private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @XmlElement(name = "ATT_NAME") @jakarta.annotation.Nullable private String ATT_NAME; @@ -84,6 +95,7 @@ public Capitalization smallCamel(@jakarta.annotation.Nullable String smallCamel) @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") public String getSmallCamel() { return smallCamel; @@ -92,6 +104,7 @@ public String getSmallCamel() { @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") public void setSmallCamel(@jakarta.annotation.Nullable String smallCamel) { this.smallCamel = smallCamel; } @@ -110,6 +123,7 @@ public Capitalization capitalCamel(@jakarta.annotation.Nullable String capitalCa @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") public String getCapitalCamel() { return capitalCamel; @@ -118,6 +132,7 @@ public String getCapitalCamel() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") public void setCapitalCamel(@jakarta.annotation.Nullable String capitalCamel) { this.capitalCamel = capitalCamel; } @@ -136,6 +151,7 @@ public Capitalization smallSnake(@jakarta.annotation.Nullable String smallSnake) @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") public String getSmallSnake() { return smallSnake; @@ -144,6 +160,7 @@ public String getSmallSnake() { @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") public void setSmallSnake(@jakarta.annotation.Nullable String smallSnake) { this.smallSnake = smallSnake; } @@ -162,6 +179,7 @@ public Capitalization capitalSnake(@jakarta.annotation.Nullable String capitalSn @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") public String getCapitalSnake() { return capitalSnake; @@ -170,6 +188,7 @@ public String getCapitalSnake() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") public void setCapitalSnake(@jakarta.annotation.Nullable String capitalSnake) { this.capitalSnake = capitalSnake; } @@ -188,6 +207,7 @@ public Capitalization scAETHFlowPoints(@jakarta.annotation.Nullable String scAET @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -196,6 +216,7 @@ public String getScAETHFlowPoints() { @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@jakarta.annotation.Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } @@ -214,6 +235,7 @@ public Capitalization ATT_NAME(@jakarta.annotation.Nullable String ATT_NAME) { @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") public String getATTNAME() { return ATT_NAME; @@ -222,6 +244,7 @@ public String getATTNAME() { @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") public void setATTNAME(@jakarta.annotation.Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java index 26d842eda967..444af49fe059 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,8 @@ import java.util.Map; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -53,8 +55,12 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@XmlRootElement(name = "Cat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Cat") public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @XmlElement(name = "declawed") @jakarta.annotation.Nullable private Boolean declawed; @@ -74,6 +80,7 @@ public Cat declawed(@jakarta.annotation.Nullable Boolean declawed) { @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") public Boolean getDeclawed() { return declawed; @@ -82,6 +89,7 @@ public Boolean getDeclawed() { @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") public void setDeclawed(@jakarta.annotation.Nullable Boolean declawed) { this.declawed = declawed; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index 88458c525339..d355ae52bdc2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,12 +41,17 @@ Category.JSON_PROPERTY_NAME }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Category") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Category") public class Category { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nonnull private String name = "default-name"; @@ -64,6 +71,7 @@ public Category id(@jakarta.annotation.Nullable Long id) { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -72,6 +80,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } @@ -91,6 +100,7 @@ public Category name(@jakarta.annotation.Nonnull String name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -99,6 +109,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java index d43cb53e96ee..db023a3b59ce 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -36,6 +36,8 @@ import java.util.Set; import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,12 +57,17 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) +@XmlRootElement(name = "ChildCat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ChildCat") public class ChildCat extends ParentPet { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nullable private String name; public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + @XmlElement(name = "pet_type") @jakarta.annotation.Nullable private String petType = "ChildCat"; @@ -80,6 +87,7 @@ public ChildCat name(@jakarta.annotation.Nullable String name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -88,6 +96,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } @@ -114,6 +123,7 @@ public ChildCat petType(@jakarta.annotation.Nullable String petType) { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pet_type") public String getPetType() { return petType; @@ -122,6 +132,7 @@ public String getPetType() { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pet_type") 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/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java index e2d08dd9fb78..de634dfdee5b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ClassModel") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ClassModel") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @XmlElement(name = "_class") @jakarta.annotation.Nullable private String propertyClass; @@ -59,6 +65,7 @@ public ClassModel propertyClass(@jakarta.annotation.Nullable String propertyClas @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") public String getPropertyClass() { return propertyClass; @@ -67,6 +74,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java index d8db282edbc0..f27737f0c59a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ Client.JSON_PROPERTY_CLIENT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Client") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Client") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; + @XmlElement(name = "client") @jakarta.annotation.Nullable private String client; @@ -59,6 +65,7 @@ public Client client(@jakarta.annotation.Nullable String client) { @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") public String getClient() { return client; @@ -67,6 +74,7 @@ public String getClient() { @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") public void setClient(@jakarta.annotation.Nullable String client) { this.client = client; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 2a4d0f204719..4b8a4756832d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,12 +45,17 @@ ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ComplexQuadrilateral") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ComplexQuadrilateral") public class ComplexQuadrilateral { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @XmlElement(name = "quadrilateralType") @jakarta.annotation.Nonnull private String quadrilateralType; @@ -69,6 +76,7 @@ public ComplexQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTy @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -77,6 +85,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -96,6 +105,7 @@ public ComplexQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public String getQuadrilateralType() { return quadrilateralType; @@ -104,6 +114,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java index f604f8f674ae..7805a7e33665 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ DanishPig.JSON_PROPERTY_CLASS_NAME }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "DanishPig") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "DanishPig") public class DanishPig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @jakarta.annotation.Nonnull private String className; @@ -60,6 +66,7 @@ public DanishPig className(@jakarta.annotation.Nonnull String className) { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -68,6 +75,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java index ca2efd4e29f2..2a0488c05b3b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,8 +42,12 @@ DeprecatedObject.JSON_PROPERTY_NAME }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "DeprecatedObject") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "DeprecatedObject") public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nullable private String name; @@ -61,6 +67,7 @@ public DeprecatedObject name(@jakarta.annotation.Nullable String name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -69,6 +76,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java index 7a77c179faab..61e8b2aa54ef 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,8 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -52,8 +54,12 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@XmlRootElement(name = "Dog") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Dog") public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; + @XmlElement(name = "breed") @jakarta.annotation.Nullable private String breed; @@ -73,6 +79,7 @@ public Dog breed(@jakarta.annotation.Nullable String breed) { @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") public String getBreed() { return breed; @@ -81,6 +88,7 @@ public String getBreed() { @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") public void setBreed(@jakarta.annotation.Nullable String breed) { this.breed = breed; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java index 7c02be41c674..eeb8edf26b5f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java @@ -40,6 +40,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,18 +57,25 @@ Drawing.JSON_PROPERTY_SHAPES }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Drawing") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Drawing") public class Drawing { public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; + @XmlElement(name = "mainShape") @jakarta.annotation.Nullable private Shape mainShape; public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; + @XmlElement(name = "shapeOrNull") private JsonNullable shapeOrNull = JsonNullable.undefined(); public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; + @XmlElement(name = "nullableShape") private JsonNullable nullableShape = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHAPES = "shapes"; + @XmlElement(name = "shapes") @jakarta.annotation.Nullable private List shapes = new ArrayList<>(); @@ -87,6 +96,7 @@ public Drawing mainShape(@jakarta.annotation.Nullable Shape mainShape) { @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mainShape") public Shape getMainShape() { return mainShape; @@ -95,6 +105,7 @@ public Shape getMainShape() { @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mainShape") public void setMainShape(@jakarta.annotation.Nullable Shape mainShape) { this.mainShape = mainShape; } @@ -120,6 +131,7 @@ public ShapeOrNull getShapeOrNull() { @JsonProperty(value = JSON_PROPERTY_SHAPE_OR_NULL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shapeOrNull") public JsonNullable getShapeOrNull_JsonNullable() { return shapeOrNull; @@ -155,6 +167,7 @@ public NullableShape getNullableShape() { @JsonProperty(value = JSON_PROPERTY_NULLABLE_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "nullableShape") public JsonNullable getNullableShape_JsonNullable() { return nullableShape; @@ -192,6 +205,8 @@ public Drawing addShapesItem(Shape shapesItem) { @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shapes") + @JacksonXmlElementWrapper(useWrapping = false) public List getShapes() { return shapes; @@ -200,6 +215,8 @@ public List getShapes() { @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shapes") + @JacksonXmlElementWrapper(useWrapping = false) public void setShapes(@jakarta.annotation.Nullable List shapes) { this.shapes = shapes; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index 00d4e896b991..30a552942c02 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -28,6 +28,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,13 +43,20 @@ EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EnumArrays") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EnumArrays") public class EnumArrays { /** * Gets or Sets justSymbol */ + @XmlType(name="JustSymbolEnum") + @XmlEnum(String.class) public enum JustSymbolEnum { + @XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), + @XmlEnumValue("$") DOLLAR(String.valueOf("$")); private String value; @@ -78,15 +87,20 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @XmlElement(name = "just_symbol") @jakarta.annotation.Nullable private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum */ + @XmlType(name="ArrayEnumEnum") + @XmlEnum(String.class) public enum ArrayEnumEnum { + @XmlEnumValue("fish") FISH(String.valueOf("fish")), + @XmlEnumValue("crab") CRAB(String.valueOf("crab")); private String value; @@ -117,6 +131,7 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @XmlElement(name = "array_enum") @jakarta.annotation.Nullable private List arrayEnum = new ArrayList<>(); @@ -136,6 +151,7 @@ public EnumArrays justSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSym @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -144,6 +160,7 @@ public JustSymbolEnum getJustSymbol() { @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") public void setJustSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } @@ -170,6 +187,8 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_enum") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayEnum() { return arrayEnum; @@ -178,6 +197,8 @@ public List getArrayEnum() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_enum") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayEnum(@jakarta.annotation.Nullable List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java index b56d7022ea8a..62ce55d60aaa 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -34,10 +36,13 @@ */ public enum EnumClass { + @XmlEnumValue("_abc") _ABC("_abc"), + @XmlEnumValue("-efg") _EFG("-efg"), + @XmlEnumValue("(xyz)") _XYZ_("(xyz)"); private String value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index a2d70ec33dda..3fa2b7c74f4d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,6 +34,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,15 +57,23 @@ }) @JsonTypeName("Enum_Test") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EnumTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EnumTest") public class EnumTest { /** * Gets or Sets enumString */ + @XmlType(name="EnumStringEnum") + @XmlEnum(String.class) public enum EnumStringEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")), + @XmlEnumValue("") EMPTY(String.valueOf("")); private String value; @@ -94,17 +104,23 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @XmlElement(name = "enum_string") @jakarta.annotation.Nullable private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired */ + @XmlType(name="EnumStringRequiredEnum") + @XmlEnum(String.class) public enum EnumStringRequiredEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")), + @XmlEnumValue("") EMPTY(String.valueOf("")); private String value; @@ -135,15 +151,20 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @XmlElement(name = "enum_string_required") @jakarta.annotation.Nonnull private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger */ + @XmlType(name="EnumIntegerEnum") + @XmlEnum(Integer.class) public enum EnumIntegerEnum { + @XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), + @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -174,15 +195,20 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @XmlElement(name = "enum_integer") @jakarta.annotation.Nullable private EnumIntegerEnum enumInteger; /** * Gets or Sets enumIntegerOnly */ + @XmlType(name="EnumIntegerOnlyEnum") + @XmlEnum(Integer.class) public enum EnumIntegerOnlyEnum { + @XmlEnumValue("2") NUMBER_2(Integer.valueOf(2)), + @XmlEnumValue("-2") NUMBER_MINUS_2(Integer.valueOf(-2)); private Integer value; @@ -213,15 +239,20 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER_ONLY = "enum_integer_only"; + @XmlElement(name = "enum_integer_only") @jakarta.annotation.Nullable private EnumIntegerOnlyEnum enumIntegerOnly; /** * Gets or Sets enumNumber */ + @XmlType(name="EnumNumberEnum") + @XmlEnum(Double.class) public enum EnumNumberEnum { + @XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), + @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; @@ -252,21 +283,26 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @XmlElement(name = "enum_number") @jakarta.annotation.Nullable private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @XmlElement(name = "outerEnum") private JsonNullable outerEnum = JsonNullable.undefined(); public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + @XmlElement(name = "outerEnumInteger") @jakarta.annotation.Nullable private OuterEnumInteger outerEnumInteger; public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + @XmlElement(name = "outerEnumDefaultValue") @jakarta.annotation.Nullable private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + @XmlElement(name = "outerEnumIntegerDefaultValue") @jakarta.annotation.Nullable private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; @@ -286,6 +322,7 @@ public EnumTest enumString(@jakarta.annotation.Nullable EnumStringEnum enumStrin @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") public EnumStringEnum getEnumString() { return enumString; @@ -294,6 +331,7 @@ public EnumStringEnum getEnumString() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") public void setEnumString(@jakarta.annotation.Nullable EnumStringEnum enumString) { this.enumString = enumString; } @@ -313,6 +351,7 @@ public EnumTest enumStringRequired(@jakarta.annotation.Nonnull EnumStringRequire @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; @@ -321,6 +360,7 @@ public EnumStringRequiredEnum getEnumStringRequired() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") public void setEnumStringRequired(@jakarta.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } @@ -339,6 +379,7 @@ public EnumTest enumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInt @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -347,6 +388,7 @@ public EnumIntegerEnum getEnumInteger() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") public void setEnumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } @@ -365,6 +407,7 @@ public EnumTest enumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer_only") public EnumIntegerOnlyEnum getEnumIntegerOnly() { return enumIntegerOnly; @@ -373,6 +416,7 @@ public EnumIntegerOnlyEnum getEnumIntegerOnly() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer_only") public void setEnumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { this.enumIntegerOnly = enumIntegerOnly; } @@ -391,6 +435,7 @@ public EnumTest enumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumbe @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -399,6 +444,7 @@ public EnumNumberEnum getEnumNumber() { @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") public void setEnumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @@ -424,6 +470,7 @@ public OuterEnum getOuterEnum() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnum") public JsonNullable getOuterEnum_JsonNullable() { return outerEnum; @@ -453,6 +500,7 @@ public EnumTest outerEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger o @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumInteger") public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; @@ -461,6 +509,7 @@ public OuterEnumInteger getOuterEnumInteger() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumInteger") public void setOuterEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; } @@ -480,6 +529,7 @@ public EnumTest outerEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefa @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumDefaultValue") public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; @@ -488,6 +538,7 @@ public OuterEnumDefaultValue getOuterEnumDefaultValue() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumDefaultValue") public void setOuterEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; } @@ -507,6 +558,7 @@ public EnumTest outerEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterE @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumIntegerDefaultValue") public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; @@ -515,6 +567,7 @@ public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumIntegerDefaultValue") public void setOuterEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 5a1983152e12..e4a9ba863629 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,12 +45,17 @@ EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EquilateralTriangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EquilateralTriangle") public class EquilateralTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @jakarta.annotation.Nonnull private String triangleType; @@ -69,6 +76,7 @@ public EquilateralTriangle shapeType(@jakarta.annotation.Nonnull String shapeTyp @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -77,6 +85,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -96,6 +105,7 @@ public EquilateralTriangle triangleType(@jakarta.annotation.Nonnull String trian @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -104,6 +114,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 31a24c07d35f..059f90034215 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -29,6 +29,8 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -42,12 +44,17 @@ FileSchemaTestClass.JSON_PROPERTY_FILES }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FileSchemaTestClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FileSchemaTestClass") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; + @XmlElement(name = "file") @jakarta.annotation.Nullable private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; + @XmlElement(name = "files") @jakarta.annotation.Nullable private List<@Valid ModelFile> files = new ArrayList<>(); @@ -68,6 +75,7 @@ public FileSchemaTestClass _file(@jakarta.annotation.Nullable ModelFile _file) { @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") public ModelFile getFile() { return _file; @@ -76,6 +84,7 @@ public ModelFile getFile() { @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") public void setFile(@jakarta.annotation.Nullable ModelFile _file) { this._file = _file; } @@ -103,6 +112,8 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "files") + @JacksonXmlElementWrapper(useWrapping = false) public List<@Valid ModelFile> getFiles() { return files; @@ -111,6 +122,8 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "files") + @JacksonXmlElementWrapper(useWrapping = false) public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { this.files = files; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java index e21d5c83d73a..75ff100b1200 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ Foo.JSON_PROPERTY_BAR }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Foo") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Foo") public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @jakarta.annotation.Nullable private String bar = "bar"; @@ -59,6 +65,7 @@ public Foo bar(@jakarta.annotation.Nullable String bar) { @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -67,6 +74,7 @@ public String getBar() { @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public void setBar(@jakarta.annotation.Nullable String bar) { this.bar = bar; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 50b05ae83496..97dec3925d9f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -27,6 +27,8 @@ import java.util.Arrays; import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,8 +42,12 @@ }) @JsonTypeName("_foo_get_default_response") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FooGetDefaultResponse") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FooGetDefaultResponse") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; + @XmlElement(name = "string") @jakarta.annotation.Nullable private Foo string; @@ -62,6 +68,7 @@ public FooGetDefaultResponse string(@jakarta.annotation.Nullable Foo string) { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public Foo getString() { return string; @@ -70,6 +77,7 @@ public Foo getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public void setString(@jakarta.annotation.Nullable Foo string) { this.string = string; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java index d2f6a15ea61c..3ab6e2227dd4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,6 +31,8 @@ import java.util.Arrays; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -59,68 +61,87 @@ }) @JsonTypeName("format_test") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FormatTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FormatTest") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; + @XmlElement(name = "integer") @jakarta.annotation.Nullable private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; + @XmlElement(name = "int32") @jakarta.annotation.Nullable private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; + @XmlElement(name = "int64") @jakarta.annotation.Nullable private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; + @XmlElement(name = "number") @jakarta.annotation.Nonnull private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; + @XmlElement(name = "float") @jakarta.annotation.Nullable private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; + @XmlElement(name = "double") @jakarta.annotation.Nullable private Double _double; public static final String JSON_PROPERTY_DECIMAL = "decimal"; + @XmlElement(name = "decimal") @jakarta.annotation.Nullable private BigDecimal decimal; public static final String JSON_PROPERTY_STRING = "string"; + @XmlElement(name = "string") @jakarta.annotation.Nullable private String string; public static final String JSON_PROPERTY_BYTE = "byte"; + @XmlElement(name = "byte") @jakarta.annotation.Nonnull private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; + @XmlElement(name = "binary") @jakarta.annotation.Nullable private File binary; public static final String JSON_PROPERTY_DATE = "date"; + @XmlElement(name = "date") @jakarta.annotation.Nonnull private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @XmlElement(name = "dateTime") @jakarta.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @jakarta.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; + @XmlElement(name = "password") @jakarta.annotation.Nonnull private String password; public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + @XmlElement(name = "pattern_with_digits") @jakarta.annotation.Nullable private String patternWithDigits; public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + @XmlElement(name = "pattern_with_digits_and_delimiter") @jakarta.annotation.Nullable private String patternWithDigitsAndDelimiter; @@ -142,6 +163,7 @@ public FormatTest integer(@jakarta.annotation.Nullable Integer integer) { @Min(10) @Max(100) @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") public Integer getInteger() { return integer; @@ -150,6 +172,7 @@ public Integer getInteger() { @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") public void setInteger(@jakarta.annotation.Nullable Integer integer) { this.integer = integer; } @@ -170,6 +193,7 @@ public FormatTest int32(@jakarta.annotation.Nullable Integer int32) { @Min(20) @Max(200) @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") public Integer getInt32() { return int32; @@ -178,6 +202,7 @@ public Integer getInt32() { @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") public void setInt32(@jakarta.annotation.Nullable Integer int32) { this.int32 = int32; } @@ -196,6 +221,7 @@ public FormatTest int64(@jakarta.annotation.Nullable Long int64) { @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") public Long getInt64() { return int64; @@ -204,6 +230,7 @@ public Long getInt64() { @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") public void setInt64(@jakarta.annotation.Nullable Long int64) { this.int64 = int64; } @@ -226,6 +253,7 @@ public FormatTest number(@jakarta.annotation.Nonnull BigDecimal number) { @DecimalMin("32.1") @DecimalMax("543.2") @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") public BigDecimal getNumber() { return number; @@ -234,6 +262,7 @@ public BigDecimal getNumber() { @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") public void setNumber(@jakarta.annotation.Nonnull BigDecimal number) { this.number = number; } @@ -254,6 +283,7 @@ public FormatTest _float(@jakarta.annotation.Nullable Float _float) { @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") public Float getFloat() { return _float; @@ -262,6 +292,7 @@ public Float getFloat() { @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") public void setFloat(@jakarta.annotation.Nullable Float _float) { this._float = _float; } @@ -282,6 +313,7 @@ public FormatTest _double(@jakarta.annotation.Nullable Double _double) { @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") public Double getDouble() { return _double; @@ -290,6 +322,7 @@ public Double getDouble() { @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") public void setDouble(@jakarta.annotation.Nullable Double _double) { this._double = _double; } @@ -309,6 +342,7 @@ public FormatTest decimal(@jakarta.annotation.Nullable BigDecimal decimal) { @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "decimal") public BigDecimal getDecimal() { return decimal; @@ -317,6 +351,7 @@ public BigDecimal getDecimal() { @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "decimal") public void setDecimal(@jakarta.annotation.Nullable BigDecimal decimal) { this.decimal = decimal; } @@ -335,6 +370,7 @@ public FormatTest string(@jakarta.annotation.Nullable String string) { @Pattern(regexp="/[a-z]/i") @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public String getString() { return string; @@ -343,6 +379,7 @@ public String getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public void setString(@jakarta.annotation.Nullable String string) { this.string = string; } @@ -362,6 +399,7 @@ public FormatTest _byte(@jakarta.annotation.Nonnull byte[] _byte) { @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") public byte[] getByte() { return _byte; @@ -370,6 +408,7 @@ public byte[] getByte() { @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") public void setByte(@jakarta.annotation.Nonnull byte[] _byte) { this._byte = _byte; } @@ -389,6 +428,7 @@ public FormatTest binary(@jakarta.annotation.Nullable File binary) { @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") public File getBinary() { return binary; @@ -397,6 +437,7 @@ public File getBinary() { @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") public void setBinary(@jakarta.annotation.Nullable File binary) { this.binary = binary; } @@ -417,6 +458,7 @@ public FormatTest date(@jakarta.annotation.Nonnull LocalDate date) { @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") public LocalDate getDate() { return date; @@ -425,6 +467,7 @@ public LocalDate getDate() { @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") public void setDate(@jakarta.annotation.Nonnull LocalDate date) { this.date = date; } @@ -444,6 +487,7 @@ public FormatTest dateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public OffsetDateTime getDateTime() { return dateTime; @@ -452,6 +496,7 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public void setDateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -471,6 +516,7 @@ public FormatTest uuid(@jakarta.annotation.Nullable UUID uuid) { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public UUID getUuid() { return uuid; @@ -479,6 +525,7 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@jakarta.annotation.Nullable UUID uuid) { this.uuid = uuid; } @@ -498,6 +545,7 @@ public FormatTest password(@jakarta.annotation.Nonnull String password) { @Size(min=10,max=64) @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") public String getPassword() { return password; @@ -506,6 +554,7 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") public void setPassword(@jakarta.annotation.Nonnull String password) { this.password = password; } @@ -524,6 +573,7 @@ public FormatTest patternWithDigits(@jakarta.annotation.Nullable String patternW @Pattern(regexp="^\\d{10}$") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits") public String getPatternWithDigits() { return patternWithDigits; @@ -532,6 +582,7 @@ public String getPatternWithDigits() { @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits") public void setPatternWithDigits(@jakarta.annotation.Nullable String patternWithDigits) { this.patternWithDigits = patternWithDigits; } @@ -550,6 +601,7 @@ public FormatTest patternWithDigitsAndDelimiter(@jakarta.annotation.Nullable Str @Pattern(regexp="/^image_\\d{1,3}$/i") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits_and_delimiter") public String getPatternWithDigitsAndDelimiter() { return patternWithDigitsAndDelimiter; @@ -558,6 +610,7 @@ public String getPatternWithDigitsAndDelimiter() { @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits_and_delimiter") public void setPatternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index cbb873c9eb31..0d5ef5be6a56 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -29,6 +29,8 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +64,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Fruit") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Fruit") @JsonDeserialize(using = Fruit.FruitDeserializer.class) @JsonSerialize(using = Fruit.FruitSerializer.class) public class Fruit extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index a9a7bb85aad6..79d3992efc84 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -29,6 +29,8 @@ import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +64,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FruitReq") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FruitReq") @JsonDeserialize(using = FruitReq.FruitReqDeserializer.class) @JsonSerialize(using = FruitReq.FruitReqSerializer.class) public class FruitReq extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index 40e03718cfdb..3a4d166893c6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -29,6 +29,8 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -58,6 +60,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "GmFruit") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "GmFruit") @JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) @JsonSerialize(using = GmFruit.GmFruitSerializer.class) public class GmFruit extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 9f02a9c11911..576ea3a02036 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -29,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,8 +53,12 @@ @JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"), }) +@XmlRootElement(name = "GrandparentAnimal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "GrandparentAnimal") public class GrandparentAnimal { public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + @XmlElement(name = "pet_type") @jakarta.annotation.Nonnull private String petType; @@ -73,6 +79,7 @@ public GrandparentAnimal petType(@jakarta.annotation.Nonnull String petType) { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "pet_type") public String getPetType() { return petType; @@ -81,6 +88,7 @@ public String getPetType() { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "pet_type") public void setPetType(@jakarta.annotation.Nonnull String petType) { this.petType = petType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index d868dcfd1dcd..33df415eb9d8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,28 +42,23 @@ }) @JsonTypeName("hasOnlyReadOnly") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "HasOnlyReadOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "HasOnlyReadOnly") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @jakarta.annotation.Nullable private String bar; public static final String JSON_PROPERTY_FOO = "foo"; + @XmlElement(name = "foo") @jakarta.annotation.Nullable private String foo; public HasOnlyReadOnly() { } - @JsonCreator - public HasOnlyReadOnly( - @JsonProperty(JSON_PROPERTY_BAR) String bar, - @JsonProperty(JSON_PROPERTY_FOO) String foo - ) { - this(); - this.bar = bar; - this.foo = foo; - } - /** * Get bar * @return bar @@ -70,6 +67,7 @@ public HasOnlyReadOnly( @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -86,6 +84,7 @@ public String getBar() { @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "foo") public String getFoo() { return foo; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 3023ef22989f..f0fb97b237a6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -30,6 +30,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -42,8 +44,12 @@ HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "HealthCheckResult") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "HealthCheckResult") public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + @XmlElement(name = "NullableMessage") private JsonNullable nullableMessage = JsonNullable.undefined(); public HealthCheckResult() { @@ -68,6 +74,7 @@ public String getNullableMessage() { @JsonProperty(value = JSON_PROPERTY_NULLABLE_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "NullableMessage") public JsonNullable getNullableMessage_JsonNullable() { return nullableMessage; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index ba5ddd26ff44..e8b0f48d6810 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,12 +41,17 @@ IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "IsoscelesTriangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "IsoscelesTriangle") public class IsoscelesTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @jakarta.annotation.Nonnull private String triangleType; @@ -65,6 +72,7 @@ public IsoscelesTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -73,6 +81,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -92,6 +101,7 @@ public IsoscelesTriangle triangleType(@jakarta.annotation.Nonnull String triangl @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -100,6 +110,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index b144e012c469..53ab7cf43730 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -36,6 +36,8 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -69,6 +71,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Mammal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Mammal") @JsonDeserialize(using = Mammal.MammalDeserializer.class) @JsonSerialize(using = Mammal.MammalSerializer.class) public class Mammal extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java index 6dc7a3440e6b..1f99a7798a1e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -36,6 +36,8 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -65,6 +67,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MammalAnyof") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MammalAnyof") @JsonDeserialize(using=MammalAnyof.MammalAnyofDeserializer.class) @JsonSerialize(using = MammalAnyof.MammalAnyofSerializer.class) public class MammalAnyof extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java index 8bfe4fe00449..84d47253f16a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java @@ -28,6 +28,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,17 +45,25 @@ MapTest.JSON_PROPERTY_INDIRECT_MAP }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MapTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MapTest") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @XmlElement(name = "map_map_of_string") @jakarta.annotation.Nullable private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner */ + @XmlType(name="InnerEnum") + @XmlEnum(String.class) public enum InnerEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")); private String value; @@ -84,14 +94,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @XmlElement(name = "map_of_enum_string") @jakarta.annotation.Nullable private Map mapOfEnumString = new HashMap<>(); public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @XmlElement(name = "direct_map") @jakarta.annotation.Nullable private Map directMap = new HashMap<>(); public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @XmlElement(name = "indirect_map") @jakarta.annotation.Nullable private Map indirectMap = new HashMap<>(); @@ -120,6 +133,8 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map> getMapMapOfString() { return mapMapOfString; @@ -128,6 +143,8 @@ public Map> getMapMapOfString() { @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapMapOfString(@jakarta.annotation.Nullable Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } @@ -154,6 +171,8 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_enum_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapOfEnumString() { return mapOfEnumString; @@ -162,6 +181,8 @@ public Map getMapOfEnumString() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_enum_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapOfEnumString(@jakarta.annotation.Nullable Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } @@ -188,6 +209,8 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "direct_map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getDirectMap() { return directMap; @@ -196,6 +219,8 @@ public Map getDirectMap() { @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "direct_map") + @JacksonXmlElementWrapper(useWrapping = false) public void setDirectMap(@jakarta.annotation.Nullable Map directMap) { this.directMap = directMap; } @@ -222,6 +247,8 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "indirect_map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getIndirectMap() { return indirectMap; @@ -230,6 +257,8 @@ public Map getIndirectMap() { @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "indirect_map") + @JacksonXmlElementWrapper(useWrapping = false) public void setIndirectMap(@jakarta.annotation.Nullable Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b04cfaf71ddb..c84593abe2a4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,6 +31,8 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -45,16 +47,22 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @jakarta.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @XmlElement(name = "dateTime") @jakarta.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; + @XmlElement(name = "map") @jakarta.annotation.Nullable private Map map = new HashMap<>(); @@ -75,6 +83,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@jakarta.annotation.Null @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public UUID getUuid() { return uuid; @@ -83,6 +92,7 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@jakarta.annotation.Nullable UUID uuid) { this.uuid = uuid; } @@ -102,6 +112,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@jakarta.annotation. @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public OffsetDateTime getDateTime() { return dateTime; @@ -110,6 +121,7 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public void setDateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -137,6 +149,8 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMap() { return map; @@ -145,6 +159,8 @@ public Map getMap() { @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map") + @JacksonXmlElementWrapper(useWrapping = false) public void setMap(@jakarta.annotation.Nullable Map map) { this.map = map; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java index 7384f26fff11..fb91a59a7b48 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,12 +42,17 @@ }) @JsonTypeName("200_response") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Name") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Name") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nullable private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @XmlElement(name = "class") @jakarta.annotation.Nullable private String propertyClass; @@ -65,6 +72,7 @@ public Model200Response name(@jakarta.annotation.Nullable Integer name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public Integer getName() { return name; @@ -73,6 +81,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nullable Integer name) { this.name = name; } @@ -91,6 +100,7 @@ public Model200Response propertyClass(@jakarta.annotation.Nullable String proper @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") public String getPropertyClass() { return propertyClass; @@ -99,6 +109,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index afcf17c44450..07f4d6f4f117 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,16 +43,22 @@ }) @JsonTypeName("ApiResponse") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelApiResponse") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelApiResponse") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; + @XmlElement(name = "code") @jakarta.annotation.Nullable private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; + @XmlElement(name = "type") @jakarta.annotation.Nullable private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; + @XmlElement(name = "message") @jakarta.annotation.Nullable private String message; @@ -70,6 +78,7 @@ public ModelApiResponse code(@jakarta.annotation.Nullable Integer code) { @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") public Integer getCode() { return code; @@ -78,6 +87,7 @@ public Integer getCode() { @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") public void setCode(@jakarta.annotation.Nullable Integer code) { this.code = code; } @@ -96,6 +106,7 @@ public ModelApiResponse type(@jakarta.annotation.Nullable String type) { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public String getType() { return type; @@ -104,6 +115,7 @@ public String getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } @@ -122,6 +134,7 @@ public ModelApiResponse message(@jakarta.annotation.Nullable String message) { @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") public String getMessage() { return message; @@ -130,6 +143,7 @@ public String getMessage() { @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") public void setMessage(@jakarta.annotation.Nullable String message) { this.message = message; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java index e20c4be3e465..69237578496c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ }) @JsonTypeName("File") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelFile") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelFile") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + @XmlElement(name = "sourceURI") @jakarta.annotation.Nullable private String sourceURI; @@ -60,6 +66,7 @@ public ModelFile sourceURI(@jakarta.annotation.Nullable String sourceURI) { @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") public String getSourceURI() { return sourceURI; @@ -68,6 +75,7 @@ public String getSourceURI() { @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") public void setSourceURI(@jakarta.annotation.Nullable String sourceURI) { this.sourceURI = sourceURI; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java index 368d3a01ecc6..378e8d06007c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ }) @JsonTypeName("List") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelList") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelList") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; + @XmlElement(name = "123-list") @jakarta.annotation.Nullable private String _123list; @@ -60,6 +66,7 @@ public ModelList _123list(@jakarta.annotation.Nullable String _123list) { @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") public String get123list() { return _123list; @@ -68,6 +75,7 @@ public String get123list() { @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") public void set123list(@jakarta.annotation.Nullable String _123list) { this._123list = _123list; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java index 4382054f7fe2..3a236eb42c7f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ }) @JsonTypeName("Return") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Return") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Return") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; + @XmlElement(name = "return") @jakarta.annotation.Nullable private Integer _return; @@ -60,6 +66,7 @@ public ModelReturn _return(@jakarta.annotation.Nullable Integer _return) { @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") public Integer getReturn() { return _return; @@ -68,6 +75,7 @@ public Integer getReturn() { @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") public void setReturn(@jakarta.annotation.Nullable Integer _return) { this._return = _return; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java index 4cfdaf5e0072..4b910cc080f4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,36 +43,33 @@ Name.JSON_PROPERTY_123NUMBER }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Name") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Name") public class Name { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nonnull private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @XmlElement(name = "snake_case") @jakarta.annotation.Nullable private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; + @XmlElement(name = "property") @jakarta.annotation.Nullable private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @XmlElement(name = "123Number") @jakarta.annotation.Nullable private Integer _123number; public Name() { } - @JsonCreator - public Name( - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, - @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number - ) { - this(); - this.snakeCase = snakeCase; - this._123number = _123number; - } - public Name name(@jakarta.annotation.Nonnull Integer name) { this.name = name; return this; @@ -85,6 +84,7 @@ public Name name(@jakarta.annotation.Nonnull Integer name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public Integer getName() { return name; @@ -93,6 +93,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nonnull Integer name) { this.name = name; } @@ -106,6 +107,7 @@ public void setName(@jakarta.annotation.Nonnull Integer name) { @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "snake_case") public Integer getSnakeCase() { return snakeCase; @@ -127,6 +129,7 @@ public Name property(@jakarta.annotation.Nullable String property) { @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") public String getProperty() { return property; @@ -135,6 +138,7 @@ public String getProperty() { @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") public void setProperty(@jakarta.annotation.Nullable String property) { this.property = property; } @@ -148,6 +152,7 @@ public void setProperty(@jakarta.annotation.Nullable String property) { @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123Number") public Integer get123number() { return _123number; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index 03f779c77f8f..b1b4708a3086 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -41,6 +41,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,42 +66,57 @@ NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NullableClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NullableClass") public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + @XmlElement(name = "integer_prop") private JsonNullable integerProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + @XmlElement(name = "number_prop") private JsonNullable numberProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + @XmlElement(name = "boolean_prop") private JsonNullable booleanProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + @XmlElement(name = "string_prop") private JsonNullable stringProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + @XmlElement(name = "date_prop") private JsonNullable dateProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + @XmlElement(name = "datetime_prop") private JsonNullable datetimeProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + @XmlElement(name = "array_nullable_prop") private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + @XmlElement(name = "array_and_items_nullable_prop") private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + @XmlElement(name = "array_items_nullable") @jakarta.annotation.Nullable private List arrayItemsNullable = new ArrayList<>(); public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + @XmlElement(name = "object_nullable_prop") private JsonNullable> objectNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + @XmlElement(name = "object_and_items_nullable_prop") private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + @XmlElement(name = "object_items_nullable") @jakarta.annotation.Nullable private Map objectItemsNullable = new HashMap<>(); @@ -125,6 +142,7 @@ public Integer getIntegerProp() { @JsonProperty(value = JSON_PROPERTY_INTEGER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer_prop") public JsonNullable getIntegerProp_JsonNullable() { return integerProp; @@ -160,6 +178,7 @@ public BigDecimal getNumberProp() { @JsonProperty(value = JSON_PROPERTY_NUMBER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "number_prop") public JsonNullable getNumberProp_JsonNullable() { return numberProp; @@ -194,6 +213,7 @@ public Boolean getBooleanProp() { @JsonProperty(value = JSON_PROPERTY_BOOLEAN_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "boolean_prop") public JsonNullable getBooleanProp_JsonNullable() { return booleanProp; @@ -228,6 +248,7 @@ public String getStringProp() { @JsonProperty(value = JSON_PROPERTY_STRING_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string_prop") public JsonNullable getStringProp_JsonNullable() { return stringProp; @@ -263,6 +284,7 @@ public LocalDate getDateProp() { @JsonProperty(value = JSON_PROPERTY_DATE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "date_prop") public JsonNullable getDateProp_JsonNullable() { return dateProp; @@ -298,6 +320,7 @@ public OffsetDateTime getDatetimeProp() { @JsonProperty(value = JSON_PROPERTY_DATETIME_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "datetime_prop") public JsonNullable getDatetimeProp_JsonNullable() { return datetimeProp; @@ -344,6 +367,8 @@ public List getArrayNullableProp() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getArrayNullableProp_JsonNullable() { return arrayNullableProp; @@ -390,6 +415,8 @@ public List getArrayAndItemsNullableProp() { @JsonProperty(value = JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_and_items_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { return arrayAndItemsNullableProp; @@ -426,6 +453,8 @@ public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayItemsNullable() { return arrayItemsNullable; @@ -434,6 +463,8 @@ public List getArrayItemsNullable() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayItemsNullable(@jakarta.annotation.Nullable List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; } @@ -470,6 +501,8 @@ public Map getObjectNullableProp() { @JsonProperty(value = JSON_PROPERTY_OBJECT_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getObjectNullableProp_JsonNullable() { return objectNullableProp; @@ -516,6 +549,8 @@ public Map getObjectAndItemsNullableProp() { @JsonProperty(value = JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_and_items_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { return objectAndItemsNullableProp; @@ -552,6 +587,8 @@ public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNu @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public Map getObjectItemsNullable() { return objectItemsNullable; @@ -560,6 +597,8 @@ public Map getObjectItemsNullable() { @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public void setObjectItemsNullable(@jakarta.annotation.Nullable Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index 8739f834b9bc..de2b55646a43 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,6 +70,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NullableShape") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NullableShape") @JsonDeserialize(using = NullableShape.NullableShapeDeserializer.class) @JsonSerialize(using = NullableShape.NullableShapeSerializer.class) public class NullableShape extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java index 9545c6d3c3d6..7ae761fd271d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NumberOnly") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @XmlElement(name = "JustNumber") @jakarta.annotation.Nullable private BigDecimal justNumber; @@ -61,6 +67,7 @@ public NumberOnly justNumber(@jakarta.annotation.Nullable BigDecimal justNumber) @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") public BigDecimal getJustNumber() { return justNumber; @@ -69,6 +76,7 @@ public BigDecimal getJustNumber() { @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") public void setJustNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 182c5498c937..0ed6fee57af5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -30,6 +30,8 @@ import java.util.List; import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -45,22 +47,29 @@ ObjectWithDeprecatedFields.JSON_PROPERTY_BARS }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ObjectWithDeprecatedFields") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ObjectWithDeprecatedFields") public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @jakarta.annotation.Nullable private String uuid; public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @Deprecated @jakarta.annotation.Nullable private BigDecimal id; public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + @XmlElement(name = "deprecatedRef") @Deprecated @jakarta.annotation.Nullable private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; + @XmlElement(name = "bars") @Deprecated @jakarta.annotation.Nullable private List bars = new ArrayList<>(); @@ -81,6 +90,7 @@ public ObjectWithDeprecatedFields uuid(@jakarta.annotation.Nullable String uuid) @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public String getUuid() { return uuid; @@ -89,6 +99,7 @@ public String getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@jakarta.annotation.Nullable String uuid) { this.uuid = uuid; } @@ -111,6 +122,7 @@ public ObjectWithDeprecatedFields id(@jakarta.annotation.Nullable BigDecimal id) @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public BigDecimal getId() { return id; @@ -120,6 +132,7 @@ public BigDecimal getId() { @Deprecated @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@jakarta.annotation.Nullable BigDecimal id) { this.id = id; } @@ -142,6 +155,7 @@ public ObjectWithDeprecatedFields deprecatedRef(@jakarta.annotation.Nullable Dep @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "deprecatedRef") public DeprecatedObject getDeprecatedRef() { return deprecatedRef; @@ -151,6 +165,7 @@ public DeprecatedObject getDeprecatedRef() { @Deprecated @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "deprecatedRef") public void setDeprecatedRef(@jakarta.annotation.Nullable DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; } @@ -180,6 +195,8 @@ public ObjectWithDeprecatedFields addBarsItem(String barsItem) { @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bars") + @JacksonXmlElementWrapper(useWrapping = false) public List getBars() { return bars; @@ -189,6 +206,8 @@ public List getBars() { @Deprecated @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bars") + @JacksonXmlElementWrapper(useWrapping = false) public void setBars(@jakarta.annotation.Nullable List bars) { this.bars = bars; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index e9c3ecbda257..2b8d17ef38e6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -27,6 +27,8 @@ import java.time.OffsetDateTime; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -44,31 +46,43 @@ Order.JSON_PROPERTY_COMPLETE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Order") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Order") public class Order { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; + @XmlElement(name = "petId") @jakarta.annotation.Nullable private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @XmlElement(name = "quantity") @jakarta.annotation.Nullable private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @XmlElement(name = "shipDate") @jakarta.annotation.Nullable private OffsetDateTime shipDate; /** * Order Status */ + @XmlType(name="StatusEnum") + @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), + @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), + @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); private String value; @@ -99,10 +113,12 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @XmlElement(name = "status") @jakarta.annotation.Nullable private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; + @XmlElement(name = "complete") @jakarta.annotation.Nullable private Boolean complete = false; @@ -122,6 +138,7 @@ public Order id(@jakarta.annotation.Nullable Long id) { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -130,6 +147,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } @@ -148,6 +166,7 @@ public Order petId(@jakarta.annotation.Nullable Long petId) { @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") public Long getPetId() { return petId; @@ -156,6 +175,7 @@ public Long getPetId() { @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") public void setPetId(@jakarta.annotation.Nullable Long petId) { this.petId = petId; } @@ -174,6 +194,7 @@ public Order quantity(@jakarta.annotation.Nullable Integer quantity) { @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") public Integer getQuantity() { return quantity; @@ -182,6 +203,7 @@ public Integer getQuantity() { @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") public void setQuantity(@jakarta.annotation.Nullable Integer quantity) { this.quantity = quantity; } @@ -201,6 +223,7 @@ public Order shipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") public OffsetDateTime getShipDate() { return shipDate; @@ -209,6 +232,7 @@ public OffsetDateTime getShipDate() { @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") public void setShipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; } @@ -227,6 +251,7 @@ public Order status(@jakarta.annotation.Nullable StatusEnum status) { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public StatusEnum getStatus() { return status; @@ -235,6 +260,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; } @@ -253,6 +279,7 @@ public Order complete(@jakarta.annotation.Nullable Boolean complete) { @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") public Boolean getComplete() { return complete; @@ -261,6 +288,7 @@ public Boolean getComplete() { @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") public void setComplete(@jakarta.annotation.Nullable Boolean complete) { this.complete = complete; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java index c301bdc501ee..3cc31b9b31dd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,16 +43,22 @@ OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "OuterComposite") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "OuterComposite") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @XmlElement(name = "my_number") @jakarta.annotation.Nullable private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @XmlElement(name = "my_string") @jakarta.annotation.Nullable private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @XmlElement(name = "my_boolean") @jakarta.annotation.Nullable private Boolean myBoolean; @@ -71,6 +79,7 @@ public OuterComposite myNumber(@jakarta.annotation.Nullable BigDecimal myNumber) @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") public BigDecimal getMyNumber() { return myNumber; @@ -79,6 +88,7 @@ public BigDecimal getMyNumber() { @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") public void setMyNumber(@jakarta.annotation.Nullable BigDecimal myNumber) { this.myNumber = myNumber; } @@ -97,6 +107,7 @@ public OuterComposite myString(@jakarta.annotation.Nullable String myString) { @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") public String getMyString() { return myString; @@ -105,6 +116,7 @@ public String getMyString() { @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") public void setMyString(@jakarta.annotation.Nullable String myString) { this.myString = myString; } @@ -123,6 +135,7 @@ public OuterComposite myBoolean(@jakarta.annotation.Nullable Boolean myBoolean) @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") public Boolean getMyBoolean() { return myBoolean; @@ -131,6 +144,7 @@ public Boolean getMyBoolean() { @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") public void setMyBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java index a71ee104151e..8b79f4f467a4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -34,10 +36,13 @@ */ public enum OuterEnum { + @XmlEnumValue("placed") PLACED("placed"), + @XmlEnumValue("approved") APPROVED("approved"), + @XmlEnumValue("delivered") DELIVERED("delivered"); private String value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 078b0314b942..a8c9d28f8c7e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -34,10 +36,13 @@ */ public enum OuterEnumDefaultValue { + @XmlEnumValue("placed") PLACED("placed"), + @XmlEnumValue("approved") APPROVED("approved"), + @XmlEnumValue("delivered") DELIVERED("delivered"); private String value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index 8e89329674ed..92eddfdab714 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -34,10 +36,13 @@ */ public enum OuterEnumInteger { + @XmlEnumValue("0") NUMBER_0(0), + @XmlEnumValue("1") NUMBER_1(1), + @XmlEnumValue("2") NUMBER_2(2); private Integer value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 337e601ac81f..8545b1772a5a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -34,10 +36,13 @@ */ public enum OuterEnumIntegerDefaultValue { + @XmlEnumValue("0") NUMBER_0(0), + @XmlEnumValue("1") NUMBER_1(1), + @XmlEnumValue("2") NUMBER_2(2); private Integer value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java index a2115c44ec6a..d49e19b1a905 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -34,6 +34,8 @@ import java.util.Arrays; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -54,6 +56,9 @@ @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), }) +@XmlRootElement(name = "ParentPet") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ParentPet") public class ParentPet extends GrandparentAnimal { public ParentPet() { } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index 038622162ebc..c7e3a7848b28 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -30,6 +30,8 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -47,35 +49,50 @@ Pet.JSON_PROPERTY_STATUS }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Pet") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Pet") public class Pet { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; + @XmlElement(name = "Category") @jakarta.annotation.Nullable private Category category; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nonnull private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrl") @jakarta.annotation.Nonnull private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; + @XmlElement(name = "Tag") + @XmlElementWrapper(name = "tag") @jakarta.annotation.Nullable private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store */ + @XmlType(name="StatusEnum") + @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), + @XmlEnumValue("pending") PENDING(String.valueOf("pending")), + @XmlEnumValue("sold") SOLD(String.valueOf("sold")); private String value; @@ -106,6 +123,7 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @XmlElement(name = "status") @jakarta.annotation.Nullable private StatusEnum status; @@ -125,6 +143,7 @@ public Pet id(@jakarta.annotation.Nullable Long id) { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -133,6 +152,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } @@ -152,6 +172,7 @@ public Pet category(@jakarta.annotation.Nullable Category category) { @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Category") public Category getCategory() { return category; @@ -160,6 +181,7 @@ public Category getCategory() { @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Category") public void setCategory(@jakarta.annotation.Nullable Category category) { this.category = category; } @@ -179,6 +201,7 @@ public Pet name(@jakarta.annotation.Nonnull String name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -187,6 +210,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } @@ -214,6 +238,8 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public List getPhotoUrls() { return photoUrls; @@ -222,6 +248,8 @@ public List getPhotoUrls() { @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public void setPhotoUrls(@jakarta.annotation.Nonnull List photoUrls) { this.photoUrls = photoUrls; } @@ -249,6 +277,8 @@ public Pet addTagsItem(Tag tagsItem) { @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public List<@Valid Tag> getTags() { return tags; @@ -257,6 +287,8 @@ public Pet addTagsItem(Tag tagsItem) { @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public void setTags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { this.tags = tags; } @@ -275,6 +307,7 @@ public Pet status(@jakarta.annotation.Nullable StatusEnum status) { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public StatusEnum getStatus() { return status; @@ -283,6 +316,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index 818f55d39b79..aabc63730a9c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,6 +70,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Pig") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Pig") @JsonDeserialize(using = Pig.PigDeserializer.class) @JsonSerialize(using = Pig.PigSerializer.class) public class Pig extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index 35d2dc9ccb9f..edd5cf803d8b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,6 +70,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Quadrilateral") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Quadrilateral") @JsonDeserialize(using = Quadrilateral.QuadrilateralDeserializer.class) @JsonSerialize(using = Quadrilateral.QuadrilateralSerializer.class) public class Quadrilateral extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 2080ec4c6799..e1497b2b9534 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "QuadrilateralInterface") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "QuadrilateralInterface") public class QuadrilateralInterface { public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @XmlElement(name = "quadrilateralType") @jakarta.annotation.Nonnull private String quadrilateralType; @@ -60,6 +66,7 @@ public QuadrilateralInterface quadrilateralType(@jakarta.annotation.Nonnull Stri @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public String getQuadrilateralType() { return quadrilateralType; @@ -68,6 +75,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 90c9a0a5f58b..58df1df67387 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,26 +41,23 @@ ReadOnlyFirst.JSON_PROPERTY_BAZ }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ReadOnlyFirst") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ReadOnlyFirst") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @jakarta.annotation.Nullable private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; + @XmlElement(name = "baz") @jakarta.annotation.Nullable private String baz; public ReadOnlyFirst() { } - @JsonCreator - public ReadOnlyFirst( - @JsonProperty(JSON_PROPERTY_BAR) String bar - ) { - this(); - this.bar = bar; - } - /** * Get bar * @return bar @@ -67,6 +66,7 @@ public ReadOnlyFirst( @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -88,6 +88,7 @@ public ReadOnlyFirst baz(@jakarta.annotation.Nullable String baz) { @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") public String getBaz() { return baz; @@ -96,6 +97,7 @@ public String getBaz() { @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") public void setBaz(@jakarta.annotation.Nullable String baz) { this.baz = baz; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index e74fa321fe17..55cc839bfc18 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,12 +45,17 @@ ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ScaleneTriangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ScaleneTriangle") public class ScaleneTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @jakarta.annotation.Nonnull private String triangleType; @@ -69,6 +76,7 @@ public ScaleneTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -77,6 +85,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -96,6 +105,7 @@ public ScaleneTriangle triangleType(@jakarta.annotation.Nonnull String triangleT @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -104,6 +114,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index 9fe7464f6523..1089be6afdca 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,6 +70,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Shape") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Shape") @JsonDeserialize(using = Shape.ShapeDeserializer.class) @JsonSerialize(using = Shape.ShapeSerializer.class) public class Shape extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java index 191fdad601bf..7fa684260f8c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ ShapeInterface.JSON_PROPERTY_SHAPE_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ShapeInterface") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ShapeInterface") public class ShapeInterface { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @jakarta.annotation.Nonnull private String shapeType; @@ -60,6 +66,7 @@ public ShapeInterface shapeType(@jakarta.annotation.Nonnull String shapeType) { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -68,6 +75,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index bec1345b88e0..4f1228662794 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,6 +70,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ShapeOrNull") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ShapeOrNull") @JsonDeserialize(using = ShapeOrNull.ShapeOrNullDeserializer.class) @JsonSerialize(using = ShapeOrNull.ShapeOrNullSerializer.class) public class ShapeOrNull extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 20059d6e6913..43ad0e03386d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,12 +45,17 @@ SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "SimpleQuadrilateral") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "SimpleQuadrilateral") public class SimpleQuadrilateral { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @jakarta.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @XmlElement(name = "quadrilateralType") @jakarta.annotation.Nonnull private String quadrilateralType; @@ -69,6 +76,7 @@ public SimpleQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTyp @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -77,6 +85,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -96,6 +105,7 @@ public SimpleQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public String getQuadrilateralType() { return quadrilateralType; @@ -104,6 +114,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java index a959e524a59a..051e33caf627 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -40,12 +42,17 @@ }) @JsonTypeName("_special_model.name_") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "$special[model.name]") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "$special[model.name]") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @XmlElement(name = "$special[property.name]") @jakarta.annotation.Nullable private Long $specialPropertyName; public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; + @XmlElement(name = "_special_model.name_") @jakarta.annotation.Nullable private String specialModelName; @@ -65,6 +72,7 @@ public SpecialModelName() { @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; @@ -73,6 +81,7 @@ public SpecialModelName() { @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") public void set$SpecialPropertyName(@jakarta.annotation.Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } @@ -91,6 +100,7 @@ public SpecialModelName specialModelName(@jakarta.annotation.Nullable String spe @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_special_model.name_") public String getSpecialModelName() { return specialModelName; @@ -99,6 +109,7 @@ public String getSpecialModelName() { @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_special_model.name_") public void setSpecialModelName(@jakarta.annotation.Nullable String specialModelName) { this.specialModelName = specialModelName; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index cd03a6c58bd4..0ca9bb4cb047 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -39,12 +41,17 @@ Tag.JSON_PROPERTY_NAME }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Tag") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Tag") public class Tag { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @jakarta.annotation.Nullable private String name; @@ -64,6 +71,7 @@ public Tag id(@jakarta.annotation.Nullable Long id) { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -72,6 +80,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } @@ -90,6 +99,7 @@ public Tag name(@jakarta.annotation.Nullable String name) { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -98,6 +108,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 7f420c6972d0..64fb06b8a63f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -43,8 +45,12 @@ }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "TestInlineFreeformAdditionalPropertiesRequest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TestInlineFreeformAdditionalPropertiesRequest") public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + @XmlElement(name = "someProperty") @jakarta.annotation.Nullable private String someProperty; @@ -64,6 +70,7 @@ public TestInlineFreeformAdditionalPropertiesRequest someProperty(@jakarta.annot @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "someProperty") public String getSomeProperty() { return someProperty; @@ -72,6 +79,7 @@ public String getSomeProperty() { @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "someProperty") public void setSomeProperty(@jakarta.annotation.Nullable String someProperty) { this.someProperty = someProperty; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index a8d5aed6552b..06d1434fd568 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -36,6 +36,8 @@ import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -69,6 +71,9 @@ import org.openapitools.client.JSON; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Triangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Triangle") @JsonDeserialize(using = Triangle.TriangleDeserializer.class) @JsonSerialize(using = Triangle.TriangleSerializer.class) public class Triangle extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java index a1699b68ba8a..6a197d484be7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "TriangleInterface") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TriangleInterface") public class TriangleInterface { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @jakarta.annotation.Nonnull private String triangleType; @@ -60,6 +66,7 @@ public TriangleInterface triangleType(@jakarta.annotation.Nonnull String triangl @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -68,6 +75,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index 5d0b58c003d2..a0f48b981a1f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -30,6 +30,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -53,50 +55,65 @@ User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "User") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "User") public class User { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; + @XmlElement(name = "username") @jakarta.annotation.Nullable private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @XmlElement(name = "firstName") @jakarta.annotation.Nullable private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @XmlElement(name = "lastName") @jakarta.annotation.Nullable private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; + @XmlElement(name = "email") @jakarta.annotation.Nullable private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; + @XmlElement(name = "password") @jakarta.annotation.Nullable private String password; public static final String JSON_PROPERTY_PHONE = "phone"; + @XmlElement(name = "phone") @jakarta.annotation.Nullable private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @XmlElement(name = "userStatus") @jakarta.annotation.Nullable private Integer userStatus; public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + @XmlElement(name = "objectWithNoDeclaredProps") @jakarta.annotation.Nullable private Object objectWithNoDeclaredProps; public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + @XmlElement(name = "objectWithNoDeclaredPropsNullable") private JsonNullable objectWithNoDeclaredPropsNullable = JsonNullable.undefined(); public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; + @XmlElement(name = "anyTypeProp") private JsonNullable anyTypeProp = JsonNullable.of(null); public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + @XmlElement(name = "anyTypePropNullable") private JsonNullable anyTypePropNullable = JsonNullable.of(null); public User() { @@ -115,6 +132,7 @@ public User id(@jakarta.annotation.Nullable Long id) { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -123,6 +141,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@jakarta.annotation.Nullable Long id) { this.id = id; } @@ -141,6 +160,7 @@ public User username(@jakarta.annotation.Nullable String username) { @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") public String getUsername() { return username; @@ -149,6 +169,7 @@ public String getUsername() { @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") public void setUsername(@jakarta.annotation.Nullable String username) { this.username = username; } @@ -167,6 +188,7 @@ public User firstName(@jakarta.annotation.Nullable String firstName) { @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") public String getFirstName() { return firstName; @@ -175,6 +197,7 @@ public String getFirstName() { @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") public void setFirstName(@jakarta.annotation.Nullable String firstName) { this.firstName = firstName; } @@ -193,6 +216,7 @@ public User lastName(@jakarta.annotation.Nullable String lastName) { @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") public String getLastName() { return lastName; @@ -201,6 +225,7 @@ public String getLastName() { @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") public void setLastName(@jakarta.annotation.Nullable String lastName) { this.lastName = lastName; } @@ -219,6 +244,7 @@ public User email(@jakarta.annotation.Nullable String email) { @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") public String getEmail() { return email; @@ -227,6 +253,7 @@ public String getEmail() { @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") public void setEmail(@jakarta.annotation.Nullable String email) { this.email = email; } @@ -245,6 +272,7 @@ public User password(@jakarta.annotation.Nullable String password) { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") public String getPassword() { return password; @@ -253,6 +281,7 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") public void setPassword(@jakarta.annotation.Nullable String password) { this.password = password; } @@ -271,6 +300,7 @@ public User phone(@jakarta.annotation.Nullable String phone) { @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") public String getPhone() { return phone; @@ -279,6 +309,7 @@ public String getPhone() { @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") public void setPhone(@jakarta.annotation.Nullable String phone) { this.phone = phone; } @@ -297,6 +328,7 @@ public User userStatus(@jakarta.annotation.Nullable Integer userStatus) { @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") public Integer getUserStatus() { return userStatus; @@ -305,6 +337,7 @@ public Integer getUserStatus() { @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") public void setUserStatus(@jakarta.annotation.Nullable Integer userStatus) { this.userStatus = userStatus; } @@ -323,6 +356,7 @@ public User objectWithNoDeclaredProps(@jakarta.annotation.Nullable Object object @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "objectWithNoDeclaredProps") public Object getObjectWithNoDeclaredProps() { return objectWithNoDeclaredProps; @@ -331,6 +365,7 @@ public Object getObjectWithNoDeclaredProps() { @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "objectWithNoDeclaredProps") public void setObjectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; } @@ -355,6 +390,7 @@ public Object getObjectWithNoDeclaredPropsNullable() { @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "objectWithNoDeclaredPropsNullable") public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { return objectWithNoDeclaredPropsNullable; @@ -389,6 +425,7 @@ public Object getAnyTypeProp() { @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anyTypeProp") public JsonNullable getAnyTypeProp_JsonNullable() { return anyTypeProp; @@ -423,6 +460,7 @@ public Object getAnyTypePropNullable() { @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anyTypePropNullable") public JsonNullable getAnyTypePropNullable_JsonNullable() { return anyTypePropNullable; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java index 7c6418f689d6..8b262b853d69 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -41,16 +43,22 @@ }) @JsonTypeName("whale") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Whale") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Whale") public class Whale { public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; + @XmlElement(name = "hasBaleen") @jakarta.annotation.Nullable private Boolean hasBaleen; public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; + @XmlElement(name = "hasTeeth") @jakarta.annotation.Nullable private Boolean hasTeeth; public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @jakarta.annotation.Nonnull private String className; @@ -70,6 +78,7 @@ public Whale hasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasBaleen") public Boolean getHasBaleen() { return hasBaleen; @@ -78,6 +87,7 @@ public Boolean getHasBaleen() { @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasBaleen") public void setHasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { this.hasBaleen = hasBaleen; } @@ -96,6 +106,7 @@ public Whale hasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasTeeth") public Boolean getHasTeeth() { return hasTeeth; @@ -104,6 +115,7 @@ public Boolean getHasTeeth() { @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasTeeth") public void setHasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { this.hasTeeth = hasTeeth; } @@ -123,6 +135,7 @@ public Whale className(@jakarta.annotation.Nonnull String className) { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -131,6 +144,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index f1c101b144b1..3b46a88c3771 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import jakarta.xml.bind.annotation.*; import jakarta.validation.constraints.*; import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -44,15 +46,23 @@ }) @JsonTypeName("zebra") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Zebra") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Zebra") public class Zebra { /** * Gets or Sets type */ + @XmlType(name="TypeEnum") + @XmlEnum(String.class) public enum TypeEnum { + @XmlEnumValue("plains") PLAINS(String.valueOf("plains")), + @XmlEnumValue("mountain") MOUNTAIN(String.valueOf("mountain")), + @XmlEnumValue("grevys") GREVYS(String.valueOf("grevys")); private String value; @@ -83,10 +93,12 @@ public static TypeEnum fromValue(String value) { } public static final String JSON_PROPERTY_TYPE = "type"; + @XmlElement(name = "type") @jakarta.annotation.Nullable private TypeEnum type; public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @jakarta.annotation.Nonnull private String className; @@ -106,6 +118,7 @@ public Zebra type(@jakarta.annotation.Nullable TypeEnum type) { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public TypeEnum getType() { return type; @@ -114,6 +127,7 @@ public TypeEnum getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public void setType(@jakarta.annotation.Nullable TypeEnum type) { this.type = type; } @@ -133,6 +147,7 @@ public Zebra className(@jakarta.annotation.Nonnull String className) { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -141,6 +156,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@jakarta.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index dc1553b3a5ad..a40a1154728c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -59,6 +59,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -749,8 +750,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -760,12 +760,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index 3be6c9dfdf28..c997b464e243 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -59,6 +59,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -700,8 +701,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -711,12 +711,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java index e72125466c4c..34af21902cad 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/src/main/java/org/openapitools/client/ApiClient.java @@ -60,6 +60,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -825,8 +826,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -836,12 +836,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java index e72125466c4c..34af21902cad 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -60,6 +60,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -825,8 +826,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -836,12 +836,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 9257196066d4..6c76487fbacb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -107,6 +107,7 @@ ext { scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" commons_lang3_version = "3.17.0" + jaxb_version = "2.3.9" } dependencies { @@ -119,6 +120,11 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "org.glassfish.jersey.media:jersey-media-jaxb:$jersey_version" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_databind_version" + if (JavaVersion.current().isJava11Compatible()) { + implementation "org.glassfish.jaxb:jaxb-runtime:$jaxb_version" + } implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index 7faa629a5673..6a564f548090 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -248,6 +248,21 @@ + + jaxb-runtime + + + [11,) + + + + + org.glassfish.jaxb + jaxb-runtime + ${jaxb-version} + + + @@ -302,6 +317,19 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey-version} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + + ${jackson-databind-version} + com.fasterxml.jackson.datatype jackson-datatype-jsr310 @@ -351,6 +379,7 @@ 0.2.7 1.3.5 2.0.2 + 2.3.9 5.10.0 1.8 8.3.3 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index dda9d3abeca0..2385b31b692b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -60,6 +60,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; @@ -923,8 +924,7 @@ public boolean isJsonMime(String mime) { /** * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * if JSON exists in the given array, makes sure there is only one entry of it. * * @param accepts The accepts array to select from * @return The Accept header to use. If the given array is empty, @@ -934,12 +934,19 @@ public String selectHeaderAccept(String... accepts) { if (accepts == null || accepts.length == 0) { return null; } + Set acceptHeaders = new LinkedHashSet<>(); + boolean foundJsonMime = false; for (String accept : accepts) { if (isJsonMime(accept)) { - return accept; + if (foundJsonMime) { + continue; + } else { + foundJsonMime = true; + } } + acceptHeaders.add(accept); } - return StringUtil.join(accepts, ","); + return StringUtil.join(acceptHeaders, ","); } /** diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index fa854d63e69a..0dd4ff31d8f2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -32,6 +32,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -49,35 +51,46 @@ AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AdditionalPropertiesClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + @XmlElement(name = "map_property") @javax.annotation.Nullable private Map mapProperty = new HashMap<>(); public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + @XmlElement(name = "map_of_map_property") @javax.annotation.Nullable private Map> mapOfMapProperty = new HashMap<>(); public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @XmlElement(name = "anytype_1") private JsonNullable anytype1 = JsonNullable.of(null); public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; + @XmlElement(name = "map_with_undeclared_properties_anytype_1") @javax.annotation.Nullable private Object mapWithUndeclaredPropertiesAnytype1; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; + @XmlElement(name = "map_with_undeclared_properties_anytype_2") @javax.annotation.Nullable private Object mapWithUndeclaredPropertiesAnytype2; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; + @XmlElement(name = "map_with_undeclared_properties_anytype_3") @javax.annotation.Nullable private Map mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; + @XmlElement(name = "empty_map") @javax.annotation.Nullable private Object emptyMap; public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; + @XmlElement(name = "map_with_undeclared_properties_string") @javax.annotation.Nullable private Map mapWithUndeclaredPropertiesString = new HashMap<>(); @@ -104,6 +117,8 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_property") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapProperty() { return mapProperty; @@ -112,6 +127,8 @@ public Map getMapProperty() { @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_property") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapProperty(@javax.annotation.Nullable Map mapProperty) { this.mapProperty = mapProperty; } @@ -137,6 +154,8 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; @@ -145,6 +164,8 @@ public Map> getMapOfMapProperty() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_map_property") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapOfMapProperty(@javax.annotation.Nullable Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } @@ -168,6 +189,7 @@ public Object getAnytype1() { @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anytype_1") public JsonNullable getAnytype1_JsonNullable() { return anytype1; @@ -195,6 +217,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(@javax.anno @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_1") public Object getMapWithUndeclaredPropertiesAnytype1() { return mapWithUndeclaredPropertiesAnytype1; @@ -203,6 +226,7 @@ public Object getMapWithUndeclaredPropertiesAnytype1() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_1") public void setMapWithUndeclaredPropertiesAnytype1(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; } @@ -220,6 +244,7 @@ public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(@javax.anno @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_2") public Object getMapWithUndeclaredPropertiesAnytype2() { return mapWithUndeclaredPropertiesAnytype2; @@ -228,6 +253,7 @@ public Object getMapWithUndeclaredPropertiesAnytype2() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_2") public void setMapWithUndeclaredPropertiesAnytype2(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; } @@ -253,6 +279,8 @@ public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(Stri @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_3") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapWithUndeclaredPropertiesAnytype3() { return mapWithUndeclaredPropertiesAnytype3; @@ -261,6 +289,8 @@ public Map getMapWithUndeclaredPropertiesAnytype3() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_anytype_3") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapWithUndeclaredPropertiesAnytype3(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; } @@ -278,6 +308,7 @@ public AdditionalPropertiesClass emptyMap(@javax.annotation.Nullable Object empt @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "empty_map") public Object getEmptyMap() { return emptyMap; @@ -286,6 +317,7 @@ public Object getEmptyMap() { @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "empty_map") public void setEmptyMap(@javax.annotation.Nullable Object emptyMap) { this.emptyMap = emptyMap; } @@ -311,6 +343,8 @@ public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapWithUndeclaredPropertiesString() { return mapWithUndeclaredPropertiesString; @@ -319,6 +353,8 @@ public Map getMapWithUndeclaredPropertiesString() { @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_with_undeclared_properties_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesString) { this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 4e13d6670007..6bf22bb8c31c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -29,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -50,12 +52,17 @@ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) +@XmlRootElement(name = "Animal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Animal") public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @javax.annotation.Nonnull private String className; public static final String JSON_PROPERTY_COLOR = "color"; + @XmlElement(name = "color") @javax.annotation.Nullable private String color = "red"; @@ -74,6 +81,7 @@ public Animal className(@javax.annotation.Nonnull String className) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -82,6 +90,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@javax.annotation.Nonnull String className) { this.className = className; } @@ -99,6 +108,7 @@ public Animal color(@javax.annotation.Nullable String color) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") public String getColor() { return color; @@ -107,6 +117,7 @@ public String getColor() { @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "color") public void setColor(@javax.annotation.Nullable String color) { this.color = color; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index 1af4c3ef0073..c72e0161c4d2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,12 +40,17 @@ }) @JsonTypeName("apple") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Apple") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Apple") public class Apple { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + @XmlElement(name = "cultivar") @javax.annotation.Nullable private String cultivar; public static final String JSON_PROPERTY_ORIGIN = "origin"; + @XmlElement(name = "origin") @javax.annotation.Nullable private String origin; @@ -62,6 +69,7 @@ public Apple cultivar(@javax.annotation.Nullable String cultivar) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "cultivar") public String getCultivar() { return cultivar; @@ -70,6 +78,7 @@ public String getCultivar() { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "cultivar") public void setCultivar(@javax.annotation.Nullable String cultivar) { this.cultivar = cultivar; } @@ -87,6 +96,7 @@ public Apple origin(@javax.annotation.Nullable String origin) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "origin") public String getOrigin() { return origin; @@ -95,6 +105,7 @@ public String getOrigin() { @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "origin") public void setOrigin(@javax.annotation.Nullable String origin) { this.origin = origin; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 9edb110081ef..87eacbaddc09 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,12 +40,17 @@ }) @JsonTypeName("appleReq") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "AppleReq") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "AppleReq") public class AppleReq { public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + @XmlElement(name = "cultivar") @javax.annotation.Nonnull private String cultivar; public static final String JSON_PROPERTY_MEALY = "mealy"; + @XmlElement(name = "mealy") @javax.annotation.Nullable private Boolean mealy; @@ -62,6 +69,7 @@ public AppleReq cultivar(@javax.annotation.Nonnull String cultivar) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "cultivar") public String getCultivar() { return cultivar; @@ -70,6 +78,7 @@ public String getCultivar() { @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "cultivar") public void setCultivar(@javax.annotation.Nonnull String cultivar) { this.cultivar = cultivar; } @@ -87,6 +96,7 @@ public AppleReq mealy(@javax.annotation.Nullable Boolean mealy) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mealy") public Boolean getMealy() { return mealy; @@ -95,6 +105,7 @@ public Boolean getMealy() { @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mealy") public void setMealy(@javax.annotation.Nullable Boolean mealy) { this.mealy = mealy; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 2d1c4803a5ee..e04237ef3cd5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayOfArrayOfNumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @XmlElement(name = "ArrayArrayNumber") @javax.annotation.Nullable private List> arrayArrayNumber = new ArrayList<>(); @@ -67,6 +73,8 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayNumber() { return arrayArrayNumber; @@ -75,6 +83,8 @@ public List> getArrayArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayNumber(@javax.annotation.Nullable List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index e38bf371714d..71c6a977fd21 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,8 +41,12 @@ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayOfNumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @XmlElement(name = "ArrayNumber") @javax.annotation.Nullable private List arrayNumber = new ArrayList<>(); @@ -67,6 +73,8 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayNumber() { return arrayNumber; @@ -75,6 +83,8 @@ public List getArrayNumber() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ArrayNumber") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayNumber(@javax.annotation.Nullable List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 0c65b12517d1..e1cfddd14f83 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,6 +29,8 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,16 +43,22 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ArrayTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @XmlElement(name = "array_of_string") @javax.annotation.Nullable private List arrayOfString = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @XmlElement(name = "array_array_of_integer") @javax.annotation.Nullable private List> arrayArrayOfInteger = new ArrayList<>(); public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @XmlElement(name = "array_array_of_model") @javax.annotation.Nullable private List> arrayArrayOfModel = new ArrayList<>(); @@ -77,6 +85,8 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayOfString() { return arrayOfString; @@ -85,6 +95,8 @@ public List getArrayOfString() { @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayOfString(@javax.annotation.Nullable List arrayOfString) { this.arrayOfString = arrayOfString; } @@ -110,6 +122,8 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_integer") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; @@ -118,6 +132,8 @@ public List> getArrayArrayOfInteger() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_integer") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayOfInteger(@javax.annotation.Nullable List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } @@ -143,6 +159,8 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_model") + @JacksonXmlElementWrapper(useWrapping = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; @@ -151,6 +169,8 @@ public List> getArrayArrayOfModel() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_array_of_model") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayArrayOfModel(@javax.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java index e967bc8848bf..0a34ce218444 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ }) @JsonTypeName("banana") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Banana") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Banana") public class Banana { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + @XmlElement(name = "lengthCm") @javax.annotation.Nullable private BigDecimal lengthCm; @@ -58,6 +64,7 @@ public Banana lengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lengthCm") public BigDecimal getLengthCm() { return lengthCm; @@ -66,6 +73,7 @@ public BigDecimal getLengthCm() { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lengthCm") public void setLengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { this.lengthCm = lengthCm; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java index 71f0f7da1d5c..51d04f4fecc1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,12 +41,17 @@ }) @JsonTypeName("bananaReq") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "BananaReq") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BananaReq") public class BananaReq { public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + @XmlElement(name = "lengthCm") @javax.annotation.Nonnull private BigDecimal lengthCm; public static final String JSON_PROPERTY_SWEET = "sweet"; + @XmlElement(name = "sweet") @javax.annotation.Nullable private Boolean sweet; @@ -63,6 +70,7 @@ public BananaReq lengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "lengthCm") public BigDecimal getLengthCm() { return lengthCm; @@ -71,6 +79,7 @@ public BigDecimal getLengthCm() { @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "lengthCm") public void setLengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { this.lengthCm = lengthCm; } @@ -88,6 +97,7 @@ public BananaReq sweet(@javax.annotation.Nullable Boolean sweet) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sweet") public Boolean getSweet() { return sweet; @@ -96,6 +106,7 @@ public Boolean getSweet() { @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sweet") public void setSweet(@javax.annotation.Nullable Boolean sweet) { this.sweet = sweet; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java index b546824fc773..72faacc3b553 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ BasquePig.JSON_PROPERTY_CLASS_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "BasquePig") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BasquePig") public class BasquePig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @javax.annotation.Nonnull private String className; @@ -56,6 +62,7 @@ public BasquePig className(@javax.annotation.Nonnull String className) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -64,6 +71,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@javax.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index 3aba77b7eb77..2351f1fc6f54 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,28 +43,37 @@ Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Capitalization") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Capitalization") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @XmlElement(name = "smallCamel") @javax.annotation.Nullable private String smallCamel; public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @XmlElement(name = "CapitalCamel") @javax.annotation.Nullable private String capitalCamel; public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @XmlElement(name = "small_Snake") @javax.annotation.Nullable private String smallSnake; public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @XmlElement(name = "Capital_Snake") @javax.annotation.Nullable private String capitalSnake; public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @XmlElement(name = "SCA_ETH_Flow_Points") @javax.annotation.Nullable private String scAETHFlowPoints; public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @XmlElement(name = "ATT_NAME") @javax.annotation.Nullable private String ATT_NAME; @@ -81,6 +92,7 @@ public Capitalization smallCamel(@javax.annotation.Nullable String smallCamel) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") public String getSmallCamel() { return smallCamel; @@ -89,6 +101,7 @@ public String getSmallCamel() { @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "smallCamel") public void setSmallCamel(@javax.annotation.Nullable String smallCamel) { this.smallCamel = smallCamel; } @@ -106,6 +119,7 @@ public Capitalization capitalCamel(@javax.annotation.Nullable String capitalCame @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") public String getCapitalCamel() { return capitalCamel; @@ -114,6 +128,7 @@ public String getCapitalCamel() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "CapitalCamel") public void setCapitalCamel(@javax.annotation.Nullable String capitalCamel) { this.capitalCamel = capitalCamel; } @@ -131,6 +146,7 @@ public Capitalization smallSnake(@javax.annotation.Nullable String smallSnake) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") public String getSmallSnake() { return smallSnake; @@ -139,6 +155,7 @@ public String getSmallSnake() { @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "small_Snake") public void setSmallSnake(@javax.annotation.Nullable String smallSnake) { this.smallSnake = smallSnake; } @@ -156,6 +173,7 @@ public Capitalization capitalSnake(@javax.annotation.Nullable String capitalSnak @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") public String getCapitalSnake() { return capitalSnake; @@ -164,6 +182,7 @@ public String getCapitalSnake() { @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Capital_Snake") public void setCapitalSnake(@javax.annotation.Nullable String capitalSnake) { this.capitalSnake = capitalSnake; } @@ -181,6 +200,7 @@ public Capitalization scAETHFlowPoints(@javax.annotation.Nullable String scAETHF @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { return scAETHFlowPoints; @@ -189,6 +209,7 @@ public String getScAETHFlowPoints() { @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") public void setScAETHFlowPoints(@javax.annotation.Nullable String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } @@ -206,6 +227,7 @@ public Capitalization ATT_NAME(@javax.annotation.Nullable String ATT_NAME) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") public String getATTNAME() { return ATT_NAME; @@ -214,6 +236,7 @@ public String getATTNAME() { @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "ATT_NAME") public void setATTNAME(@javax.annotation.Nullable String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 99650f16655f..72523acb15ba 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,8 @@ import java.util.Map; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -51,8 +53,12 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@XmlRootElement(name = "Cat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Cat") public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @XmlElement(name = "declawed") @javax.annotation.Nullable private Boolean declawed; @@ -71,6 +77,7 @@ public Cat declawed(@javax.annotation.Nullable Boolean declawed) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") public Boolean getDeclawed() { return declawed; @@ -79,6 +86,7 @@ public Boolean getDeclawed() { @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "declawed") public void setDeclawed(@javax.annotation.Nullable Boolean declawed) { this.declawed = declawed; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 732e5a37d133..1e3ff6857257 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,12 +39,17 @@ Category.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Category") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Category") public class Category { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nonnull private String name = "default-name"; @@ -61,6 +68,7 @@ public Category id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -69,6 +77,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -86,6 +95,7 @@ public Category name(@javax.annotation.Nonnull String name) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -94,6 +104,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nonnull String name) { this.name = name; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index 3560f406ad90..2a40c7f510f8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -36,6 +36,8 @@ import java.util.Set; import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -53,12 +55,17 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) +@XmlRootElement(name = "ChildCat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ChildCat") public class ChildCat extends ParentPet { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + @XmlElement(name = "pet_type") @javax.annotation.Nullable private String petType = "ChildCat"; @@ -77,6 +84,7 @@ public ChildCat name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -85,6 +93,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } @@ -110,6 +119,7 @@ public ChildCat petType(@javax.annotation.Nullable String petType) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pet_type") public String getPetType() { return petType; @@ -118,6 +128,7 @@ public String getPetType() { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pet_type") public void setPetType(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 29eb65e830dd..2820dc074bc0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ClassModel") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ClassModel") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @XmlElement(name = "_class") @javax.annotation.Nullable private String propertyClass; @@ -56,6 +62,7 @@ public ClassModel propertyClass(@javax.annotation.Nullable String propertyClass) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") public String getPropertyClass() { return propertyClass; @@ -64,6 +71,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_class") public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 5da07ff0be1e..8ae8cbf4264a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ Client.JSON_PROPERTY_CLIENT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Client") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Client") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; + @XmlElement(name = "client") @javax.annotation.Nullable private String client; @@ -56,6 +62,7 @@ public Client client(@javax.annotation.Nullable String client) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") public String getClient() { return client; @@ -64,6 +71,7 @@ public String getClient() { @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "client") public void setClient(@javax.annotation.Nullable String client) { this.client = client; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 845722b8cf4d..6a4a3b708f03 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,12 +43,17 @@ ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ComplexQuadrilateral") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ComplexQuadrilateral") public class ComplexQuadrilateral { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @javax.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @XmlElement(name = "quadrilateralType") @javax.annotation.Nonnull private String quadrilateralType; @@ -65,6 +72,7 @@ public ComplexQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -73,6 +81,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@javax.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -90,6 +99,7 @@ public ComplexQuadrilateral quadrilateralType(@javax.annotation.Nonnull String q @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public String getQuadrilateralType() { return quadrilateralType; @@ -98,6 +108,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java index d726472cb090..537f81b10d16 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ DanishPig.JSON_PROPERTY_CLASS_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "DanishPig") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "DanishPig") public class DanishPig { public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @javax.annotation.Nonnull private String className; @@ -56,6 +62,7 @@ public DanishPig className(@javax.annotation.Nonnull String className) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -64,6 +71,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@javax.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 29ae881de1fe..88049ca8c7cb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ DeprecatedObject.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "DeprecatedObject") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "DeprecatedObject") public class DeprecatedObject { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -58,6 +64,7 @@ public DeprecatedObject name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -66,6 +73,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 26b9baa4b67c..0765400e2e56 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,8 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -50,8 +52,12 @@ ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@XmlRootElement(name = "Dog") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Dog") public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; + @XmlElement(name = "breed") @javax.annotation.Nullable private String breed; @@ -70,6 +76,7 @@ public Dog breed(@javax.annotation.Nullable String breed) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") public String getBreed() { return breed; @@ -78,6 +85,7 @@ public String getBreed() { @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "breed") public void setBreed(@javax.annotation.Nullable String breed) { this.breed = breed; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index eba52d9000e5..44072170da76 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -40,6 +40,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -53,18 +55,25 @@ Drawing.JSON_PROPERTY_SHAPES }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Drawing") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Drawing") public class Drawing { public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; + @XmlElement(name = "mainShape") @javax.annotation.Nullable private Shape mainShape; public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; + @XmlElement(name = "shapeOrNull") private JsonNullable shapeOrNull = JsonNullable.undefined(); public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; + @XmlElement(name = "nullableShape") private JsonNullable nullableShape = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHAPES = "shapes"; + @XmlElement(name = "shapes") @javax.annotation.Nullable private List shapes = new ArrayList<>(); @@ -83,6 +92,7 @@ public Drawing mainShape(@javax.annotation.Nullable Shape mainShape) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mainShape") public Shape getMainShape() { return mainShape; @@ -91,6 +101,7 @@ public Shape getMainShape() { @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "mainShape") public void setMainShape(@javax.annotation.Nullable Shape mainShape) { this.mainShape = mainShape; } @@ -114,6 +125,7 @@ public ShapeOrNull getShapeOrNull() { @JsonProperty(value = JSON_PROPERTY_SHAPE_OR_NULL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shapeOrNull") public JsonNullable getShapeOrNull_JsonNullable() { return shapeOrNull; @@ -147,6 +159,7 @@ public NullableShape getNullableShape() { @JsonProperty(value = JSON_PROPERTY_NULLABLE_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "nullableShape") public JsonNullable getNullableShape_JsonNullable() { return nullableShape; @@ -182,6 +195,8 @@ public Drawing addShapesItem(Shape shapesItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shapes") + @JacksonXmlElementWrapper(useWrapping = false) public List getShapes() { return shapes; @@ -190,6 +205,8 @@ public List getShapes() { @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shapes") + @JacksonXmlElementWrapper(useWrapping = false) public void setShapes(@javax.annotation.Nullable List shapes) { this.shapes = shapes; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index caac2d516ad7..8c1df732540c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -28,6 +28,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,13 +41,20 @@ EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EnumArrays") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EnumArrays") public class EnumArrays { /** * Gets or Sets justSymbol */ + @XmlType(name="JustSymbolEnum") + @XmlEnum(String.class) public enum JustSymbolEnum { + @XmlEnumValue(">=") GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), + @XmlEnumValue("$") DOLLAR(String.valueOf("$")); private String value; @@ -76,15 +85,20 @@ public static JustSymbolEnum fromValue(String value) { } public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @XmlElement(name = "just_symbol") @javax.annotation.Nullable private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum */ + @XmlType(name="ArrayEnumEnum") + @XmlEnum(String.class) public enum ArrayEnumEnum { + @XmlEnumValue("fish") FISH(String.valueOf("fish")), + @XmlEnumValue("crab") CRAB(String.valueOf("crab")); private String value; @@ -115,6 +129,7 @@ public static ArrayEnumEnum fromValue(String value) { } public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @XmlElement(name = "array_enum") @javax.annotation.Nullable private List arrayEnum = new ArrayList<>(); @@ -133,6 +148,7 @@ public EnumArrays justSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbo @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") public JustSymbolEnum getJustSymbol() { return justSymbol; @@ -141,6 +157,7 @@ public JustSymbolEnum getJustSymbol() { @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "just_symbol") public void setJustSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } @@ -166,6 +183,8 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_enum") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayEnum() { return arrayEnum; @@ -174,6 +193,8 @@ public List getArrayEnum() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_enum") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayEnum(@javax.annotation.Nullable List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java index ba8dad747c8d..dc8eecb9feb9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -32,10 +34,13 @@ */ public enum EnumClass { + @XmlEnumValue("_abc") _ABC("_abc"), + @XmlEnumValue("-efg") _EFG("-efg"), + @XmlEnumValue("(xyz)") _XYZ_("(xyz)"); private String value; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 4b050ad97e80..b10da4e6fefc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -34,6 +34,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -53,15 +55,23 @@ }) @JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EnumTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EnumTest") public class EnumTest { /** * Gets or Sets enumString */ + @XmlType(name="EnumStringEnum") + @XmlEnum(String.class) public enum EnumStringEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")), + @XmlEnumValue("") EMPTY(String.valueOf("")); private String value; @@ -92,17 +102,23 @@ public static EnumStringEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @XmlElement(name = "enum_string") @javax.annotation.Nullable private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired */ + @XmlType(name="EnumStringRequiredEnum") + @XmlEnum(String.class) public enum EnumStringRequiredEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")), + @XmlEnumValue("") EMPTY(String.valueOf("")); private String value; @@ -133,15 +149,20 @@ public static EnumStringRequiredEnum fromValue(String value) { } public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @XmlElement(name = "enum_string_required") @javax.annotation.Nonnull private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger */ + @XmlType(name="EnumIntegerEnum") + @XmlEnum(Integer.class) public enum EnumIntegerEnum { + @XmlEnumValue("1") NUMBER_1(Integer.valueOf(1)), + @XmlEnumValue("-1") NUMBER_MINUS_1(Integer.valueOf(-1)); private Integer value; @@ -172,15 +193,20 @@ public static EnumIntegerEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @XmlElement(name = "enum_integer") @javax.annotation.Nullable private EnumIntegerEnum enumInteger; /** * Gets or Sets enumIntegerOnly */ + @XmlType(name="EnumIntegerOnlyEnum") + @XmlEnum(Integer.class) public enum EnumIntegerOnlyEnum { + @XmlEnumValue("2") NUMBER_2(Integer.valueOf(2)), + @XmlEnumValue("-2") NUMBER_MINUS_2(Integer.valueOf(-2)); private Integer value; @@ -211,15 +237,20 @@ public static EnumIntegerOnlyEnum fromValue(Integer value) { } public static final String JSON_PROPERTY_ENUM_INTEGER_ONLY = "enum_integer_only"; + @XmlElement(name = "enum_integer_only") @javax.annotation.Nullable private EnumIntegerOnlyEnum enumIntegerOnly; /** * Gets or Sets enumNumber */ + @XmlType(name="EnumNumberEnum") + @XmlEnum(Double.class) public enum EnumNumberEnum { + @XmlEnumValue("1.1") NUMBER_1_DOT_1(Double.valueOf(1.1)), + @XmlEnumValue("-1.2") NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); private Double value; @@ -250,21 +281,26 @@ public static EnumNumberEnum fromValue(Double value) { } public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @XmlElement(name = "enum_number") @javax.annotation.Nullable private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @XmlElement(name = "outerEnum") private JsonNullable outerEnum = JsonNullable.undefined(); public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + @XmlElement(name = "outerEnumInteger") @javax.annotation.Nullable private OuterEnumInteger outerEnumInteger; public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + @XmlElement(name = "outerEnumDefaultValue") @javax.annotation.Nullable private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + @XmlElement(name = "outerEnumIntegerDefaultValue") @javax.annotation.Nullable private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; @@ -283,6 +319,7 @@ public EnumTest enumString(@javax.annotation.Nullable EnumStringEnum enumString) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") public EnumStringEnum getEnumString() { return enumString; @@ -291,6 +328,7 @@ public EnumStringEnum getEnumString() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_string") public void setEnumString(@javax.annotation.Nullable EnumStringEnum enumString) { this.enumString = enumString; } @@ -308,6 +346,7 @@ public EnumTest enumStringRequired(@javax.annotation.Nonnull EnumStringRequiredE @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; @@ -316,6 +355,7 @@ public EnumStringRequiredEnum getEnumStringRequired() { @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "enum_string_required") public void setEnumStringRequired(@javax.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } @@ -333,6 +373,7 @@ public EnumTest enumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteg @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") public EnumIntegerEnum getEnumInteger() { return enumInteger; @@ -341,6 +382,7 @@ public EnumIntegerEnum getEnumInteger() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer") public void setEnumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } @@ -358,6 +400,7 @@ public EnumTest enumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum e @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer_only") public EnumIntegerOnlyEnum getEnumIntegerOnly() { return enumIntegerOnly; @@ -366,6 +409,7 @@ public EnumIntegerOnlyEnum getEnumIntegerOnly() { @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_integer_only") public void setEnumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { this.enumIntegerOnly = enumIntegerOnly; } @@ -383,6 +427,7 @@ public EnumTest enumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") public EnumNumberEnum getEnumNumber() { return enumNumber; @@ -391,6 +436,7 @@ public EnumNumberEnum getEnumNumber() { @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "enum_number") public void setEnumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @@ -414,6 +460,7 @@ public OuterEnum getOuterEnum() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnum") public JsonNullable getOuterEnum_JsonNullable() { return outerEnum; @@ -441,6 +488,7 @@ public EnumTest outerEnumInteger(@javax.annotation.Nullable OuterEnumInteger out @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumInteger") public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; @@ -449,6 +497,7 @@ public OuterEnumInteger getOuterEnumInteger() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumInteger") public void setOuterEnumInteger(@javax.annotation.Nullable OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; } @@ -466,6 +515,7 @@ public EnumTest outerEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaul @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumDefaultValue") public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; @@ -474,6 +524,7 @@ public OuterEnumDefaultValue getOuterEnumDefaultValue() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumDefaultValue") public void setOuterEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; } @@ -491,6 +542,7 @@ public EnumTest outerEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnu @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumIntegerDefaultValue") public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; @@ -499,6 +551,7 @@ public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "outerEnumIntegerDefaultValue") public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 5bcfe136276f..cf979e96653f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,12 +43,17 @@ EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "EquilateralTriangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "EquilateralTriangle") public class EquilateralTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @javax.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @javax.annotation.Nonnull private String triangleType; @@ -65,6 +72,7 @@ public EquilateralTriangle shapeType(@javax.annotation.Nonnull String shapeType) @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -73,6 +81,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@javax.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -90,6 +99,7 @@ public EquilateralTriangle triangleType(@javax.annotation.Nonnull String triangl @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -98,6 +108,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@javax.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4fab23e74735..cbc42cf511da 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -29,6 +29,8 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -40,12 +42,17 @@ FileSchemaTestClass.JSON_PROPERTY_FILES }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FileSchemaTestClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FileSchemaTestClass") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; + @XmlElement(name = "file") @javax.annotation.Nullable private ModelFile _file; public static final String JSON_PROPERTY_FILES = "files"; + @XmlElement(name = "files") @javax.annotation.Nullable private List files = new ArrayList<>(); @@ -64,6 +71,7 @@ public FileSchemaTestClass _file(@javax.annotation.Nullable ModelFile _file) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") public ModelFile getFile() { return _file; @@ -72,6 +80,7 @@ public ModelFile getFile() { @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "file") public void setFile(@javax.annotation.Nullable ModelFile _file) { this._file = _file; } @@ -97,6 +106,8 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "files") + @JacksonXmlElementWrapper(useWrapping = false) public List getFiles() { return files; @@ -105,6 +116,8 @@ public List getFiles() { @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "files") + @JacksonXmlElementWrapper(useWrapping = false) public void setFiles(@javax.annotation.Nullable List files) { this.files = files; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index e1e120a23e95..0b10b10b7997 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ Foo.JSON_PROPERTY_BAR }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Foo") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Foo") public class Foo { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @javax.annotation.Nullable private String bar = "bar"; @@ -56,6 +62,7 @@ public Foo bar(@javax.annotation.Nullable String bar) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -64,6 +71,7 @@ public String getBar() { @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public void setBar(@javax.annotation.Nullable String bar) { this.bar = bar; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index b079af96f728..dda9d0da1882 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -27,6 +27,8 @@ import java.util.Arrays; import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,8 +40,12 @@ }) @JsonTypeName("_foo_get_default_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FooGetDefaultResponse") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FooGetDefaultResponse") public class FooGetDefaultResponse { public static final String JSON_PROPERTY_STRING = "string"; + @XmlElement(name = "string") @javax.annotation.Nullable private Foo string; @@ -58,6 +64,7 @@ public FooGetDefaultResponse string(@javax.annotation.Nullable Foo string) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public Foo getString() { return string; @@ -66,6 +73,7 @@ public Foo getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public void setString(@javax.annotation.Nullable Foo string) { this.string = string; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index ca1429b0a463..2a75b49aa4fb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,6 +31,8 @@ import java.util.Arrays; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -57,68 +59,87 @@ }) @JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FormatTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FormatTest") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; + @XmlElement(name = "integer") @javax.annotation.Nullable private Integer integer; public static final String JSON_PROPERTY_INT32 = "int32"; + @XmlElement(name = "int32") @javax.annotation.Nullable private Integer int32; public static final String JSON_PROPERTY_INT64 = "int64"; + @XmlElement(name = "int64") @javax.annotation.Nullable private Long int64; public static final String JSON_PROPERTY_NUMBER = "number"; + @XmlElement(name = "number") @javax.annotation.Nonnull private BigDecimal number; public static final String JSON_PROPERTY_FLOAT = "float"; + @XmlElement(name = "float") @javax.annotation.Nullable private Float _float; public static final String JSON_PROPERTY_DOUBLE = "double"; + @XmlElement(name = "double") @javax.annotation.Nullable private Double _double; public static final String JSON_PROPERTY_DECIMAL = "decimal"; + @XmlElement(name = "decimal") @javax.annotation.Nullable private BigDecimal decimal; public static final String JSON_PROPERTY_STRING = "string"; + @XmlElement(name = "string") @javax.annotation.Nullable private String string; public static final String JSON_PROPERTY_BYTE = "byte"; + @XmlElement(name = "byte") @javax.annotation.Nonnull private byte[] _byte; public static final String JSON_PROPERTY_BINARY = "binary"; + @XmlElement(name = "binary") @javax.annotation.Nullable private File binary; public static final String JSON_PROPERTY_DATE = "date"; + @XmlElement(name = "date") @javax.annotation.Nonnull private LocalDate date; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @XmlElement(name = "dateTime") @javax.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @javax.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_PASSWORD = "password"; + @XmlElement(name = "password") @javax.annotation.Nonnull private String password; public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + @XmlElement(name = "pattern_with_digits") @javax.annotation.Nullable private String patternWithDigits; public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + @XmlElement(name = "pattern_with_digits_and_delimiter") @javax.annotation.Nullable private String patternWithDigitsAndDelimiter; @@ -139,6 +160,7 @@ public FormatTest integer(@javax.annotation.Nullable Integer integer) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") public Integer getInteger() { return integer; @@ -147,6 +169,7 @@ public Integer getInteger() { @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer") public void setInteger(@javax.annotation.Nullable Integer integer) { this.integer = integer; } @@ -166,6 +189,7 @@ public FormatTest int32(@javax.annotation.Nullable Integer int32) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") public Integer getInt32() { return int32; @@ -174,6 +198,7 @@ public Integer getInt32() { @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int32") public void setInt32(@javax.annotation.Nullable Integer int32) { this.int32 = int32; } @@ -191,6 +216,7 @@ public FormatTest int64(@javax.annotation.Nullable Long int64) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") public Long getInt64() { return int64; @@ -199,6 +225,7 @@ public Long getInt64() { @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "int64") public void setInt64(@javax.annotation.Nullable Long int64) { this.int64 = int64; } @@ -218,6 +245,7 @@ public FormatTest number(@javax.annotation.Nonnull BigDecimal number) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") public BigDecimal getNumber() { return number; @@ -226,6 +254,7 @@ public BigDecimal getNumber() { @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "number") public void setNumber(@javax.annotation.Nonnull BigDecimal number) { this.number = number; } @@ -245,6 +274,7 @@ public FormatTest _float(@javax.annotation.Nullable Float _float) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") public Float getFloat() { return _float; @@ -253,6 +283,7 @@ public Float getFloat() { @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "float") public void setFloat(@javax.annotation.Nullable Float _float) { this._float = _float; } @@ -272,6 +303,7 @@ public FormatTest _double(@javax.annotation.Nullable Double _double) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") public Double getDouble() { return _double; @@ -280,6 +312,7 @@ public Double getDouble() { @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "double") public void setDouble(@javax.annotation.Nullable Double _double) { this._double = _double; } @@ -297,6 +330,7 @@ public FormatTest decimal(@javax.annotation.Nullable BigDecimal decimal) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "decimal") public BigDecimal getDecimal() { return decimal; @@ -305,6 +339,7 @@ public BigDecimal getDecimal() { @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "decimal") public void setDecimal(@javax.annotation.Nullable BigDecimal decimal) { this.decimal = decimal; } @@ -322,6 +357,7 @@ public FormatTest string(@javax.annotation.Nullable String string) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public String getString() { return string; @@ -330,6 +366,7 @@ public String getString() { @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string") public void setString(@javax.annotation.Nullable String string) { this.string = string; } @@ -347,6 +384,7 @@ public FormatTest _byte(@javax.annotation.Nonnull byte[] _byte) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") public byte[] getByte() { return _byte; @@ -355,6 +393,7 @@ public byte[] getByte() { @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "byte") public void setByte(@javax.annotation.Nonnull byte[] _byte) { this._byte = _byte; } @@ -372,6 +411,7 @@ public FormatTest binary(@javax.annotation.Nullable File binary) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") public File getBinary() { return binary; @@ -380,6 +420,7 @@ public File getBinary() { @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "binary") public void setBinary(@javax.annotation.Nullable File binary) { this.binary = binary; } @@ -397,6 +438,7 @@ public FormatTest date(@javax.annotation.Nonnull LocalDate date) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") public LocalDate getDate() { return date; @@ -405,6 +447,7 @@ public LocalDate getDate() { @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "date") public void setDate(@javax.annotation.Nonnull LocalDate date) { this.date = date; } @@ -422,6 +465,7 @@ public FormatTest dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public OffsetDateTime getDateTime() { return dateTime; @@ -430,6 +474,7 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -447,6 +492,7 @@ public FormatTest uuid(@javax.annotation.Nullable UUID uuid) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public UUID getUuid() { return uuid; @@ -455,6 +501,7 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@javax.annotation.Nullable UUID uuid) { this.uuid = uuid; } @@ -472,6 +519,7 @@ public FormatTest password(@javax.annotation.Nonnull String password) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") public String getPassword() { return password; @@ -480,6 +528,7 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "password") public void setPassword(@javax.annotation.Nonnull String password) { this.password = password; } @@ -497,6 +546,7 @@ public FormatTest patternWithDigits(@javax.annotation.Nullable String patternWit @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits") public String getPatternWithDigits() { return patternWithDigits; @@ -505,6 +555,7 @@ public String getPatternWithDigits() { @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits") public void setPatternWithDigits(@javax.annotation.Nullable String patternWithDigits) { this.patternWithDigits = patternWithDigits; } @@ -522,6 +573,7 @@ public FormatTest patternWithDigitsAndDelimiter(@javax.annotation.Nullable Strin @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits_and_delimiter") public String getPatternWithDigitsAndDelimiter() { return patternWithDigitsAndDelimiter; @@ -530,6 +582,7 @@ public String getPatternWithDigitsAndDelimiter() { @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "pattern_with_digits_and_delimiter") public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index cbac16182c32..128eb5553800 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -29,6 +29,8 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -60,6 +62,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Fruit") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Fruit") @JsonDeserialize(using = Fruit.FruitDeserializer.class) @JsonSerialize(using = Fruit.FruitSerializer.class) public class Fruit extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index 0ea3222b66e6..fa320a178200 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -29,6 +29,8 @@ import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -60,6 +62,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "FruitReq") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "FruitReq") @JsonDeserialize(using = FruitReq.FruitReqDeserializer.class) @JsonSerialize(using = FruitReq.FruitReqSerializer.class) public class FruitReq extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java index 6f2f0a96e2c5..8ca210c7ac26 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java @@ -29,6 +29,8 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -56,6 +58,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "GmFruit") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "GmFruit") @JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) @JsonSerialize(using = GmFruit.GmFruitSerializer.class) public class GmFruit extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 7025e1037f44..8e4a1e281114 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -29,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -49,8 +51,12 @@ @JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"), }) +@XmlRootElement(name = "GrandparentAnimal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "GrandparentAnimal") public class GrandparentAnimal { public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + @XmlElement(name = "pet_type") @javax.annotation.Nonnull private String petType; @@ -69,6 +75,7 @@ public GrandparentAnimal petType(@javax.annotation.Nonnull String petType) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "pet_type") public String getPetType() { return petType; @@ -77,6 +84,7 @@ public String getPetType() { @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "pet_type") public void setPetType(@javax.annotation.Nonnull String petType) { this.petType = petType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4d12d35fa5fb..517b86908b2a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,28 +40,23 @@ }) @JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "HasOnlyReadOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "HasOnlyReadOnly") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @javax.annotation.Nullable private String bar; public static final String JSON_PROPERTY_FOO = "foo"; + @XmlElement(name = "foo") @javax.annotation.Nullable private String foo; public HasOnlyReadOnly() { } - @JsonCreator - public HasOnlyReadOnly( - @JsonProperty(JSON_PROPERTY_BAR) String bar, - @JsonProperty(JSON_PROPERTY_FOO) String foo - ) { - this(); - this.bar = bar; - this.foo = foo; - } - /** * Get bar * @return bar @@ -67,6 +64,7 @@ public HasOnlyReadOnly( @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -82,6 +80,7 @@ public String getBar() { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "foo") public String getFoo() { return foo; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 42bca02f26f9..99433d4b4d15 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -30,6 +30,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -40,8 +42,12 @@ HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "HealthCheckResult") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "HealthCheckResult") public class HealthCheckResult { public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + @XmlElement(name = "NullableMessage") private JsonNullable nullableMessage = JsonNullable.undefined(); public HealthCheckResult() { @@ -65,6 +71,7 @@ public String getNullableMessage() { @JsonProperty(value = JSON_PROPERTY_NULLABLE_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "NullableMessage") public JsonNullable getNullableMessage_JsonNullable() { return nullableMessage; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index c9de4e9427f2..13fdf52263bc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,12 +39,17 @@ IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "IsoscelesTriangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "IsoscelesTriangle") public class IsoscelesTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @javax.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @javax.annotation.Nonnull private String triangleType; @@ -61,6 +68,7 @@ public IsoscelesTriangle shapeType(@javax.annotation.Nonnull String shapeType) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -69,6 +77,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@javax.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -86,6 +95,7 @@ public IsoscelesTriangle triangleType(@javax.annotation.Nonnull String triangleT @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -94,6 +104,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@javax.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index 312fcf586c54..90ab010e1b87 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -36,6 +36,8 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -67,6 +69,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Mammal") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Mammal") @JsonDeserialize(using = Mammal.MammalDeserializer.class) @JsonSerialize(using = Mammal.MammalSerializer.class) public class Mammal extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java index a11a5ad59dae..776fe65ec1be 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -36,6 +36,8 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -63,6 +65,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MammalAnyof") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MammalAnyof") @JsonDeserialize(using=MammalAnyof.MammalAnyofDeserializer.class) @JsonSerialize(using = MammalAnyof.MammalAnyofSerializer.class) public class MammalAnyof extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index ef27650c9fc3..55589b6d669a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -28,6 +28,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,17 +43,25 @@ MapTest.JSON_PROPERTY_INDIRECT_MAP }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MapTest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MapTest") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @XmlElement(name = "map_map_of_string") @javax.annotation.Nullable private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner */ + @XmlType(name="InnerEnum") + @XmlEnum(String.class) public enum InnerEnum { + @XmlEnumValue("UPPER") UPPER(String.valueOf("UPPER")), + @XmlEnumValue("lower") LOWER(String.valueOf("lower")); private String value; @@ -82,14 +92,17 @@ public static InnerEnum fromValue(String value) { } public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @XmlElement(name = "map_of_enum_string") @javax.annotation.Nullable private Map mapOfEnumString = new HashMap<>(); public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @XmlElement(name = "direct_map") @javax.annotation.Nullable private Map directMap = new HashMap<>(); public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @XmlElement(name = "indirect_map") @javax.annotation.Nullable private Map indirectMap = new HashMap<>(); @@ -116,6 +129,8 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map> getMapMapOfString() { return mapMapOfString; @@ -124,6 +139,8 @@ public Map> getMapMapOfString() { @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_map_of_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapMapOfString(@javax.annotation.Nullable Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } @@ -149,6 +166,8 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_enum_string") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMapOfEnumString() { return mapOfEnumString; @@ -157,6 +176,8 @@ public Map getMapOfEnumString() { @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map_of_enum_string") + @JacksonXmlElementWrapper(useWrapping = false) public void setMapOfEnumString(@javax.annotation.Nullable Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } @@ -182,6 +203,8 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "direct_map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getDirectMap() { return directMap; @@ -190,6 +213,8 @@ public Map getDirectMap() { @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "direct_map") + @JacksonXmlElementWrapper(useWrapping = false) public void setDirectMap(@javax.annotation.Nullable Map directMap) { this.directMap = directMap; } @@ -215,6 +240,8 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "indirect_map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getIndirectMap() { return indirectMap; @@ -223,6 +250,8 @@ public Map getIndirectMap() { @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "indirect_map") + @JacksonXmlElementWrapper(useWrapping = false) public void setIndirectMap(@javax.annotation.Nullable Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7d44de98c15d..104c2efc2dab 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,6 +31,8 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -43,16 +45,22 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @javax.annotation.Nullable private UUID uuid; public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @XmlElement(name = "dateTime") @javax.annotation.Nullable private OffsetDateTime dateTime; public static final String JSON_PROPERTY_MAP = "map"; + @XmlElement(name = "map") @javax.annotation.Nullable private Map map = new HashMap<>(); @@ -71,6 +79,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@javax.annotation.Nullab @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public UUID getUuid() { return uuid; @@ -79,6 +88,7 @@ public UUID getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@javax.annotation.Nullable UUID uuid) { this.uuid = uuid; } @@ -96,6 +106,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@javax.annotation.Nu @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public OffsetDateTime getDateTime() { return dateTime; @@ -104,6 +115,7 @@ public OffsetDateTime getDateTime() { @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "dateTime") public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { this.dateTime = dateTime; } @@ -129,6 +141,8 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map") + @JacksonXmlElementWrapper(useWrapping = false) public Map getMap() { return map; @@ -137,6 +151,8 @@ public Map getMap() { @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "map") + @JacksonXmlElementWrapper(useWrapping = false) public void setMap(@javax.annotation.Nullable Map map) { this.map = map; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 2cdef9bdeab6..3a07365417e3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,12 +40,17 @@ }) @JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Name") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Name") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private Integer name; public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @XmlElement(name = "class") @javax.annotation.Nullable private String propertyClass; @@ -62,6 +69,7 @@ public Model200Response name(@javax.annotation.Nullable Integer name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public Integer getName() { return name; @@ -70,6 +78,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable Integer name) { this.name = name; } @@ -87,6 +96,7 @@ public Model200Response propertyClass(@javax.annotation.Nullable String property @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") public String getPropertyClass() { return propertyClass; @@ -95,6 +105,7 @@ public String getPropertyClass() { @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "class") public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 206c14b9ae10..243ec2189eb0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,16 +41,22 @@ }) @JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelApiResponse") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelApiResponse") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; + @XmlElement(name = "code") @javax.annotation.Nullable private Integer code; public static final String JSON_PROPERTY_TYPE = "type"; + @XmlElement(name = "type") @javax.annotation.Nullable private String type; public static final String JSON_PROPERTY_MESSAGE = "message"; + @XmlElement(name = "message") @javax.annotation.Nullable private String message; @@ -67,6 +75,7 @@ public ModelApiResponse code(@javax.annotation.Nullable Integer code) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") public Integer getCode() { return code; @@ -75,6 +84,7 @@ public Integer getCode() { @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "code") public void setCode(@javax.annotation.Nullable Integer code) { this.code = code; } @@ -92,6 +102,7 @@ public ModelApiResponse type(@javax.annotation.Nullable String type) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public String getType() { return type; @@ -100,6 +111,7 @@ public String getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public void setType(@javax.annotation.Nullable String type) { this.type = type; } @@ -117,6 +129,7 @@ public ModelApiResponse message(@javax.annotation.Nullable String message) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") public String getMessage() { return message; @@ -125,6 +138,7 @@ public String getMessage() { @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "message") public void setMessage(@javax.annotation.Nullable String message) { this.message = message; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index 55b30a596ee9..7b5d04db2d48 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,8 +39,12 @@ }) @JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelFile") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelFile") public class ModelFile { public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + @XmlElement(name = "sourceURI") @javax.annotation.Nullable private String sourceURI; @@ -57,6 +63,7 @@ public ModelFile sourceURI(@javax.annotation.Nullable String sourceURI) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") public String getSourceURI() { return sourceURI; @@ -65,6 +72,7 @@ public String getSourceURI() { @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") public void setSourceURI(@javax.annotation.Nullable String sourceURI) { this.sourceURI = sourceURI; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index c136d5b4c635..c23af3977168 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,8 +39,12 @@ }) @JsonTypeName("List") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ModelList") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelList") public class ModelList { public static final String JSON_PROPERTY_123LIST = "123-list"; + @XmlElement(name = "123-list") @javax.annotation.Nullable private String _123list; @@ -57,6 +63,7 @@ public ModelList _123list(@javax.annotation.Nullable String _123list) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") public String get123list() { return _123list; @@ -65,6 +72,7 @@ public String get123list() { @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") public void set123list(@javax.annotation.Nullable String _123list) { this._123list = _123list; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 0f2e18fb0bb0..7e1f78afeb0a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,8 +39,12 @@ }) @JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Return") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Return") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; + @XmlElement(name = "return") @javax.annotation.Nullable private Integer _return; @@ -57,6 +63,7 @@ public ModelReturn _return(@javax.annotation.Nullable Integer _return) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") public Integer getReturn() { return _return; @@ -65,6 +72,7 @@ public Integer getReturn() { @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "return") public void setReturn(@javax.annotation.Nullable Integer _return) { this._return = _return; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 55dd5a505002..cc671fba060d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,36 +41,33 @@ Name.JSON_PROPERTY_123NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Name") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Name") public class Name { public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nonnull private Integer name; public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @XmlElement(name = "snake_case") @javax.annotation.Nullable private Integer snakeCase; public static final String JSON_PROPERTY_PROPERTY = "property"; + @XmlElement(name = "property") @javax.annotation.Nullable private String property; public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @XmlElement(name = "123Number") @javax.annotation.Nullable private Integer _123number; public Name() { } - @JsonCreator - public Name( - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, - @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number - ) { - this(); - this.snakeCase = snakeCase; - this._123number = _123number; - } - public Name name(@javax.annotation.Nonnull Integer name) { this.name = name; return this; @@ -81,6 +80,7 @@ public Name name(@javax.annotation.Nonnull Integer name) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public Integer getName() { return name; @@ -89,6 +89,7 @@ public Integer getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nonnull Integer name) { this.name = name; } @@ -101,6 +102,7 @@ public void setName(@javax.annotation.Nonnull Integer name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "snake_case") public Integer getSnakeCase() { return snakeCase; @@ -121,6 +123,7 @@ public Name property(@javax.annotation.Nullable String property) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") public String getProperty() { return property; @@ -129,6 +132,7 @@ public String getProperty() { @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "property") public void setProperty(@javax.annotation.Nullable String property) { this.property = property; } @@ -141,6 +145,7 @@ public void setProperty(@javax.annotation.Nullable String property) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123Number") public Integer get123number() { return _123number; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index a948e60b31f3..0e81d96bf125 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -41,6 +41,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -62,42 +64,57 @@ NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NullableClass") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NullableClass") public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + @XmlElement(name = "integer_prop") private JsonNullable integerProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + @XmlElement(name = "number_prop") private JsonNullable numberProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + @XmlElement(name = "boolean_prop") private JsonNullable booleanProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + @XmlElement(name = "string_prop") private JsonNullable stringProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + @XmlElement(name = "date_prop") private JsonNullable dateProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + @XmlElement(name = "datetime_prop") private JsonNullable datetimeProp = JsonNullable.undefined(); public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + @XmlElement(name = "array_nullable_prop") private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + @XmlElement(name = "array_and_items_nullable_prop") private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + @XmlElement(name = "array_items_nullable") @javax.annotation.Nullable private List arrayItemsNullable = new ArrayList<>(); public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + @XmlElement(name = "object_nullable_prop") private JsonNullable> objectNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + @XmlElement(name = "object_and_items_nullable_prop") private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + @XmlElement(name = "object_items_nullable") @javax.annotation.Nullable private Map objectItemsNullable = new HashMap<>(); @@ -122,6 +139,7 @@ public Integer getIntegerProp() { @JsonProperty(value = JSON_PROPERTY_INTEGER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "integer_prop") public JsonNullable getIntegerProp_JsonNullable() { return integerProp; @@ -155,6 +173,7 @@ public BigDecimal getNumberProp() { @JsonProperty(value = JSON_PROPERTY_NUMBER_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "number_prop") public JsonNullable getNumberProp_JsonNullable() { return numberProp; @@ -188,6 +207,7 @@ public Boolean getBooleanProp() { @JsonProperty(value = JSON_PROPERTY_BOOLEAN_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "boolean_prop") public JsonNullable getBooleanProp_JsonNullable() { return booleanProp; @@ -221,6 +241,7 @@ public String getStringProp() { @JsonProperty(value = JSON_PROPERTY_STRING_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "string_prop") public JsonNullable getStringProp_JsonNullable() { return stringProp; @@ -254,6 +275,7 @@ public LocalDate getDateProp() { @JsonProperty(value = JSON_PROPERTY_DATE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "date_prop") public JsonNullable getDateProp_JsonNullable() { return dateProp; @@ -287,6 +309,7 @@ public OffsetDateTime getDatetimeProp() { @JsonProperty(value = JSON_PROPERTY_DATETIME_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "datetime_prop") public JsonNullable getDatetimeProp_JsonNullable() { return datetimeProp; @@ -332,6 +355,8 @@ public List getArrayNullableProp() { @JsonProperty(value = JSON_PROPERTY_ARRAY_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getArrayNullableProp_JsonNullable() { return arrayNullableProp; @@ -377,6 +402,8 @@ public List getArrayAndItemsNullableProp() { @JsonProperty(value = JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_and_items_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { return arrayAndItemsNullableProp; @@ -412,6 +439,8 @@ public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public List getArrayItemsNullable() { return arrayItemsNullable; @@ -420,6 +449,8 @@ public List getArrayItemsNullable() { @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "array_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public void setArrayItemsNullable(@javax.annotation.Nullable List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; } @@ -455,6 +486,8 @@ public Map getObjectNullableProp() { @JsonProperty(value = JSON_PROPERTY_OBJECT_NULLABLE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getObjectNullableProp_JsonNullable() { return objectNullableProp; @@ -500,6 +533,8 @@ public Map getObjectAndItemsNullableProp() { @JsonProperty(value = JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_and_items_nullable_prop") + @JacksonXmlElementWrapper(useWrapping = false) public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { return objectAndItemsNullableProp; @@ -535,6 +570,8 @@ public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNu @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public Map getObjectItemsNullable() { return objectItemsNullable; @@ -543,6 +580,8 @@ public Map getObjectItemsNullable() { @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "object_items_nullable") + @JacksonXmlElementWrapper(useWrapping = false) public void setObjectItemsNullable(@javax.annotation.Nullable Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index 4cb4d11dbef8..61268526e837 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -66,6 +68,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NullableShape") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NullableShape") @JsonDeserialize(using = NullableShape.NullableShapeDeserializer.class) @JsonSerialize(using = NullableShape.NullableShapeSerializer.class) public class NullableShape extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index d8be3d146eed..9795c3d52766 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,8 +39,12 @@ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "NumberOnly") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "NumberOnly") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @XmlElement(name = "JustNumber") @javax.annotation.Nullable private BigDecimal justNumber; @@ -57,6 +63,7 @@ public NumberOnly justNumber(@javax.annotation.Nullable BigDecimal justNumber) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") public BigDecimal getJustNumber() { return justNumber; @@ -65,6 +72,7 @@ public BigDecimal getJustNumber() { @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "JustNumber") public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index c249f5172e90..9ef196c7fff6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -30,6 +30,8 @@ import java.util.List; import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -43,22 +45,29 @@ ObjectWithDeprecatedFields.JSON_PROPERTY_BARS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ObjectWithDeprecatedFields") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ObjectWithDeprecatedFields") public class ObjectWithDeprecatedFields { public static final String JSON_PROPERTY_UUID = "uuid"; + @XmlElement(name = "uuid") @javax.annotation.Nullable private String uuid; public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @Deprecated @javax.annotation.Nullable private BigDecimal id; public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + @XmlElement(name = "deprecatedRef") @Deprecated @javax.annotation.Nullable private DeprecatedObject deprecatedRef; public static final String JSON_PROPERTY_BARS = "bars"; + @XmlElement(name = "bars") @Deprecated @javax.annotation.Nullable private List bars = new ArrayList<>(); @@ -78,6 +87,7 @@ public ObjectWithDeprecatedFields uuid(@javax.annotation.Nullable String uuid) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public String getUuid() { return uuid; @@ -86,6 +96,7 @@ public String getUuid() { @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "uuid") public void setUuid(@javax.annotation.Nullable String uuid) { this.uuid = uuid; } @@ -106,6 +117,7 @@ public ObjectWithDeprecatedFields id(@javax.annotation.Nullable BigDecimal id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public BigDecimal getId() { return id; @@ -115,6 +127,7 @@ public BigDecimal getId() { @Deprecated @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable BigDecimal id) { this.id = id; } @@ -135,6 +148,7 @@ public ObjectWithDeprecatedFields deprecatedRef(@javax.annotation.Nullable Depre @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "deprecatedRef") public DeprecatedObject getDeprecatedRef() { return deprecatedRef; @@ -144,6 +158,7 @@ public DeprecatedObject getDeprecatedRef() { @Deprecated @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "deprecatedRef") public void setDeprecatedRef(@javax.annotation.Nullable DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; } @@ -172,6 +187,8 @@ public ObjectWithDeprecatedFields addBarsItem(String barsItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bars") + @JacksonXmlElementWrapper(useWrapping = false) public List getBars() { return bars; @@ -181,6 +198,8 @@ public List getBars() { @Deprecated @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bars") + @JacksonXmlElementWrapper(useWrapping = false) public void setBars(@javax.annotation.Nullable List bars) { this.bars = bars; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 46d7760a4740..291e9b841606 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -27,6 +27,8 @@ import java.time.OffsetDateTime; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -42,31 +44,43 @@ Order.JSON_PROPERTY_COMPLETE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Order") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Order") public class Order { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_PET_ID = "petId"; + @XmlElement(name = "petId") @javax.annotation.Nullable private Long petId; public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @XmlElement(name = "quantity") @javax.annotation.Nullable private Integer quantity; public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @XmlElement(name = "shipDate") @javax.annotation.Nullable private OffsetDateTime shipDate; /** * Order Status */ + @XmlType(name="StatusEnum") + @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("placed") PLACED(String.valueOf("placed")), + @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), + @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); private String value; @@ -97,10 +111,12 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @XmlElement(name = "status") @javax.annotation.Nullable private StatusEnum status; public static final String JSON_PROPERTY_COMPLETE = "complete"; + @XmlElement(name = "complete") @javax.annotation.Nullable private Boolean complete = false; @@ -119,6 +135,7 @@ public Order id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -127,6 +144,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -144,6 +162,7 @@ public Order petId(@javax.annotation.Nullable Long petId) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") public Long getPetId() { return petId; @@ -152,6 +171,7 @@ public Long getPetId() { @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "petId") public void setPetId(@javax.annotation.Nullable Long petId) { this.petId = petId; } @@ -169,6 +189,7 @@ public Order quantity(@javax.annotation.Nullable Integer quantity) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") public Integer getQuantity() { return quantity; @@ -177,6 +198,7 @@ public Integer getQuantity() { @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "quantity") public void setQuantity(@javax.annotation.Nullable Integer quantity) { this.quantity = quantity; } @@ -194,6 +216,7 @@ public Order shipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") public OffsetDateTime getShipDate() { return shipDate; @@ -202,6 +225,7 @@ public OffsetDateTime getShipDate() { @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "shipDate") public void setShipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { this.shipDate = shipDate; } @@ -219,6 +243,7 @@ public Order status(@javax.annotation.Nullable StatusEnum status) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public StatusEnum getStatus() { return status; @@ -227,6 +252,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public void setStatus(@javax.annotation.Nullable StatusEnum status) { this.status = status; } @@ -244,6 +270,7 @@ public Order complete(@javax.annotation.Nullable Boolean complete) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") public Boolean getComplete() { return complete; @@ -252,6 +279,7 @@ public Boolean getComplete() { @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "complete") public void setComplete(@javax.annotation.Nullable Boolean complete) { this.complete = complete; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index e7ebceb47a4b..998ebb756b3c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,6 +27,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,16 +41,22 @@ OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "OuterComposite") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "OuterComposite") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @XmlElement(name = "my_number") @javax.annotation.Nullable private BigDecimal myNumber; public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @XmlElement(name = "my_string") @javax.annotation.Nullable private String myString; public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @XmlElement(name = "my_boolean") @javax.annotation.Nullable private Boolean myBoolean; @@ -67,6 +75,7 @@ public OuterComposite myNumber(@javax.annotation.Nullable BigDecimal myNumber) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") public BigDecimal getMyNumber() { return myNumber; @@ -75,6 +84,7 @@ public BigDecimal getMyNumber() { @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_number") public void setMyNumber(@javax.annotation.Nullable BigDecimal myNumber) { this.myNumber = myNumber; } @@ -92,6 +102,7 @@ public OuterComposite myString(@javax.annotation.Nullable String myString) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") public String getMyString() { return myString; @@ -100,6 +111,7 @@ public String getMyString() { @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_string") public void setMyString(@javax.annotation.Nullable String myString) { this.myString = myString; } @@ -117,6 +129,7 @@ public OuterComposite myBoolean(@javax.annotation.Nullable Boolean myBoolean) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") public Boolean getMyBoolean() { return myBoolean; @@ -125,6 +138,7 @@ public Boolean getMyBoolean() { @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "my_boolean") public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java index d6f828f77b66..32dfc2a35070 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -32,10 +34,13 @@ */ public enum OuterEnum { + @XmlEnumValue("placed") PLACED("placed"), + @XmlEnumValue("approved") APPROVED("approved"), + @XmlEnumValue("delivered") DELIVERED("delivered"); private String value; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index d30f118e4285..ae31d9a5c57e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -32,10 +34,13 @@ */ public enum OuterEnumDefaultValue { + @XmlEnumValue("placed") PLACED("placed"), + @XmlEnumValue("approved") APPROVED("approved"), + @XmlEnumValue("delivered") DELIVERED("delivered"); private String value; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index 6b0efea354ff..48228875ba72 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -32,10 +34,13 @@ */ public enum OuterEnumInteger { + @XmlEnumValue("0") NUMBER_0(0), + @XmlEnumValue("1") NUMBER_1(1), + @XmlEnumValue("2") NUMBER_2(2); private Integer value; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 9f50d1d097ac..ad7da4f09707 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.Locale; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -32,10 +34,13 @@ */ public enum OuterEnumIntegerDefaultValue { + @XmlEnumValue("0") NUMBER_0(0), + @XmlEnumValue("1") NUMBER_1(1), + @XmlEnumValue("2") NUMBER_2(2); private Integer value; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index e2b89bf955bb..8f09be6ff4b3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -34,6 +34,8 @@ import java.util.Arrays; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -52,6 +54,9 @@ @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), }) +@XmlRootElement(name = "ParentPet") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ParentPet") public class ParentPet extends GrandparentAnimal { public ParentPet() { } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 3c6a4335b2d9..1e0dc116c057 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -30,6 +30,8 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -45,35 +47,50 @@ Pet.JSON_PROPERTY_STATUS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Pet") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Pet") public class Pet { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_CATEGORY = "category"; + @XmlElement(name = "Category") @javax.annotation.Nullable private Category category; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nonnull private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @XmlElement(name = "photoUrl") + @XmlElementWrapper(name = "photoUrl") @javax.annotation.Nonnull private List photoUrls = new ArrayList<>(); public static final String JSON_PROPERTY_TAGS = "tags"; + @XmlElement(name = "Tag") + @XmlElementWrapper(name = "tag") @javax.annotation.Nullable private List tags = new ArrayList<>(); /** * pet status in the store */ + @XmlType(name="StatusEnum") + @XmlEnum(String.class) public enum StatusEnum { + @XmlEnumValue("available") AVAILABLE(String.valueOf("available")), + @XmlEnumValue("pending") PENDING(String.valueOf("pending")), + @XmlEnumValue("sold") SOLD(String.valueOf("sold")); private String value; @@ -104,6 +121,7 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @XmlElement(name = "status") @javax.annotation.Nullable private StatusEnum status; @@ -122,6 +140,7 @@ public Pet id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -130,6 +149,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -147,6 +167,7 @@ public Pet category(@javax.annotation.Nullable Category category) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Category") public Category getCategory() { return category; @@ -155,6 +176,7 @@ public Category getCategory() { @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Category") public void setCategory(@javax.annotation.Nullable Category category) { this.category = category; } @@ -172,6 +194,7 @@ public Pet name(@javax.annotation.Nonnull String name) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -180,6 +203,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nonnull String name) { this.name = name; } @@ -205,6 +229,8 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public List getPhotoUrls() { return photoUrls; @@ -213,6 +239,8 @@ public List getPhotoUrls() { @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "photoUrl") + @JacksonXmlElementWrapper(localName = "photoUrl", useWrapping = true) public void setPhotoUrls(@javax.annotation.Nonnull List photoUrls) { this.photoUrls = photoUrls; } @@ -238,6 +266,8 @@ public Pet addTagsItem(Tag tagsItem) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public List getTags() { return tags; @@ -246,6 +276,8 @@ public List getTags() { @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "Tag") + @JacksonXmlElementWrapper(localName = "tag", useWrapping = true) public void setTags(@javax.annotation.Nullable List tags) { this.tags = tags; } @@ -263,6 +295,7 @@ public Pet status(@javax.annotation.Nullable StatusEnum status) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public StatusEnum getStatus() { return status; @@ -271,6 +304,7 @@ public StatusEnum getStatus() { @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "status") public void setStatus(@javax.annotation.Nullable StatusEnum status) { this.status = status; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index 84f00369a0bb..de538d7707f1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -66,6 +68,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Pig") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Pig") @JsonDeserialize(using = Pig.PigDeserializer.class) @JsonSerialize(using = Pig.PigSerializer.class) public class Pig extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 678c8dbd4987..704db61b2ae8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -66,6 +68,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Quadrilateral") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Quadrilateral") @JsonDeserialize(using = Quadrilateral.QuadrilateralDeserializer.class) @JsonSerialize(using = Quadrilateral.QuadrilateralSerializer.class) public class Quadrilateral extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index da216733918a..1f4c31eadc8e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "QuadrilateralInterface") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "QuadrilateralInterface") public class QuadrilateralInterface { public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @XmlElement(name = "quadrilateralType") @javax.annotation.Nonnull private String quadrilateralType; @@ -56,6 +62,7 @@ public QuadrilateralInterface quadrilateralType(@javax.annotation.Nonnull String @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public String getQuadrilateralType() { return quadrilateralType; @@ -64,6 +71,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 2e7a6b984d1e..38a615386c27 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,26 +39,23 @@ ReadOnlyFirst.JSON_PROPERTY_BAZ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ReadOnlyFirst") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ReadOnlyFirst") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; + @XmlElement(name = "bar") @javax.annotation.Nullable private String bar; public static final String JSON_PROPERTY_BAZ = "baz"; + @XmlElement(name = "baz") @javax.annotation.Nullable private String baz; public ReadOnlyFirst() { } - @JsonCreator - public ReadOnlyFirst( - @JsonProperty(JSON_PROPERTY_BAR) String bar - ) { - this(); - this.bar = bar; - } - /** * Get bar * @return bar @@ -64,6 +63,7 @@ public ReadOnlyFirst( @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "bar") public String getBar() { return bar; @@ -84,6 +84,7 @@ public ReadOnlyFirst baz(@javax.annotation.Nullable String baz) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") public String getBaz() { return baz; @@ -92,6 +93,7 @@ public String getBaz() { @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "baz") public void setBaz(@javax.annotation.Nullable String baz) { this.baz = baz; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 018c427c916b..11e5f89adb65 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,12 +43,17 @@ ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ScaleneTriangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ScaleneTriangle") public class ScaleneTriangle { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @javax.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @javax.annotation.Nonnull private String triangleType; @@ -65,6 +72,7 @@ public ScaleneTriangle shapeType(@javax.annotation.Nonnull String shapeType) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -73,6 +81,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@javax.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -90,6 +99,7 @@ public ScaleneTriangle triangleType(@javax.annotation.Nonnull String triangleTyp @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -98,6 +108,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@javax.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index 361169ab201b..ead6ad5336fd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -66,6 +68,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Shape") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Shape") @JsonDeserialize(using = Shape.ShapeDeserializer.class) @JsonSerialize(using = Shape.ShapeSerializer.class) public class Shape extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index c5ebe42ba6d9..91d52892c08f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ ShapeInterface.JSON_PROPERTY_SHAPE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ShapeInterface") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ShapeInterface") public class ShapeInterface { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @javax.annotation.Nonnull private String shapeType; @@ -56,6 +62,7 @@ public ShapeInterface shapeType(@javax.annotation.Nonnull String shapeType) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -64,6 +71,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@javax.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index dc2d474a0408..13d4ca98909e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -35,6 +35,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -66,6 +68,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "ShapeOrNull") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ShapeOrNull") @JsonDeserialize(using = ShapeOrNull.ShapeOrNullDeserializer.class) @JsonSerialize(using = ShapeOrNull.ShapeOrNullSerializer.class) public class ShapeOrNull extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index dd853aaa9f51..c44acb291918 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,12 +43,17 @@ SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "SimpleQuadrilateral") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "SimpleQuadrilateral") public class SimpleQuadrilateral { public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @XmlElement(name = "shapeType") @javax.annotation.Nonnull private String shapeType; public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @XmlElement(name = "quadrilateralType") @javax.annotation.Nonnull private String quadrilateralType; @@ -65,6 +72,7 @@ public SimpleQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType) @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public String getShapeType() { return shapeType; @@ -73,6 +81,7 @@ public String getShapeType() { @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "shapeType") public void setShapeType(@javax.annotation.Nonnull String shapeType) { this.shapeType = shapeType; } @@ -90,6 +99,7 @@ public SimpleQuadrilateral quadrilateralType(@javax.annotation.Nonnull String qu @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public String getQuadrilateralType() { return quadrilateralType; @@ -98,6 +108,7 @@ public String getQuadrilateralType() { @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "quadrilateralType") public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { this.quadrilateralType = quadrilateralType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 11aa764e55d5..fe647b17c28d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -38,12 +40,17 @@ }) @JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "$special[model.name]") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "$special[model.name]") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @XmlElement(name = "$special[property.name]") @javax.annotation.Nullable private Long $specialPropertyName; public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; + @XmlElement(name = "_special_model.name_") @javax.annotation.Nullable private String specialModelName; @@ -62,6 +69,7 @@ public SpecialModelName() { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") public Long get$SpecialPropertyName() { return $specialPropertyName; @@ -70,6 +78,7 @@ public SpecialModelName() { @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "$special[property.name]") public void set$SpecialPropertyName(@javax.annotation.Nullable Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } @@ -87,6 +96,7 @@ public SpecialModelName specialModelName(@javax.annotation.Nullable String speci @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_special_model.name_") public String getSpecialModelName() { return specialModelName; @@ -95,6 +105,7 @@ public String getSpecialModelName() { @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "_special_model.name_") public void setSpecialModelName(@javax.annotation.Nullable String specialModelName) { this.specialModelName = specialModelName; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index bd8c16f25914..bec7c5e0d997 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -37,12 +39,17 @@ Tag.JSON_PROPERTY_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Tag") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Tag") public class Tag { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; + @XmlElement(name = "name") @javax.annotation.Nullable private String name; @@ -61,6 +68,7 @@ public Tag id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -69,6 +77,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -86,6 +95,7 @@ public Tag name(@javax.annotation.Nullable String name) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public String getName() { return name; @@ -94,6 +104,7 @@ public String getName() { @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "name") public void setName(@javax.annotation.Nullable String name) { this.name = name; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index a18451981043..9da09d0bca86 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -41,8 +43,12 @@ }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "TestInlineFreeformAdditionalPropertiesRequest") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TestInlineFreeformAdditionalPropertiesRequest") public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + @XmlElement(name = "someProperty") @javax.annotation.Nullable private String someProperty; @@ -61,6 +67,7 @@ public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotat @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "someProperty") public String getSomeProperty() { return someProperty; @@ -69,6 +76,7 @@ public String getSomeProperty() { @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "someProperty") public void setSomeProperty(@javax.annotation.Nullable String someProperty) { this.someProperty = someProperty; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index 120e71ed19d4..b4d07b55187a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -36,6 +36,8 @@ import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -67,6 +69,9 @@ import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Triangle") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Triangle") @JsonDeserialize(using = Triangle.TriangleDeserializer.class) @JsonSerialize(using = Triangle.TriangleSerializer.class) public class Triangle extends AbstractOpenApiSchema { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index 8b0cb6ea7a96..b4f86058637d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -36,8 +38,12 @@ TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "TriangleInterface") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "TriangleInterface") public class TriangleInterface { public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @XmlElement(name = "triangleType") @javax.annotation.Nonnull private String triangleType; @@ -56,6 +62,7 @@ public TriangleInterface triangleType(@javax.annotation.Nonnull String triangleT @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public String getTriangleType() { return triangleType; @@ -64,6 +71,7 @@ public String getTriangleType() { @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "triangleType") public void setTriangleType(@javax.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 12aa65e98202..6e714d5f6180 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -30,6 +30,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -51,50 +53,65 @@ User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "User") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "User") public class User { public static final String JSON_PROPERTY_ID = "id"; + @XmlElement(name = "id") @javax.annotation.Nullable private Long id; public static final String JSON_PROPERTY_USERNAME = "username"; + @XmlElement(name = "username") @javax.annotation.Nullable private String username; public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @XmlElement(name = "firstName") @javax.annotation.Nullable private String firstName; public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @XmlElement(name = "lastName") @javax.annotation.Nullable private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; + @XmlElement(name = "email") @javax.annotation.Nullable private String email; public static final String JSON_PROPERTY_PASSWORD = "password"; + @XmlElement(name = "password") @javax.annotation.Nullable private String password; public static final String JSON_PROPERTY_PHONE = "phone"; + @XmlElement(name = "phone") @javax.annotation.Nullable private String phone; public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @XmlElement(name = "userStatus") @javax.annotation.Nullable private Integer userStatus; public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + @XmlElement(name = "objectWithNoDeclaredProps") @javax.annotation.Nullable private Object objectWithNoDeclaredProps; public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + @XmlElement(name = "objectWithNoDeclaredPropsNullable") private JsonNullable objectWithNoDeclaredPropsNullable = JsonNullable.undefined(); public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; + @XmlElement(name = "anyTypeProp") private JsonNullable anyTypeProp = JsonNullable.of(null); public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + @XmlElement(name = "anyTypePropNullable") private JsonNullable anyTypePropNullable = JsonNullable.of(null); public User() { @@ -112,6 +129,7 @@ public User id(@javax.annotation.Nullable Long id) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public Long getId() { return id; @@ -120,6 +138,7 @@ public Long getId() { @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "id") public void setId(@javax.annotation.Nullable Long id) { this.id = id; } @@ -137,6 +156,7 @@ public User username(@javax.annotation.Nullable String username) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") public String getUsername() { return username; @@ -145,6 +165,7 @@ public String getUsername() { @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "username") public void setUsername(@javax.annotation.Nullable String username) { this.username = username; } @@ -162,6 +183,7 @@ public User firstName(@javax.annotation.Nullable String firstName) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") public String getFirstName() { return firstName; @@ -170,6 +192,7 @@ public String getFirstName() { @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "firstName") public void setFirstName(@javax.annotation.Nullable String firstName) { this.firstName = firstName; } @@ -187,6 +210,7 @@ public User lastName(@javax.annotation.Nullable String lastName) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") public String getLastName() { return lastName; @@ -195,6 +219,7 @@ public String getLastName() { @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "lastName") public void setLastName(@javax.annotation.Nullable String lastName) { this.lastName = lastName; } @@ -212,6 +237,7 @@ public User email(@javax.annotation.Nullable String email) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") public String getEmail() { return email; @@ -220,6 +246,7 @@ public String getEmail() { @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "email") public void setEmail(@javax.annotation.Nullable String email) { this.email = email; } @@ -237,6 +264,7 @@ public User password(@javax.annotation.Nullable String password) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") public String getPassword() { return password; @@ -245,6 +273,7 @@ public String getPassword() { @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "password") public void setPassword(@javax.annotation.Nullable String password) { this.password = password; } @@ -262,6 +291,7 @@ public User phone(@javax.annotation.Nullable String phone) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") public String getPhone() { return phone; @@ -270,6 +300,7 @@ public String getPhone() { @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "phone") public void setPhone(@javax.annotation.Nullable String phone) { this.phone = phone; } @@ -287,6 +318,7 @@ public User userStatus(@javax.annotation.Nullable Integer userStatus) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") public Integer getUserStatus() { return userStatus; @@ -295,6 +327,7 @@ public Integer getUserStatus() { @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "userStatus") public void setUserStatus(@javax.annotation.Nullable Integer userStatus) { this.userStatus = userStatus; } @@ -312,6 +345,7 @@ public User objectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWi @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "objectWithNoDeclaredProps") public Object getObjectWithNoDeclaredProps() { return objectWithNoDeclaredProps; @@ -320,6 +354,7 @@ public Object getObjectWithNoDeclaredProps() { @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "objectWithNoDeclaredProps") public void setObjectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWithNoDeclaredProps) { this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; } @@ -343,6 +378,7 @@ public Object getObjectWithNoDeclaredPropsNullable() { @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "objectWithNoDeclaredPropsNullable") public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { return objectWithNoDeclaredPropsNullable; @@ -376,6 +412,7 @@ public Object getAnyTypeProp() { @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anyTypeProp") public JsonNullable getAnyTypeProp_JsonNullable() { return anyTypeProp; @@ -409,6 +446,7 @@ public Object getAnyTypePropNullable() { @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "anyTypePropNullable") public JsonNullable getAnyTypePropNullable_JsonNullable() { return anyTypePropNullable; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index 52d9fdc1ed97..bd127971201b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -26,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -39,16 +41,22 @@ }) @JsonTypeName("whale") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Whale") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Whale") public class Whale { public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; + @XmlElement(name = "hasBaleen") @javax.annotation.Nullable private Boolean hasBaleen; public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; + @XmlElement(name = "hasTeeth") @javax.annotation.Nullable private Boolean hasTeeth; public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @javax.annotation.Nonnull private String className; @@ -67,6 +75,7 @@ public Whale hasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasBaleen") public Boolean getHasBaleen() { return hasBaleen; @@ -75,6 +84,7 @@ public Boolean getHasBaleen() { @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasBaleen") public void setHasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { this.hasBaleen = hasBaleen; } @@ -92,6 +102,7 @@ public Whale hasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasTeeth") public Boolean getHasTeeth() { return hasTeeth; @@ -100,6 +111,7 @@ public Boolean getHasTeeth() { @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "hasTeeth") public void setHasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { this.hasTeeth = hasTeeth; } @@ -117,6 +129,7 @@ public Whale className(@javax.annotation.Nonnull String className) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -125,6 +138,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@javax.annotation.Nonnull String className) { this.className = className; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index 7f88404d88f6..f148a086c48d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -30,6 +30,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; import org.openapitools.client.JSON; @@ -42,15 +44,23 @@ }) @JsonTypeName("zebra") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@XmlRootElement(name = "Zebra") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "Zebra") public class Zebra { /** * Gets or Sets type */ + @XmlType(name="TypeEnum") + @XmlEnum(String.class) public enum TypeEnum { + @XmlEnumValue("plains") PLAINS(String.valueOf("plains")), + @XmlEnumValue("mountain") MOUNTAIN(String.valueOf("mountain")), + @XmlEnumValue("grevys") GREVYS(String.valueOf("grevys")); private String value; @@ -81,10 +91,12 @@ public static TypeEnum fromValue(String value) { } public static final String JSON_PROPERTY_TYPE = "type"; + @XmlElement(name = "type") @javax.annotation.Nullable private TypeEnum type; public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @XmlElement(name = "className") @javax.annotation.Nonnull private String className; @@ -103,6 +115,7 @@ public Zebra type(@javax.annotation.Nullable TypeEnum type) { @javax.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public TypeEnum getType() { return type; @@ -111,6 +124,7 @@ public TypeEnum getType() { @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "type") public void setType(@javax.annotation.Nullable TypeEnum type) { this.type = type; } @@ -128,6 +142,7 @@ public Zebra className(@javax.annotation.Nonnull String className) { @javax.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public String getClassName() { return className; @@ -136,6 +151,7 @@ public String getClassName() { @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JacksonXmlProperty(localName = "className") public void setClassName(@javax.annotation.Nonnull String className) { this.className = className; }