[JAVA] [SPRING] [PKMST] [MICRONAUT] XML wireformat: Fix Jackson useWrapping=false, JAXB+Jackson namespaces (#18870)

* Fix XML annotations on model properties (JavaSpring)

* generate JAXB annotations for attributes and elements

* generate wrapper annotations (JAXB and Jackson)

* use XML config from items for annotations of containers

* Add test for Jackson XML wrapper correctness

* Add additional test cases to cover all xml applications in spec

Test now covers all use cases described in
- https://web.archive.org/web/20240424203304/https://swagger.io/docs/specification/data-models/representing-xml/
- https://spec.openapis.org/oas/v3.0.0#xml-arrays

* Fix basename used instead of xmlName when items.xmlName is unset

See last example in spec: https://spec.openapis.org/oas/v3.0.0#xml-arrays

* Harmonize spacing between Annotation attribute name and value

* Refactor and group JAXB vs. Jackson XML annotations, only generate latter if enabled

This is in line with the way the class annotations in `xmlAnnotations.mustache`
are rendered – which only renders the `@Jackson`… xml annotations if
additionalProperty jackson is true.

Also reorder annotation attributes in the following order:
- localName/name
- namespace (optional)
- isAttribute/useWrapping (optional)

* Explicitly render `useWrapping = true` to @JacksonXmlElementWrapper

This was slightly inspired by @jzrebiec via PR #5371.

Wrapping is the default since Jackson 2.1 – so explicitly rendering
this will:
- make generated model work out-of-the-box in Jackson 2.0 for instance
- ensure the models still work if the local `XmlWrapper` was
  configured with `useXmlWrapper(false)`

* Move xml test spec to java resources folder (not spring specific)

* Make test class name match class-under-test

This makes discovery & cross-navigation in IDE easier.

* Add complete xml annotations test for Java generators

* Fix Java PKMST generator not generating @JacksonXmlElementWrapper

* Fix Java microprofile generator missing @JacksonXmlRootElement

* Fix Java microprofile generator not using wrapper annotations and namespaces

* Fix Java Micronaut Client creating invalid (unclosed) @XmlAttribute annotations

* Fix Micronaut Client using wrong localName for @JacksonXmlElementWrapper

* Fix Micronaut client rendering @JacksonXmlProperty annotation twice

* Make Java Micronaut render @JacksonXmlElementWrapper(useWrapping=false) for non-wrapped elements

* Fix Jackson element using `xml.name` when it should be `items.xml.name`

Closes #5989
Closes #3223
Relates to #9371

* Fix JAXB element using `baseName` instead of `xmlName` when items.xmlName is unset

* Remove XML generation debug output from templates

* Remove redundant newline between XML class annotations and class

Brings the SpringCodegen in line with other Java Codegen's

* Remove redundant newline between XML setter annotations and setter

* Fix multiline JavaDoc block indentation and format

* Simplify / condense xml annotation template into single lines

May look a bit more complex, but cuts out a lot of repetitiveness.
Also reorders annotation attributes in the following order:
- localName/name
- namespace (optional)
- isAttribute/useWrapping (optional)

* Harmonize spacing between Annotation attribute name and value

* Remove unused jackson_annotations partial

Was not referenced anywhere in java-helidon resources folder

---------

Co-authored-by: Christian Schuster <christian@dnup.de>
This commit is contained in:
Philzen 2024-06-15 17:02:32 +02:00 committed by GitHub
parent 13facdaab5
commit 642b1a3a95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2726 changed files with 20424 additions and 20024 deletions

View File

@ -6,15 +6,9 @@
}}
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
@JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
{{#withXml}}
{{^isContainer}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
{{#xmlName}}
// xmlName={{.}}
{{/xmlName}}
@JacksonXmlProperty({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/xmlName}}")
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}{{#xmlNamespace}}, namespace="{{.}}"{{/xmlNamespace}}{{#isXmlWrapped}}, localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{/isXmlWrapped}})
{{/isContainer}}
{{/withXml}}
{{#withXml}}
@JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isContainer}}
@JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}})
{{/isContainer}}
{{/withXml}}

View File

@ -47,28 +47,15 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{/jackson}}
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{#isDateTime}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{^isXmlAttribute}}
{{#isDateTime}}
@XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class)
{{/isDateTime}}
{{/isXmlAttribute}}
{{/isDateTime}}
{{/isXmlAttribute}}
{{/withXml}}
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@ -181,7 +168,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isMap}}
{{/isReadOnly}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -198,7 +185,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
*/
{{#deprecated}}
@Deprecated
{{/deprecated}}

View File

@ -52,25 +52,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{/jackson}}
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/isXmlAttribute}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@ -191,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isMap}}
{{/isReadOnly}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
*/
{{#deprecated}}
@Deprecated
{{/deprecated}}

View File

@ -52,25 +52,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{/jackson}}
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/isXmlAttribute}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@ -191,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isMap}}
{{/isReadOnly}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
*/
{{#deprecated}}
@Deprecated
{{/deprecated}}

View File

@ -1,10 +1,9 @@
{{#withXml}}
@XmlAccessorType(XmlAccessType.FIELD)
{{#hasVars}} @XmlType(name = "{{classname}}", propOrder =
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}}
}){{/hasVars}}
{{#hasVars}}@XmlType(name = "{{classname}}", propOrder =
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} }
){{/hasVars}}
{{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}}
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
{{> xmlAnnotation }}
{{/withXml}}
{{#jackson}}
@JsonPropertyOrder({
@ -21,7 +20,7 @@
{{#description}}
/**
* {{{.}}}
**/
*/
{{/description}}
{{>additionalModelTypeAnnotations}}
{{#vendorExtensions.x-class-extra-annotation}}
@ -35,12 +34,15 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{/jackson}}
{{#withXml}}
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#description}}
/**
* {{{.}}}
**/
* {{{.}}}
*/
{{/description}}
{{^withXml}}
{{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}
@ -71,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
}
{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}}
{{#vars}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -88,7 +90,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
**/
{{#deprecated}}
@Deprecated
{{/deprecated}}
@ -112,8 +114,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{^isReadOnly}}
/**
* Set {{name}}
**/
* Set {{name}}
*/
{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}}
{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};
@ -148,8 +150,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{/vars}}
/**
* Create a string representation of this pojo.
**/
* Create a string representation of this pojo.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();

View File

@ -55,25 +55,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{/jackson}}
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/isXmlAttribute}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@ -182,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isMap}}
{{/isReadOnly}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -199,7 +184,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
*/
{{#deprecated}}
@Deprecated
{{/deprecated}}
@ -230,8 +215,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}}
@JsonIgnore
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}}
public {{{datatypeWithEnum}}} {{getter}}() {
{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() {
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}}
if ({{name}} == null) {

View File

@ -59,25 +59,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isEnum}}
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/isXmlAttribute}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#deprecated}}
@Deprecated
@ -148,7 +133,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isMap}}
{{/isReadOnly}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -165,7 +150,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
*/
{{#deprecated}}
@Deprecated
{{/deprecated}}
@ -354,12 +339,12 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/requiredVars}}
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to {{classname}}
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to {{classname}}
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!{{classname}}.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -585,22 +570,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
{{/hasChildren}}
/**
* Create an instance of {{classname}} given an JSON string
*
* @param jsonString JSON string
* @return An instance of {{classname}}
* @throws IOException if the JSON string is invalid with respect to {{classname}}
*/
/**
* Create an instance of {{classname}} given an JSON string
*
* @param jsonString JSON string
* @return An instance of {{classname}}
* @throws IOException if the JSON string is invalid with respect to {{classname}}
*/
public static {{{classname}}} fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, {{{classname}}}.class);
}
/**
* Convert an instance of {{classname}} to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of {{classname}} to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -52,28 +52,15 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{/jackson}}
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{#isDateTime}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{^isXmlAttribute}}
{{#isDateTime}}
@XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class)
{{/isDateTime}}
{{/isXmlAttribute}}
{{/isDateTime}}
{{/isXmlAttribute}}
{{/withXml}}
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@ -115,8 +102,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#vendorExtensions.x-has-readonly-properties}}
{{^withXml}}
/**
* Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}}
*/
* Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}}
*/
{{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}}
public {{classname}}(
{{#readOnlyVars}}
@ -133,8 +120,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#vendorExtensions.x-java-all-args-constructor}}
/**
* Constructor with all args parameters
*/
* Constructor with all args parameters
*/
public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) {
{{#parent}}
super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}});
@ -202,7 +189,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isMap}}
{{/isReadOnly}}
/**
/**
{{#description}}
* {{.}}
{{/description}}
@ -219,7 +206,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#deprecated}}
* @deprecated
{{/deprecated}}
**/
*/
{{#deprecated}}
@Deprecated
{{/deprecated}}

View File

@ -25,6 +25,7 @@ import org.hibernate.validator.constraints.*;
{{#withXml}}
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
{{/withXml}}
{{/jackson}}
{{#swagger2AnnotationLibrary}}

View File

@ -128,8 +128,8 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#vendorExtensions.x-java-all-args-constructor}}
/**
* Constructor with all args parameters
*/
* Constructor with all args parameters
*/
public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) {
{{#parent}}
super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}});
@ -215,7 +215,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#deprecated}}
* @deprecated
{{/deprecated}}
*/
*/
{{#vendorExtensions.x-extra-annotation}}
{{{vendorExtensions.x-extra-annotation}}}
{{/vendorExtensions.x-extra-annotation}}
@ -234,9 +234,18 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#jackson}}
@JsonProperty("{{baseName}}")
{{#withXml}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
@JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isContainer}}
@JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}})
{{/isContainer}}
{{/withXml}}
{{/jackson}}
{{#withXml}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
@ -249,7 +258,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#deprecated}}
/**
* @deprecated
*/
*/
{{/deprecated}}
{{#vendorExtensions.x-setter-extra-annotation}}
{{{vendorExtensions.x-setter-extra-annotation}}}

View File

@ -1,7 +1,6 @@
{{#withXml}}
{{#jackson}}
@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
@JacksonXmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
{{/jackson}}
@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
@XmlAccessorType(XmlAccessType.FIELD)
{{/withXml}}
@XmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
@XmlAccessorType(XmlAccessType.FIELD){{/withXml}}

View File

@ -1,19 +0,0 @@
{{!
If this is map and items are nullable, make sure that nulls are included.
To determine what JsonInclude.Include method to use, consider the following:
* If the field is required, always include it, even if it is null.
* Else use custom behaviour, IOW use whatever is defined on the object mapper
}}
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
@JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
{{#withXml}}
{{^isContainer}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
{{#isXmlWrapped}}
// items.xmlName={{items.xmlName}}
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/withXml}}

View File

@ -1,19 +0,0 @@
{{!
If this is map and items are nullable, make sure that nulls are included.
To determine what JsonInclude.Include method to use, consider the following:
* If the field is required, always include it, even if it is null.
* Else use custom behaviour, IOW use whatever is defined on the object mapper
}}
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
@JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
{{#withXml}}
{{^isContainer}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
{{#isXmlWrapped}}
// items.xmlName={{items.xmlName}}
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/withXml}}

View File

@ -7,15 +7,9 @@
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
@JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
{{#withXml}}
{{^isContainer}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
@JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isContainer}}
{{#isXmlWrapped}}
// items.xmlName={{items.xmlName}}
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}")
{{/isXmlWrapped}}
@JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}})
{{/isContainer}}
{{/withXml}}
{{#jackson}}

View File

@ -48,25 +48,10 @@ Declare the class with extends and implements
{{/isEnum}}
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
{{#withXml}}
{{#isXmlAttribute}}
@XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"
{{/isXmlAttribute}}
{{^isXmlAttribute}}
{{^isContainer}}
@XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isContainer}}
{{#isContainer}}
// Is a container wrapped={{isXmlWrapped}}
{{#items}}
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
// items.example={{example}} items.type={{dataType}}
@XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/items}}
{{#isXmlWrapped}}
@XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
{{/isXmlWrapped}}
{{/isContainer}}
{{/isXmlAttribute}}
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isXmlWrapped}}
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{/isXmlWrapped}}
{{/withXml}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
@ -184,7 +169,7 @@ Declare the class with extends and implements
* maximum: {{maximum}}
{{/maximum}}
* @return {{name}}
**/
*/
{{>common/model/beanValidation}}{{!
}}{{#generateSwagger1Annotations}}
@ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")

View File

@ -1,6 +1,6 @@
{{#withXml}}
@XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
@XmlRootElement({{#xmlNamespace}}namespace = "{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
@XmlAccessorType(XmlAccessType.FIELD)
{{#jackson}}
@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}}
@JacksonXmlRootElement({{#xmlNamespace}}namespace = "{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}}

View File

@ -15,6 +15,7 @@ import {{javaxPackage}}.validation.constraints.*;
{{#withXml}}
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
{{/withXml}}
{{/jackson}}
{{#withXml}}

View File

@ -21,8 +21,13 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{/isContainer}}
{{/isEnum}}
{{#jackson}}
@JsonProperty("{{baseName}}"){{#withXml}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"){{/withXml}}
@JsonProperty("{{baseName}}")
{{#withXml}}
@JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
{{#isContainer}}
@JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}})
{{/isContainer}}
{{/withXml}}
{{/jackson}}
{{#gson}}
@SerializedName("{{baseName}}")
@ -62,7 +67,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
}
{{/isMap}}
/**
/**
{{#description}}
* {{{.}}}
{{/description}}
@ -76,7 +81,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
* maximum: {{.}}
{{/maximum}}
* @return {{name}}
**/
*/
{{#vendorExtensions.x-extra-annotation}}
{{{vendorExtensions.x-extra-annotation}}}
{{/vendorExtensions.x-extra-annotation}}

View File

@ -118,6 +118,19 @@ public class JavaClientCodegenTest {
.iterator();
}
@DataProvider Iterator<Library> librariesSupportingJackson() {
return Arrays.stream(Library.values())
.filter(library -> library.getSupportedSerializers().contains(Serializer.JACKSON))
.iterator();
}
@DataProvider Iterator<Library> librariesNotSupportingJackson() {
return Arrays.stream(Library.values())
.filter(library -> !library.getSupportedSerializers().contains(Serializer.JACKSON))
.iterator();
}
@Test public void arraysInRequestBody() {
OpenAPI openAPI = TestUtils.createOpenAPI();
final JavaClientCodegen codegen = new JavaClientCodegen();
@ -2676,4 +2689,256 @@ public class JavaClientCodegenTest {
throw new RuntimeException(e);
}
}
/**
* General XML annotations test (both JAXB and Jackson)
* <br>
* Includes regression tests for:
* - <a href="https://github.com/OpenAPITools/openapi-generator/issues/2417">Correct Jackson annotation when `wrapped: false`</a>
* - <a href="https://github.com/OpenAPITools/openapi-generator/issues/18869">Microprofile generator missing Jackson annotations and namespaces</a>
*/
@Test(dataProvider = "librariesSupportingJackson")
void shouldGenerateCorrectXmlAnnotations(Library library) throws IOException {
// Arrange
final String TEST_SPEC = "src/test/resources/3_0/java/xml-annotations-test.yaml";
final Path output = newTempFolder();
JavaClientCodegen codegen = new JavaClientCodegen();
codegen.setLibrary(library.getValue());
codegen.setSerializationLibrary("jackson");
codegen.setWithXml(true);
codegen.setOutputDir(output.toString());
DefaultGenerator generator = new DefaultGenerator();
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGenerateMetadata(false);
// Act
generator.opts(new ClientOptInput().config(codegen).openAPI(TestUtils.parseSpec(TEST_SPEC))).generate();
// Assert
JavaFileAssert.assertThat(output.resolve("src/main/java/org/openapitools/client/model/Pet.java").toFile())
.assertTypeAnnotations()
.containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD"))
.containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.toType()
// test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
.hasProperty("tags").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\""))
.toProperty().toType()
.assertMethod("getTags").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Tag\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("friends").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\""))
.toProperty().toType()
.assertMethod("getFriends").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"friend-pet\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
.hasProperty("status").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\""))
.toProperty().toType()
.assertMethod("getStatus").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"PetStatus\""))
.toMethod().toFileAssert()
// test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays)
// maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("photoUrls").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\""))
.toProperty().toType()
.assertMethod("getPhotoUrls").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"photoUrls\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute)
.hasProperty("name").assertPropertyAnnotations()
.doesNotContainsWithName("XmlElement")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\""))
.toProperty().toType()
.assertMethod("getName").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\""))
.toMethod().toFileAssert()
// test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces)
.hasProperty("id").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toProperty().toType()
.assertMethod("getId").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toMethod().toFileAssert()
// external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("foods").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\""))
.toProperty().toType()
.assertMethod("getFoods").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\""))
.toMethod().toFileAssert()
// internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("colors").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\""))
.toProperty().toType()
.assertMethod("getColors").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"color\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"colors\""))
.toMethod().toFileAssert()
// ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("categories").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\""))
.toProperty().toType()
.assertMethod("getCategories").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Category\""))
// specific regression test for #2417: (useWrapping=false) needs to be present
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
// maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("activities").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\""))
.toProperty().toType()
.assertMethod("getActivities").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"item\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\""));
}
/**
* General XML annotations test (only JAXB)
*/
@Test(dataProvider = "librariesNotSupportingJackson")
void shouldGenerateCorrectJaxbAnnotations(Library library) {
// Arrange
final String TEST_SPEC = "src/test/resources/3_0/java/xml-annotations-test.yaml";
final Path output = newTempFolder();
JavaClientCodegen codegen = new JavaClientCodegen();
codegen.setLibrary(library.getValue());
codegen.setSerializationLibrary("jackson");
codegen.setWithXml(true);
codegen.setOutputDir(output.toString());
DefaultGenerator generator = new DefaultGenerator();
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGenerateMetadata(false);
// Act
generator.opts(new ClientOptInput().config(codegen).openAPI(TestUtils.parseSpec(TEST_SPEC))).generate();
// Assert
JavaFileAssert.assertThat(output.resolve("src/main/java/org/openapitools/client/model/Pet.java").toFile())
.assertTypeAnnotations()
.containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD"))
.toType()
// test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
.hasProperty("tags").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\""))
.toProperty().toType()
// custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("friends").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\""))
.toProperty().toType()
// test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
.hasProperty("status").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\""))
.toProperty().toType()
// test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays)
// maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("photoUrls").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\""))
.toProperty().toType()
// test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute)
.hasProperty("name").assertPropertyAnnotations()
.doesNotContainsWithName("XmlElement")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\""))
.toProperty().toType()
// test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces)
.hasProperty("id").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toProperty().toType()
// external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("foods").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\""))
.toProperty().toType()
// internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("colors").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\""))
.toProperty().toType()
// ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("categories").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\""))
.toProperty().toType()
// test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
// maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("activities").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\""));
}
}

View File

@ -3,16 +3,22 @@ package org.openapitools.codegen.java.micronaut;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.*;
import org.openapitools.codegen.java.assertions.JavaFileAssert;
import org.openapitools.codegen.languages.JavaMicronautClientCodegen;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import static java.util.stream.Collectors.groupingBy;
import static org.testng.Assert.*;
import static org.testng.Assert.assertEquals;
public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest {
public class JavaMicronautClientCodegenTest extends AbstractMicronautCodegenTest {
@Test
public void clientOptsUnicity() {
JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
@ -310,4 +316,150 @@ public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest {
// Micronaut declarative http client should use the provided path separator
assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Client(\"${openapi-micronaut-client.base-path}\")");
}
/**
* General XML annotations test (both JAXB and Jackson)
* <br>
* Includes regression tests for:
* - <a href="https://github.com/OpenAPITools/openapi-generator/issues/2417">Correct Jackson annotation when `wrapped: false`</a>
*/
@Test public void shouldGenerateCorrectXmlAnnotations() throws IOException {
// Arrange
final String TEST_SPEC = "src/test/resources/3_0/java/xml-annotations-test.yaml";
final Path output = Files.createTempDirectory("test-xml-annotations_");
output.toFile().deleteOnExit();
JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen();
codegen.setWithXml(true);
codegen.setOutputDir(output.toString());
DefaultGenerator generator = new DefaultGenerator();
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGenerateMetadata(false);
// Act
generator.opts(new ClientOptInput().config(codegen).openAPI(TestUtils.parseSpec(TEST_SPEC))).generate();
// Assert
JavaFileAssert.assertThat(output.resolve("src/main/java/org/openapitools/model/Pet.java").toFile())
.assertTypeAnnotations()
.containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD"))
.toType()
// test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
.hasProperty("tags").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\""))
.toProperty().toType()
.assertMethod("getTags").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Tag\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("friends").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\""))
.toProperty().toType()
.assertMethod("getFriends").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"friend-pet\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
.hasProperty("status").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\""))
.toProperty().toType()
.assertMethod("getStatus").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"PetStatus\""))
.toMethod().toFileAssert()
// test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays)
// maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("photoUrls").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\""))
.toProperty().toType()
.assertMethod("getPhotoUrls").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"photoUrls\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute)
.hasProperty("name").assertPropertyAnnotations()
.doesNotContainsWithName("XmlElement")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\""))
.toProperty().toType()
.assertMethod("getName").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\""))
.toMethod().toFileAssert()
// test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces)
.hasProperty("id").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toProperty().toType()
.assertMethod("getId").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toMethod().toFileAssert()
// external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("foods").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\""))
.toProperty().toType()
.assertMethod("getFoods").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\""))
.toMethod().toFileAssert()
// internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("colors").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\""))
.toProperty().toType()
.assertMethod("getColors").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"color\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"colors\""))
.toMethod().toFileAssert()
// ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("categories").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\""))
.toProperty().toType()
.assertMethod("getCategories").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Category\""))
// specific regression test for #2417: (useWrapping=false) needs to be present
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
// maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("activities").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\""))
.toProperty().toType()
.assertMethod("getActivities").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"item\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\""));
}
}

View File

@ -3,17 +3,21 @@ package org.openapitools.codegen.java.micronaut;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.TestUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.java.assertions.JavaFileAssert;
import org.openapitools.codegen.languages.JavaMicronautServerCodegen;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import static java.util.stream.Collectors.groupingBy;
import static org.testng.Assert.assertEquals;
public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest {
public class JavaMicronautServerCodegenTest extends AbstractMicronautCodegenTest {
protected static String ROLES_EXTENSION_TEST_PATH = "src/test/resources/3_0/micronaut/roles-extension-test.yaml";
protected static String MULTI_TAGS_TEST_PATH = "src/test/resources/3_0/micronaut/multi-tags-test.yaml";
@ -341,4 +345,150 @@ public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest {
assertFileContains(controllerPath + "SearchController.java",
"authorSearchGet", "bookSearchGet");
}
/**
* General XML annotations test (both JAXB and Jackson)
* <br>
* Includes regression tests for:
* - <a href="https://github.com/OpenAPITools/openapi-generator/issues/2417">Correct Jackson annotation when `wrapped: false`</a>
*/
@Test public void shouldGenerateCorrectXmlAnnotations() throws IOException {
// Arrange
final String TEST_SPEC = "src/test/resources/3_0/java/xml-annotations-test.yaml";
final Path output = Files.createTempDirectory("test-xml-annotations_");
output.toFile().deleteOnExit();
JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen();
codegen.setWithXml(true);
codegen.setOutputDir(output.toString());
DefaultGenerator generator = new DefaultGenerator();
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGenerateMetadata(false);
// Act
generator.opts(new ClientOptInput().config(codegen).openAPI(TestUtils.parseSpec(TEST_SPEC))).generate();
// Assert
JavaFileAssert.assertThat(output.resolve("src/main/java/org/openapitools/model/Pet.java").toFile())
.assertTypeAnnotations()
.containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD"))
.toType()
// test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
.hasProperty("tags").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\""))
.toProperty().toType()
.assertMethod("getTags").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Tag\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("friends").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\""))
.toProperty().toType()
.assertMethod("getFriends").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"friend-pet\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
.hasProperty("status").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\""))
.toProperty().toType()
.assertMethod("getStatus").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"PetStatus\""))
.toMethod().toFileAssert()
// test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays)
// maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("photoUrls").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\""))
.toProperty().toType()
.assertMethod("getPhotoUrls").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"photoUrls\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute)
.hasProperty("name").assertPropertyAnnotations()
.doesNotContainsWithName("XmlElement")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\""))
.toProperty().toType()
.assertMethod("getName").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\""))
.toMethod().toFileAssert()
// test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces)
.hasProperty("id").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toProperty().toType()
.assertMethod("getId").assertMethodAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toMethod().toFileAssert()
// external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("foods").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\""))
.toProperty().toType()
.assertMethod("getFoods").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\""))
.toMethod().toFileAssert()
// internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("colors").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\""))
.toProperty().toType()
.assertMethod("getColors").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"color\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"colors\""))
.toMethod().toFileAssert()
// ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("categories").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\""))
.toProperty().toType()
.assertMethod("getCategories").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Category\""))
// specific regression test for #2417: (useWrapping=false) needs to be present
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
// maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("activities").assertPropertyAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\""))
.toProperty().toType()
.assertMethod("getActivities").assertMethodAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"item\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\""));
}
}

View File

@ -17,60 +17,17 @@
package org.openapitools.codegen.java.spring;
import static java.util.stream.Collectors.groupingBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.openapitools.codegen.TestUtils.assertFileContains;
import static org.openapitools.codegen.TestUtils.assertFileNotContains;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_BUILDERS;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS;
import static org.openapitools.codegen.languages.SpringCodegen.ASYNC;
import static org.openapitools.codegen.languages.SpringCodegen.DELEGATE_PATTERN;
import static org.openapitools.codegen.languages.SpringCodegen.DocumentationProvider;
import static org.openapitools.codegen.languages.SpringCodegen.IMPLICIT_HEADERS;
import static org.openapitools.codegen.languages.SpringCodegen.INTERFACE_ONLY;
import static org.openapitools.codegen.languages.SpringCodegen.OPENAPI_NULLABLE;
import static org.openapitools.codegen.languages.SpringCodegen.REACTIVE;
import static org.openapitools.codegen.languages.SpringCodegen.REQUEST_MAPPING_OPTION;
import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER;
import static org.openapitools.codegen.languages.SpringCodegen.RETURN_SUCCESS_CODE;
import static org.openapitools.codegen.languages.SpringCodegen.SKIP_DEFAULT_INTERFACE;
import static org.openapitools.codegen.languages.SpringCodegen.SPRING_BOOT;
import static org.openapitools.codegen.languages.SpringCodegen.SPRING_CLOUD_LIBRARY;
import static org.openapitools.codegen.languages.SpringCodegen.SPRING_CONTROLLER;
import static org.openapitools.codegen.languages.SpringCodegen.SSE;
import static org.openapitools.codegen.languages.SpringCodegen.USE_ENUM_CASE_INSENSITIVE;
import static org.openapitools.codegen.languages.SpringCodegen.USE_RESPONSE_ENTITY;
import static org.openapitools.codegen.languages.SpringCodegen.USE_SPRING_BOOT3;
import static org.openapitools.codegen.languages.SpringCodegen.USE_TAGS;
import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY;
import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.google.common.collect.ImmutableMap;
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.apache.commons.lang3.StringUtils;
import org.assertj.core.api.MapAssert;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.CodegenModel;
import org.openapitools.codegen.CodegenOperation;
import org.openapitools.codegen.CodegenParameter;
import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.TestUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.config.CodegenConfigurator;
import org.openapitools.codegen.config.GlobalSettings;
import org.openapitools.codegen.java.assertions.JavaFileAssert;
@ -85,15 +42,30 @@ import org.testng.annotations.DataProvider;
import org.testng.annotations.Ignore;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.parser.core.models.ParseOptions;
import static java.util.stream.Collectors.groupingBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.openapitools.codegen.TestUtils.assertFileContains;
import static org.openapitools.codegen.TestUtils.assertFileNotContains;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_BUILDERS;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS;
import static org.openapitools.codegen.languages.SpringCodegen.*;
import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY;
import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
public class SpringCodegenTest {
@ -4888,6 +4860,133 @@ public class SpringCodegenTest {
JavaFileAssert.assertThat(files.get("Color.java"))
.assertMethod("fromValue").bodyContainsLines("throw new IllegalArgumentException(\"Unexpected value '\" + value + \"'\");");
}
/**
* General XML annotations test (both JAXB and Jackson)
* <br>
* Includes regression tests for:
* - <a href="https://github.com/OpenAPITools/openapi-generator/issues/2417">Correct Jackson annotation when `wrapped: false`</a>
*/
@Test void shouldGenerateCorrectXmlAnnotations() throws IOException {
// Arrange
final String TEST_SPEC = "src/test/resources/3_0/java/xml-annotations-test.yaml";
final Path output = Files.createTempDirectory("test-xml-annotations_");
output.toFile().deleteOnExit();
SpringCodegen codegen = new SpringCodegen();
codegen.setLibrary(SPRING_BOOT);
codegen.setWithXml(true);
codegen.setOutputDir(output.toString());
DefaultGenerator generator = new DefaultGenerator();
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGenerateMetadata(false);
// Act
generator.opts(new ClientOptInput().config(codegen).openAPI(TestUtils.parseSpec(TEST_SPEC))).generate();
// Assert
JavaFileAssert.assertThat(output.resolve("src/main/java/org/openapitools/model/Pet.java").toFile())
.assertTypeAnnotations()
.containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD"))
.toType()
// test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
.assertMethod("getTags").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Tag\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"TagList\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Tag\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.assertMethod("getFriends").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"friend-pet\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"friend-pet\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
.assertMethod("getStatus").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"PetStatus\""))
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"PetStatus\""))
.toMethod().toFileAssert()
// test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays)
// maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.assertMethod("getPhotoUrls").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"photoUrls\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"photoUrls\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"photoUrls\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true"))
.toMethod().toFileAssert()
// test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute)
.assertMethod("getName").assertMethodAnnotations()
.doesNotContainsWithName("XmlElement")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlAttribute", Map.of("name", "\"name\""))
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes(
"JacksonXmlProperty",
Map.of("isAttribute", "true", "localName", "\"name\"")
)
.toMethod().toFileAssert()
// test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces)
.assertMethod("getId").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"id\"", "namespace", "\"http://example.com/schema\""))
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toMethod().toFileAssert()
// external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.assertMethod("getFoods").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"yummy-yummy\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"yummy-yummy\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\""))
.toMethod().toFileAssert()
// internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.assertMethod("getColors").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"color\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"colors\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"color\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"colors\""))
.toMethod().toFileAssert()
// ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.assertMethod("getCategories").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.doesNotContainsWithName("XmlElementWrapper")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"Category\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Category\""))
// specific regression test for #2417: (useWrapping=false) needs to be present
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toMethod().toFileAssert()
// test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
// maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.assertMethod("getActivities").assertMethodAnnotations()
.doesNotContainsWithName("XmlAttribute")
.containsWithNameAndAttributes("XmlElement", Map.of("name", "\"item\""))
.containsWithNameAndAttributes("XmlElementWrapper", Map.of("name", "\"activities-array\""))
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"item\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\""));
}
}

View File

@ -0,0 +1,112 @@
package org.openapitools.codegen.languages;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.TestUtils;
import org.openapitools.codegen.java.assertions.JavaFileAssert;
import org.testng.annotations.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
public class JavaPKMSTServerCodegenTest {
/**
* General XML annotations test (both JAXB and Jackson)
* <br>
* Includes regression tests for:
* - <a href="https://github.com/OpenAPITools/openapi-generator/issues/2417">Correct Jackson annotation when `wrapped: false`</a>
*/
@Test public void shouldGenerateCorrectXmlAnnotations() throws IOException {
// Arrange
final String TEST_SPEC = "src/test/resources/3_0/java/xml-annotations-test.yaml";
final Path output = Files.createTempDirectory("test-xml-annotations_");
output.toFile().deleteOnExit();
JavaPKMSTServerCodegen codegen = new JavaPKMSTServerCodegen();
codegen.setWithXml(true);
codegen.setOutputDir(output.toString());
DefaultGenerator generator = new DefaultGenerator();
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGenerateMetadata(false);
// Act
generator.opts(new ClientOptInput().config(codegen).openAPI(TestUtils.parseSpec(TEST_SPEC))).generate();
// Assert
JavaFileAssert.assertThat(output.resolve("src/main/java/com/prokarma/pkmst/model/Pet.java").toFile())
.assertTypeAnnotations()
.containsWithNameAndAttributes("JacksonXmlRootElement", Map.of("localName", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlRootElement", Map.of("name", "\"Pet\"", "namespace", "\"urn:jacksonxml\""))
.containsWithNameAndAttributes("XmlAccessorType", Map.of("value", "XmlAccessType.FIELD"))
.toType()
// test custom-name on wrapper element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
.hasProperty("tags").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Tag\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"TagList\"", "useWrapping", "true"))
.toProperty().toType()
// custom internal xml-array element name, non-wrapped (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("friends").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"friend-pet\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toProperty().toType()
// test custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
.hasProperty("status").assertPropertyAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"PetStatus\""))
.toProperty().toType()
// test same-name wrapping element (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Wrapping%20Arrays)
// maps to 3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("photoUrls").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"photoUrls\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"photoUrls\"", "useWrapping", "true"))
.toProperty().toType()
// test attribute generation (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Convert%20Property%20to%20an%20Attribute)
.hasProperty("name").assertPropertyAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("isAttribute", "true", "localName", "\"name\""))
.toProperty().toType()
// test XML namespace and prefix (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Prefixes%20and%20Namespaces)
.hasProperty("id").assertPropertyAnnotations()
.doesNotContainsWithName("JacksonXmlElementWrapper")
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"id\"", "namespace", "\"http://example.com/schema\""))
.toProperty().toType()
// external xml-array element name only (last example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("foods").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"yummy-yummy\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"yummy-yummy\""))
.toProperty().toType()
// internal xml-array element name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("colors").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"color\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"colors\""))
.toProperty().toType()
// ignored external xml-array element name, non-wrapped (2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
.hasProperty("categories").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"Category\""))
// specific regression test for #2417: (useWrapping=false) needs to be present
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("useWrapping", "false"))
.toProperty().toType()
// test custom-name on wrapper AND children (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Use%20xml/name%20to%20give%20different%20names)
// maps to 5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays
.hasProperty("activities").assertPropertyAnnotations()
.containsWithNameAndAttributes("JacksonXmlProperty", Map.of("localName", "\"item\""))
.containsWithNameAndAttributes("JacksonXmlElementWrapper", Map.of("localName", "\"activities-array\""));
}
}

View File

@ -0,0 +1,142 @@
openapi: 3.0.0
info:
description: |
This spec is mainly for testing JAXB & Jackson XML annotation being generated correctly.
Some guidance:
- Jackson annotations: https://www.baeldung.com/jackson-xml-serialization-and-deserialization
- JAXB annotations: https://howtodoinjava.com/jaxb/xmlelementwrapper-annotation
version: 1.0.0
title: OpenAPI Petstore
servers:
- url: 'https://localhost'
paths:
/foo:
get:
operationId: foo
responses:
'200':
description: response
content:
application/xml:
schema:
$ref: '#/components/schemas/Pet'
components:
requestBodies:
Pet:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
required: true
schemas:
Category:
type: object
required:
- name
properties:
id:
type: integer
format: int64
name:
type: string
default: default-name
xml:
name: Category
Tag:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
xml:
name: Tag
Pet:
type: object
required:
- name
- photoUrls
properties:
id:
type: integer
format: int64
x-is-unique: true
xml:
prefix: 'smp'
namespace: 'http://example.com/schema'
friends: # non-wrapped with custom xml item element name (1st example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
type: array
items:
type: string
xml:
name: friend-pet
categories:
type: array
items:
$ref: '#/components/schemas/Category'
xml:
wrapped: false # This is the default value as per OAI spec anyway, just being explicit here for the test
# as per https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=For%20arrays:
# »For arrays, the `xml/name` property works only if `xml/wrapped` is set to true.
name: NotUsedAsNotWrapped # ← so this will not be used (see also 2nd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
name:
type: string
example: doggie
xml:
attribute: true
photoUrls: # wrapped with no defined xml name (3rd example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
type: array
xml:
wrapped: true
items:
type: string
colors: # wrapped with only internal xml name (4th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
type: array
xml:
wrapped: true
items:
type: string
xml:
name: color
activities: # wrapped with both internal and external xml name (5th example in https://spec.openapis.org/oas/v3.0.0#xml-arrays)
type: array
xml:
wrapped: true
name: activities-array
items:
type: string
xml:
name: item
foods:
type: array
items:
type: string
xml:
name: yummy-yummy # test case for changing external name, but not internal (last example at https://spec.openapis.org/oas/v3.0.0#xml-arrays)
wrapped: true
tags:
type: array
xml:
name: TagList
wrapped: true
items:
$ref: '#/components/schemas/Tag'
xml:
name: Ignored # because sibling elements of `$ref`s are ignored (https://swagger.io/docs/specification/using-ref/)
status:
type: string
description: pet status in the store
enum:
- available
- pending
- sold
xml:
name: PetStatus # custom element name (https://swagger.io/docs/specification/data-models/representing-xml/#:~:text=Change%20Element%20Names)
xml:
name: Pet
namespace: 'urn:jacksonxml'

View File

@ -1485,10 +1485,11 @@ components:
photoUrls:
type: array
xml:
name: photoUrl
wrapped: true
items:
type: string
xml:
name: photoUrl
uniqueItems: true
tags:
type: array

View File

@ -50,10 +50,10 @@ public class Bird {
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -75,10 +75,10 @@ public class Bird {
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -50,10 +50,10 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -75,10 +75,10 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -60,10 +60,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* test suffix
* @return suffix
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SUFFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -85,10 +85,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* Some text containing white spaces
* @return text
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -110,10 +110,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* A date
* @return date
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -127,10 +127,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumRefDefault
* @return arrayStringEnumRefDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -160,10 +160,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumDefault
* @return arrayStringEnumDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -193,10 +193,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringDefault
* @return arrayStringDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -226,10 +226,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayIntegerDefault
* @return arrayIntegerDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -259,10 +259,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayString
* @return arrayString
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -296,10 +296,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringNullable
* @return arrayStringNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
@ -341,10 +341,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringExtensionNullable
* @return arrayStringExtensionNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
@ -374,10 +374,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get stringNullable
* @return stringNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore

View File

@ -55,10 +55,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get number
* @return number
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -80,10 +80,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _float
* @return _float
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FLOAT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -105,12 +105,12 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _double
* minimum: 0.8
* maximum: 50.2
* @return _double
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DOUBLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -108,10 +108,10 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -133,10 +133,10 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@ -158,10 +158,10 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CATEGORY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -191,10 +191,10 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@ -224,10 +224,10 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -249,10 +249,10 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -90,10 +90,10 @@ public class Query {
return this;
}
/**
/**
* Query
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -123,10 +123,10 @@ public class Query {
return this;
}
/**
/**
* Get outcomes
* @return outcomes
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_OUTCOMES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -50,10 +50,10 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -75,10 +75,10 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -47,10 +47,10 @@ public class TestFormObjectMultipartRequestMarker {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -59,10 +59,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -84,10 +84,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -109,10 +109,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -134,10 +134,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -58,10 +58,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
return this;
}
/**
/**
* Get values
* @return values
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VALUES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -44,10 +44,10 @@ public class Bird {
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
public String getSize() {
@ -66,10 +66,10 @@ public class Bird {
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
public String getColor() {

View File

@ -44,10 +44,10 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
@ -66,10 +66,10 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {

View File

@ -54,10 +54,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* test suffix
* @return suffix
**/
*/
@javax.annotation.Nullable
public String getSuffix() {
@ -76,10 +76,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* Some text containing white spaces
* @return text
**/
*/
@javax.annotation.Nullable
public String getText() {
@ -98,10 +98,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* A date
* @return date
**/
*/
@javax.annotation.Nullable
public OffsetDateTime getDate() {

View File

@ -130,10 +130,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumRefDefault
* @return arrayStringEnumRefDefault
**/
*/
@javax.annotation.Nullable
public List<StringEnumRef> getArrayStringEnumRefDefault() {
@ -160,10 +160,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumDefault
* @return arrayStringEnumDefault
**/
*/
@javax.annotation.Nullable
public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {
@ -190,10 +190,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringDefault
* @return arrayStringDefault
**/
*/
@javax.annotation.Nullable
public List<String> getArrayStringDefault() {
@ -220,10 +220,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayIntegerDefault
* @return arrayIntegerDefault
**/
*/
@javax.annotation.Nullable
public List<Integer> getArrayIntegerDefault() {
@ -250,10 +250,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayString
* @return arrayString
**/
*/
@javax.annotation.Nullable
public List<String> getArrayString() {
@ -280,10 +280,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringNullable
* @return arrayStringNullable
**/
*/
@javax.annotation.Nullable
public List<String> getArrayStringNullable() {
@ -310,10 +310,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringExtensionNullable
* @return arrayStringExtensionNullable
**/
*/
@javax.annotation.Nullable
public List<String> getArrayStringExtensionNullable() {
@ -332,10 +332,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get stringNullable
* @return stringNullable
**/
*/
@javax.annotation.Nullable
public String getStringNullable() {

View File

@ -49,10 +49,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get number
* @return number
**/
*/
@javax.annotation.Nullable
public BigDecimal getNumber() {
@ -71,10 +71,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _float
* @return _float
**/
*/
@javax.annotation.Nullable
public Float getFloat() {
@ -93,12 +93,12 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _double
* minimum: 0.8
* maximum: 50.2
* @return _double
**/
*/
@javax.annotation.Nullable
public Double getDouble() {

View File

@ -114,10 +114,10 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
@ -136,10 +136,10 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nonnull
public String getName() {
@ -158,10 +158,10 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@javax.annotation.Nullable
public Category getCategory() {
@ -188,10 +188,10 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@javax.annotation.Nonnull
public List<String> getPhotoUrls() {
@ -218,10 +218,10 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@javax.annotation.Nullable
public List<Tag> getTags() {
@ -240,10 +240,10 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
**/
*/
@javax.annotation.Nullable
public StatusEnum getStatus() {

View File

@ -96,10 +96,10 @@ public class Query {
return this;
}
/**
/**
* Query
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
@ -126,10 +126,10 @@ public class Query {
return this;
}
/**
/**
* Get outcomes
* @return outcomes
**/
*/
@javax.annotation.Nullable
public List<OutcomesEnum> getOutcomes() {

View File

@ -44,10 +44,10 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
@ -66,10 +66,10 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {

View File

@ -40,10 +40,10 @@ public class TestFormObjectMultipartRequestMarker {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {

View File

@ -52,10 +52,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
public String getSize() {
@ -74,10 +74,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
public String getColor() {
@ -96,10 +96,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
@ -118,10 +118,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {

View File

@ -51,10 +51,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
return this;
}
/**
/**
* Get values
* @return values
**/
*/
@javax.annotation.Nullable
public List<String> getValues() {

View File

@ -52,14 +52,13 @@ public class Bird {
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@ -77,14 +76,13 @@ public class Bird {
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}

View File

@ -52,14 +52,13 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@ -77,14 +76,13 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}

View File

@ -60,14 +60,13 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* test suffix
* @return suffix
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SUFFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSuffix() {
return suffix;
}
@ -85,14 +84,13 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* Some text containing white spaces
* @return text
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getText() {
return text;
}
@ -110,14 +108,13 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* A date
* @return date
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Instant getDate() {
return date;
}

View File

@ -128,14 +128,13 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumRefDefault
* @return arrayStringEnumRefDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<StringEnumRef> getArrayStringEnumRefDefault() {
return arrayStringEnumRefDefault;
}
@ -161,14 +160,13 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumDefault
* @return arrayStringEnumDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {
return arrayStringEnumDefault;
}
@ -194,14 +192,13 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringDefault
* @return arrayStringDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getArrayStringDefault() {
return arrayStringDefault;
}
@ -227,14 +224,13 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayIntegerDefault
* @return arrayIntegerDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<Integer> getArrayIntegerDefault() {
return arrayIntegerDefault;
}
@ -260,14 +256,13 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayString
* @return arrayString
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getArrayString() {
return arrayString;
}
@ -297,13 +292,12 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringNullable
* @return arrayStringNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
public List<String> getArrayStringNullable() {
return arrayStringNullable.orElse(null);
}
@ -342,13 +336,12 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringExtensionNullable
* @return arrayStringExtensionNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
public List<String> getArrayStringExtensionNullable() {
return arrayStringExtensionNullable.orElse(null);
}
@ -375,13 +368,12 @@ public class DefaultValue {
return this;
}
/**
/**
* Get stringNullable
* @return stringNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
public String getStringNullable() {
return stringNullable.orElse(null);
}

View File

@ -57,14 +57,13 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get number
* @return number
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getNumber() {
return number;
}
@ -82,14 +81,13 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _float
* @return _float
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FLOAT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Float getFloat() {
return _float;
}
@ -107,16 +105,15 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _double
* minimum: 0.8
* maximum: 50.2
* @return _double
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DOUBLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Double getDouble() {
return _double;
}

View File

@ -109,14 +109,13 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@ -134,14 +133,13 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getName() {
return name;
}
@ -159,14 +157,13 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CATEGORY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Category getCategory() {
return category;
}
@ -192,14 +189,13 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List<String> getPhotoUrls() {
return photoUrls;
}
@ -225,14 +221,13 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<Tag> getTags() {
return tags;
}
@ -250,14 +245,13 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public StatusEnum getStatus() {
return status;
}

View File

@ -91,14 +91,13 @@ public class Query {
return this;
}
/**
/**
* Query
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@ -124,14 +123,13 @@ public class Query {
return this;
}
/**
/**
* Get outcomes
* @return outcomes
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_OUTCOMES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<OutcomesEnum> getOutcomes() {
return outcomes;
}

View File

@ -52,14 +52,13 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@ -77,14 +76,13 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}

View File

@ -48,14 +48,13 @@ public class TestFormObjectMultipartRequestMarker {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}

View File

@ -60,14 +60,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@ -85,14 +84,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}
@ -110,14 +108,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@ -135,14 +132,13 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}

View File

@ -58,14 +58,13 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
return this;
}
/**
/**
* Get values
* @return values
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VALUES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getValues() {
return values;
}

View File

@ -78,12 +78,12 @@ public class Category {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Category
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Category
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Category.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -129,22 +129,22 @@ public class Category {
}
}
/**
* Create an instance of Category given an JSON string
*
* @param jsonString JSON string
* @return An instance of Category
* @throws IOException if the JSON string is invalid with respect to Category
*/
/**
* Create an instance of Category given an JSON string
*
* @param jsonString JSON string
* @return An instance of Category
* @throws IOException if the JSON string is invalid with respect to Category
*/
public static Category fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Category.class);
}
/**
* Convert an instance of Category to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Category to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -78,12 +78,12 @@ public class ModelApiResponse {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ModelApiResponse
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ModelApiResponse
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ModelApiResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -129,22 +129,22 @@ public class ModelApiResponse {
}
}
/**
* Create an instance of ModelApiResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of ModelApiResponse
* @throws IOException if the JSON string is invalid with respect to ModelApiResponse
*/
/**
* Create an instance of ModelApiResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of ModelApiResponse
* @throws IOException if the JSON string is invalid with respect to ModelApiResponse
*/
public static ModelApiResponse fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ModelApiResponse.class);
}
/**
* Convert an instance of ModelApiResponse to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of ModelApiResponse to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -78,12 +78,12 @@ public class Order {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Order
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Order
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Order.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -129,22 +129,22 @@ public class Order {
}
}
/**
* Create an instance of Order given an JSON string
*
* @param jsonString JSON string
* @return An instance of Order
* @throws IOException if the JSON string is invalid with respect to Order
*/
/**
* Create an instance of Order given an JSON string
*
* @param jsonString JSON string
* @return An instance of Order
* @throws IOException if the JSON string is invalid with respect to Order
*/
public static Order fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Order.class);
}
/**
* Convert an instance of Order to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Order to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -78,12 +78,12 @@ public class Pet {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Pet
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Pet
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Pet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -129,22 +129,22 @@ public class Pet {
}
}
/**
* Create an instance of Pet given an JSON string
*
* @param jsonString JSON string
* @return An instance of Pet
* @throws IOException if the JSON string is invalid with respect to Pet
*/
/**
* Create an instance of Pet given an JSON string
*
* @param jsonString JSON string
* @return An instance of Pet
* @throws IOException if the JSON string is invalid with respect to Pet
*/
public static Pet fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Pet.class);
}
/**
* Convert an instance of Pet to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Pet to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -78,12 +78,12 @@ public class Tag {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Tag
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Tag
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -129,22 +129,22 @@ public class Tag {
}
}
/**
* Create an instance of Tag given an JSON string
*
* @param jsonString JSON string
* @return An instance of Tag
* @throws IOException if the JSON string is invalid with respect to Tag
*/
/**
* Create an instance of Tag given an JSON string
*
* @param jsonString JSON string
* @return An instance of Tag
* @throws IOException if the JSON string is invalid with respect to Tag
*/
public static Tag fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Tag.class);
}
/**
* Convert an instance of Tag to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Tag to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -78,12 +78,12 @@ public class User {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to User
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to User
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -129,22 +129,22 @@ public class User {
}
}
/**
* Create an instance of User given an JSON string
*
* @param jsonString JSON string
* @return An instance of User
* @throws IOException if the JSON string is invalid with respect to User
*/
/**
* Create an instance of User given an JSON string
*
* @param jsonString JSON string
* @return An instance of User
* @throws IOException if the JSON string is invalid with respect to User
*/
public static User fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, User.class);
}
/**
* Convert an instance of User to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of User to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -67,10 +67,10 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -86,10 +86,10 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {
return name;
@ -154,12 +154,12 @@ public class Category {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Category
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Category
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Category.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -209,22 +209,22 @@ public class Category {
}
}
/**
* Create an instance of Category given an JSON string
*
* @param jsonString JSON string
* @return An instance of Category
* @throws IOException if the JSON string is invalid with respect to Category
*/
/**
* Create an instance of Category given an JSON string
*
* @param jsonString JSON string
* @return An instance of Category
* @throws IOException if the JSON string is invalid with respect to Category
*/
public static Category fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Category.class);
}
/**
* Convert an instance of Category to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Category to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -71,10 +71,10 @@ public class ModelApiResponse {
return this;
}
/**
/**
* Get code
* @return code
**/
*/
@javax.annotation.Nullable
public Integer getCode() {
return code;
@ -90,10 +90,10 @@ public class ModelApiResponse {
return this;
}
/**
/**
* Get type
* @return type
**/
*/
@javax.annotation.Nullable
public String getType() {
return type;
@ -109,10 +109,10 @@ public class ModelApiResponse {
return this;
}
/**
/**
* Get message
* @return message
**/
*/
@javax.annotation.Nullable
public String getMessage() {
return message;
@ -180,12 +180,12 @@ public class ModelApiResponse {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ModelApiResponse
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to ModelApiResponse
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!ModelApiResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -238,22 +238,22 @@ public class ModelApiResponse {
}
}
/**
* Create an instance of ModelApiResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of ModelApiResponse
* @throws IOException if the JSON string is invalid with respect to ModelApiResponse
*/
/**
* Create an instance of ModelApiResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of ModelApiResponse
* @throws IOException if the JSON string is invalid with respect to ModelApiResponse
*/
public static ModelApiResponse fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ModelApiResponse.class);
}
/**
* Convert an instance of ModelApiResponse to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of ModelApiResponse to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -138,10 +138,10 @@ public class Order {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -157,10 +157,10 @@ public class Order {
return this;
}
/**
/**
* Get petId
* @return petId
**/
*/
@javax.annotation.Nullable
public Long getPetId() {
return petId;
@ -176,10 +176,10 @@ public class Order {
return this;
}
/**
/**
* Get quantity
* @return quantity
**/
*/
@javax.annotation.Nullable
public Integer getQuantity() {
return quantity;
@ -195,10 +195,10 @@ public class Order {
return this;
}
/**
/**
* Get shipDate
* @return shipDate
**/
*/
@javax.annotation.Nullable
public OffsetDateTime getShipDate() {
return shipDate;
@ -214,10 +214,10 @@ public class Order {
return this;
}
/**
/**
* Order Status
* @return status
**/
*/
@javax.annotation.Nullable
public StatusEnum getStatus() {
return status;
@ -233,10 +233,10 @@ public class Order {
return this;
}
/**
/**
* Get complete
* @return complete
**/
*/
@javax.annotation.Nullable
public Boolean getComplete() {
return complete;
@ -313,12 +313,12 @@ public class Order {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Order
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Order
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Order.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -372,22 +372,22 @@ public class Order {
}
}
/**
* Create an instance of Order given an JSON string
*
* @param jsonString JSON string
* @return An instance of Order
* @throws IOException if the JSON string is invalid with respect to Order
*/
/**
* Create an instance of Order given an JSON string
*
* @param jsonString JSON string
* @return An instance of Order
* @throws IOException if the JSON string is invalid with respect to Order
*/
public static Order fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Order.class);
}
/**
* Convert an instance of Order to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Order to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -142,10 +142,10 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -161,10 +161,10 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@javax.annotation.Nullable
public Category getCategory() {
return category;
@ -180,10 +180,10 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nonnull
public String getName() {
return name;
@ -207,10 +207,10 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@javax.annotation.Nonnull
public List<String> getPhotoUrls() {
return photoUrls;
@ -234,10 +234,10 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@javax.annotation.Nullable
public List<Tag> getTags() {
return tags;
@ -254,11 +254,11 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
* @deprecated
**/
*/
@Deprecated
@javax.annotation.Nullable
public StatusEnum getStatus() {
@ -339,12 +339,12 @@ public class Pet {
openapiRequiredFields.add("photoUrls");
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Pet
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Pet
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Pet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -432,22 +432,22 @@ public class Pet {
}
}
/**
* Create an instance of Pet given an JSON string
*
* @param jsonString JSON string
* @return An instance of Pet
* @throws IOException if the JSON string is invalid with respect to Pet
*/
/**
* Create an instance of Pet given an JSON string
*
* @param jsonString JSON string
* @return An instance of Pet
* @throws IOException if the JSON string is invalid with respect to Pet
*/
public static Pet fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Pet.class);
}
/**
* Convert an instance of Pet to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Pet to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -67,10 +67,10 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -86,10 +86,10 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {
return name;
@ -154,12 +154,12 @@ public class Tag {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Tag
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Tag
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -209,22 +209,22 @@ public class Tag {
}
}
/**
* Create an instance of Tag given an JSON string
*
* @param jsonString JSON string
* @return An instance of Tag
* @throws IOException if the JSON string is invalid with respect to Tag
*/
/**
* Create an instance of Tag given an JSON string
*
* @param jsonString JSON string
* @return An instance of Tag
* @throws IOException if the JSON string is invalid with respect to Tag
*/
public static Tag fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Tag.class);
}
/**
* Convert an instance of Tag to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Tag to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -91,10 +91,10 @@ public class User {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -110,10 +110,10 @@ public class User {
return this;
}
/**
/**
* Get username
* @return username
**/
*/
@javax.annotation.Nullable
public String getUsername() {
return username;
@ -129,10 +129,10 @@ public class User {
return this;
}
/**
/**
* Get firstName
* @return firstName
**/
*/
@javax.annotation.Nullable
public String getFirstName() {
return firstName;
@ -148,10 +148,10 @@ public class User {
return this;
}
/**
/**
* Get lastName
* @return lastName
**/
*/
@javax.annotation.Nullable
public String getLastName() {
return lastName;
@ -167,10 +167,10 @@ public class User {
return this;
}
/**
/**
* Get email
* @return email
**/
*/
@javax.annotation.Nullable
public String getEmail() {
return email;
@ -186,10 +186,10 @@ public class User {
return this;
}
/**
/**
* Get password
* @return password
**/
*/
@javax.annotation.Nullable
public String getPassword() {
return password;
@ -205,10 +205,10 @@ public class User {
return this;
}
/**
/**
* Get phone
* @return phone
**/
*/
@javax.annotation.Nullable
public String getPhone() {
return phone;
@ -224,10 +224,10 @@ public class User {
return this;
}
/**
/**
* User Status
* @return userStatus
**/
*/
@javax.annotation.Nullable
public Integer getUserStatus() {
return userStatus;
@ -310,12 +310,12 @@ public class User {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to User
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to User
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -380,22 +380,22 @@ public class User {
}
}
/**
* Create an instance of User given an JSON string
*
* @param jsonString JSON string
* @return An instance of User
* @throws IOException if the JSON string is invalid with respect to User
*/
/**
* Create an instance of User given an JSON string
*
* @param jsonString JSON string
* @return An instance of User
* @throws IOException if the JSON string is invalid with respect to User
*/
public static User fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, User.class);
}
/**
* Convert an instance of User to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of User to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -67,10 +67,10 @@ public class Bird {
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
public String getSize() {
return size;
@ -86,10 +86,10 @@ public class Bird {
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
public String getColor() {
return color;
@ -154,12 +154,12 @@ public class Bird {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Bird
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Bird
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Bird.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -212,22 +212,22 @@ public class Bird {
}
}
/**
* Create an instance of Bird given an JSON string
*
* @param jsonString JSON string
* @return An instance of Bird
* @throws IOException if the JSON string is invalid with respect to Bird
*/
/**
* Create an instance of Bird given an JSON string
*
* @param jsonString JSON string
* @return An instance of Bird
* @throws IOException if the JSON string is invalid with respect to Bird
*/
public static Bird fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Bird.class);
}
/**
* Convert an instance of Bird to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Bird to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -67,10 +67,10 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -86,10 +86,10 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {
return name;
@ -154,12 +154,12 @@ public class Category {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Category
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Category
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Category.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -209,22 +209,22 @@ public class Category {
}
}
/**
* Create an instance of Category given an JSON string
*
* @param jsonString JSON string
* @return An instance of Category
* @throws IOException if the JSON string is invalid with respect to Category
*/
/**
* Create an instance of Category given an JSON string
*
* @param jsonString JSON string
* @return An instance of Category
* @throws IOException if the JSON string is invalid with respect to Category
*/
public static Category fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Category.class);
}
/**
* Convert an instance of Category to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Category to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -75,10 +75,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* test suffix
* @return suffix
**/
*/
@javax.annotation.Nullable
public String getSuffix() {
return suffix;
@ -94,10 +94,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* Some text containing white spaces
* @return text
**/
*/
@javax.annotation.Nullable
public String getText() {
return text;
@ -113,10 +113,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* A date
* @return date
**/
*/
@javax.annotation.Nullable
public OffsetDateTime getDate() {
return date;
@ -188,12 +188,12 @@ public class DataQuery extends Query {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to DataQuery
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to DataQuery
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!DataQuery.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -246,22 +246,22 @@ public class DataQuery extends Query {
}
}
/**
* Create an instance of DataQuery given an JSON string
*
* @param jsonString JSON string
* @return An instance of DataQuery
* @throws IOException if the JSON string is invalid with respect to DataQuery
*/
/**
* Create an instance of DataQuery given an JSON string
*
* @param jsonString JSON string
* @return An instance of DataQuery
* @throws IOException if the JSON string is invalid with respect to DataQuery
*/
public static DataQuery fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DataQuery.class);
}
/**
* Convert an instance of DataQuery to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of DataQuery to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -157,10 +157,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumRefDefault
* @return arrayStringEnumRefDefault
**/
*/
@javax.annotation.Nullable
public List<StringEnumRef> getArrayStringEnumRefDefault() {
return arrayStringEnumRefDefault;
@ -184,10 +184,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumDefault
* @return arrayStringEnumDefault
**/
*/
@javax.annotation.Nullable
public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {
return arrayStringEnumDefault;
@ -211,10 +211,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringDefault
* @return arrayStringDefault
**/
*/
@javax.annotation.Nullable
public List<String> getArrayStringDefault() {
return arrayStringDefault;
@ -238,10 +238,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayIntegerDefault
* @return arrayIntegerDefault
**/
*/
@javax.annotation.Nullable
public List<Integer> getArrayIntegerDefault() {
return arrayIntegerDefault;
@ -265,10 +265,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayString
* @return arrayString
**/
*/
@javax.annotation.Nullable
public List<String> getArrayString() {
return arrayString;
@ -292,10 +292,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringNullable
* @return arrayStringNullable
**/
*/
@javax.annotation.Nullable
public List<String> getArrayStringNullable() {
return arrayStringNullable;
@ -319,10 +319,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringExtensionNullable
* @return arrayStringExtensionNullable
**/
*/
@javax.annotation.Nullable
public List<String> getArrayStringExtensionNullable() {
return arrayStringExtensionNullable;
@ -338,10 +338,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get stringNullable
* @return stringNullable
**/
*/
@javax.annotation.Nullable
public String getStringNullable() {
return stringNullable;
@ -435,12 +435,12 @@ public class DefaultValue {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to DefaultValue
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to DefaultValue
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!DefaultValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -518,22 +518,22 @@ public class DefaultValue {
}
}
/**
* Create an instance of DefaultValue given an JSON string
*
* @param jsonString JSON string
* @return An instance of DefaultValue
* @throws IOException if the JSON string is invalid with respect to DefaultValue
*/
/**
* Create an instance of DefaultValue given an JSON string
*
* @param jsonString JSON string
* @return An instance of DefaultValue
* @throws IOException if the JSON string is invalid with respect to DefaultValue
*/
public static DefaultValue fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, DefaultValue.class);
}
/**
* Convert an instance of DefaultValue to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of DefaultValue to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -72,10 +72,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get number
* @return number
**/
*/
@javax.annotation.Nullable
public BigDecimal getNumber() {
return number;
@ -91,10 +91,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _float
* @return _float
**/
*/
@javax.annotation.Nullable
public Float getFloat() {
return _float;
@ -110,12 +110,12 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _double
* minimum: 0.8
* maximum: 50.2
* @return _double
**/
*/
@javax.annotation.Nullable
public Double getDouble() {
return _double;
@ -183,12 +183,12 @@ public class NumberPropertiesOnly {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to NumberPropertiesOnly
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to NumberPropertiesOnly
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!NumberPropertiesOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -235,22 +235,22 @@ public class NumberPropertiesOnly {
}
}
/**
* Create an instance of NumberPropertiesOnly given an JSON string
*
* @param jsonString JSON string
* @return An instance of NumberPropertiesOnly
* @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly
*/
/**
* Create an instance of NumberPropertiesOnly given an JSON string
*
* @param jsonString JSON string
* @return An instance of NumberPropertiesOnly
* @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly
*/
public static NumberPropertiesOnly fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, NumberPropertiesOnly.class);
}
/**
* Convert an instance of NumberPropertiesOnly to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of NumberPropertiesOnly to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -141,10 +141,10 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -160,10 +160,10 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nonnull
public String getName() {
return name;
@ -179,10 +179,10 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@javax.annotation.Nullable
public Category getCategory() {
return category;
@ -206,10 +206,10 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@javax.annotation.Nonnull
public List<String> getPhotoUrls() {
return photoUrls;
@ -233,10 +233,10 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@javax.annotation.Nullable
public List<Tag> getTags() {
return tags;
@ -252,10 +252,10 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
**/
*/
@javax.annotation.Nullable
public StatusEnum getStatus() {
return status;
@ -334,12 +334,12 @@ public class Pet {
openapiRequiredFields.add("photoUrls");
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Pet
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Pet
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Pet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -427,22 +427,22 @@ public class Pet {
}
}
/**
* Create an instance of Pet given an JSON string
*
* @param jsonString JSON string
* @return An instance of Pet
* @throws IOException if the JSON string is invalid with respect to Pet
*/
/**
* Create an instance of Pet given an JSON string
*
* @param jsonString JSON string
* @return An instance of Pet
* @throws IOException if the JSON string is invalid with respect to Pet
*/
public static Pet fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Pet.class);
}
/**
* Convert an instance of Pet to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Pet to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -123,10 +123,10 @@ public class Query {
return this;
}
/**
/**
* Query
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -150,10 +150,10 @@ public class Query {
return this;
}
/**
/**
* Get outcomes
* @return outcomes
**/
*/
@javax.annotation.Nullable
public List<OutcomesEnum> getOutcomes() {
return outcomes;
@ -218,12 +218,12 @@ public class Query {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Query
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Query
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -238,22 +238,22 @@ public class Query {
}
/**
* Create an instance of Query given an JSON string
*
* @param jsonString JSON string
* @return An instance of Query
* @throws IOException if the JSON string is invalid with respect to Query
*/
/**
* Create an instance of Query given an JSON string
*
* @param jsonString JSON string
* @return An instance of Query
* @throws IOException if the JSON string is invalid with respect to Query
*/
public static Query fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Query.class);
}
/**
* Convert an instance of Query to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Query to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -67,10 +67,10 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -86,10 +86,10 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {
return name;
@ -154,12 +154,12 @@ public class Tag {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Tag
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Tag
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -209,22 +209,22 @@ public class Tag {
}
}
/**
* Create an instance of Tag given an JSON string
*
* @param jsonString JSON string
* @return An instance of Tag
* @throws IOException if the JSON string is invalid with respect to Tag
*/
/**
* Create an instance of Tag given an JSON string
*
* @param jsonString JSON string
* @return An instance of Tag
* @throws IOException if the JSON string is invalid with respect to Tag
*/
public static Tag fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Tag.class);
}
/**
* Convert an instance of Tag to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of Tag to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -63,10 +63,10 @@ public class TestFormObjectMultipartRequestMarker {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {
return name;
@ -128,12 +128,12 @@ public class TestFormObjectMultipartRequestMarker {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestFormObjectMultipartRequestMarker
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestFormObjectMultipartRequestMarker
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!TestFormObjectMultipartRequestMarker.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -183,22 +183,22 @@ public class TestFormObjectMultipartRequestMarker {
}
}
/**
* Create an instance of TestFormObjectMultipartRequestMarker given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestFormObjectMultipartRequestMarker
* @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker
*/
/**
* Create an instance of TestFormObjectMultipartRequestMarker given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestFormObjectMultipartRequestMarker
* @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker
*/
public static TestFormObjectMultipartRequestMarker fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestFormObjectMultipartRequestMarker.class);
}
/**
* Convert an instance of TestFormObjectMultipartRequestMarker to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of TestFormObjectMultipartRequestMarker to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -75,10 +75,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
public String getSize() {
return size;
@ -94,10 +94,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
public String getColor() {
return color;
@ -113,10 +113,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
public Long getId() {
return id;
@ -132,10 +132,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
public String getName() {
return name;
@ -206,12 +206,12 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -267,22 +267,22 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
}
}
/**
* Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
/**
* Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
public static TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.class);
}
/**
* Convert an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -73,10 +73,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
return this;
}
/**
/**
* Get values
* @return values
**/
*/
@javax.annotation.Nullable
public List<String> getValues() {
return values;
@ -138,12 +138,12 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
*/
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
@ -194,22 +194,22 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
}
}
/**
* Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
*/
/**
* Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter given an JSON string
*
* @param jsonString JSON string
* @return An instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
*/
public static TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.class);
}
/**
* Convert an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to an JSON string
*
* @return JSON string
*/
/**
* Convert an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}

View File

@ -47,10 +47,10 @@ public class Bird {
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -72,10 +72,10 @@ public class Bird {
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -47,10 +47,10 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -72,10 +72,10 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -57,10 +57,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* test suffix
* @return suffix
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SUFFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -82,10 +82,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* Some text containing white spaces
* @return text
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -107,10 +107,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* A date
* @return date
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -124,10 +124,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumRefDefault
* @return arrayStringEnumRefDefault
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -157,10 +157,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumDefault
* @return arrayStringEnumDefault
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -190,10 +190,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringDefault
* @return arrayStringDefault
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -223,10 +223,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayIntegerDefault
* @return arrayIntegerDefault
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -256,10 +256,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayString
* @return arrayString
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -293,10 +293,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringNullable
* @return arrayStringNullable
**/
*/
@jakarta.annotation.Nullable
@JsonIgnore
@ -338,10 +338,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringExtensionNullable
* @return arrayStringExtensionNullable
**/
*/
@jakarta.annotation.Nullable
@JsonIgnore
@ -371,10 +371,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get stringNullable
* @return stringNullable
**/
*/
@jakarta.annotation.Nullable
@JsonIgnore

View File

@ -52,10 +52,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get number
* @return number
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -77,10 +77,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _float
* @return _float
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FLOAT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -102,12 +102,12 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _double
* minimum: 0.8
* maximum: 50.2
* @return _double
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DOUBLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -105,10 +105,10 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -130,10 +130,10 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@ -155,10 +155,10 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CATEGORY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -188,10 +188,10 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@ -221,10 +221,10 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -246,10 +246,10 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -87,10 +87,10 @@ public class Query {
return this;
}
/**
/**
* Query
* @return id
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -120,10 +120,10 @@ public class Query {
return this;
}
/**
/**
* Get outcomes
* @return outcomes
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_OUTCOMES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -47,10 +47,10 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -72,10 +72,10 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -44,10 +44,10 @@ public class TestFormObjectMultipartRequestMarker {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -56,10 +56,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -81,10 +81,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -106,10 +106,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -131,10 +131,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -55,10 +55,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
return this;
}
/**
/**
* Get values
* @return values
**/
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VALUES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -47,10 +47,10 @@ public class Bird {
return this;
}
/**
/**
* Get size
* @return size
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -72,10 +72,10 @@ public class Bird {
return this;
}
/**
/**
* Get color
* @return color
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -47,10 +47,10 @@ public class Category {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -72,10 +72,10 @@ public class Category {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -57,10 +57,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* test suffix
* @return suffix
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SUFFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -82,10 +82,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* Some text containing white spaces
* @return text
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TEXT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -107,10 +107,10 @@ public class DataQuery extends Query {
return this;
}
/**
/**
* A date
* @return date
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -124,10 +124,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumRefDefault
* @return arrayStringEnumRefDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -157,10 +157,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringEnumDefault
* @return arrayStringEnumDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -190,10 +190,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringDefault
* @return arrayStringDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -223,10 +223,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayIntegerDefault
* @return arrayIntegerDefault
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -256,10 +256,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayString
* @return arrayString
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -293,10 +293,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringNullable
* @return arrayStringNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
@ -338,10 +338,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get arrayStringExtensionNullable
* @return arrayStringExtensionNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore
@ -371,10 +371,10 @@ public class DefaultValue {
return this;
}
/**
/**
* Get stringNullable
* @return stringNullable
**/
*/
@javax.annotation.Nullable
@JsonIgnore

View File

@ -52,10 +52,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get number
* @return number
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -77,10 +77,10 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _float
* @return _float
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FLOAT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -102,12 +102,12 @@ public class NumberPropertiesOnly {
return this;
}
/**
/**
* Get _double
* minimum: 0.8
* maximum: 50.2
* @return _double
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DOUBLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -105,10 +105,10 @@ public class Pet {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -130,10 +130,10 @@ public class Pet {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@ -155,10 +155,10 @@ public class Pet {
return this;
}
/**
/**
* Get category
* @return category
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CATEGORY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -188,10 +188,10 @@ public class Pet {
return this;
}
/**
/**
* Get photoUrls
* @return photoUrls
**/
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@ -221,10 +221,10 @@ public class Pet {
return this;
}
/**
/**
* Get tags
* @return tags
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -246,10 +246,10 @@ public class Pet {
return this;
}
/**
/**
* pet status in the store
* @return status
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -87,10 +87,10 @@ public class Query {
return this;
}
/**
/**
* Query
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -120,10 +120,10 @@ public class Query {
return this;
}
/**
/**
* Get outcomes
* @return outcomes
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_OUTCOMES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

View File

@ -47,10 +47,10 @@ public class Tag {
return this;
}
/**
/**
* Get id
* @return id
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@ -72,10 +72,10 @@ public class Tag {
return this;
}
/**
/**
* Get name
* @return name
**/
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

Some files were not shown because too many files have changed in this diff Show More