forked from loafle/openapi-generator-original
[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:
parent
13facdaab5
commit
642b1a3a95
@ -7,14 +7,8 @@
|
||||
@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}}
|
||||
@JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#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}})
|
||||
@JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}})
|
||||
{{/isContainer}}
|
||||
{{/withXml}}
|
@ -47,24 +47,11 @@ 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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{^isXmlAttribute}}
|
||||
{{#isDateTime}}
|
||||
@XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class)
|
||||
{{/isDateTime}}
|
||||
@ -198,7 +185,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#deprecated}}
|
||||
* @deprecated
|
||||
{{/deprecated}}
|
||||
**/
|
||||
*/
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
|
@ -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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{/isXmlAttribute}}
|
||||
{{/withXml}}
|
||||
{{#gson}}
|
||||
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
|
||||
@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#deprecated}}
|
||||
* @deprecated
|
||||
{{/deprecated}}
|
||||
**/
|
||||
*/
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
|
@ -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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{/isXmlAttribute}}
|
||||
{{/withXml}}
|
||||
{{#gson}}
|
||||
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
|
||||
@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#deprecated}}
|
||||
* @deprecated
|
||||
{{/deprecated}}
|
||||
**/
|
||||
*/
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
|
@ -1,10 +1,9 @@
|
||||
{{#withXml}}
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
{{#hasVars}}@XmlType(name = "{{classname}}", propOrder =
|
||||
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}}
|
||||
}){{/hasVars}}
|
||||
{ {{#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}}
|
||||
@ -113,7 +115,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
|
||||
{{^isReadOnly}}
|
||||
/**
|
||||
* 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}};
|
||||
@ -149,7 +151,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{/isXmlAttribute}}
|
||||
{{/withXml}}
|
||||
{{#gson}}
|
||||
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
|
||||
@ -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) {
|
||||
|
@ -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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{/isXmlAttribute}}
|
||||
{{/withXml}}
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
@ -165,7 +150,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#deprecated}}
|
||||
* @deprecated
|
||||
{{/deprecated}}
|
||||
**/
|
||||
*/
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
|
@ -52,24 +52,11 @@ 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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{^isXmlAttribute}}
|
||||
{{#isDateTime}}
|
||||
@XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class)
|
||||
{{/isDateTime}}
|
||||
@ -219,7 +206,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#deprecated}}
|
||||
* @deprecated
|
||||
{{/deprecated}}
|
||||
**/
|
||||
*/
|
||||
{{#deprecated}}
|
||||
@Deprecated
|
||||
{{/deprecated}}
|
||||
|
@ -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}}
|
||||
|
@ -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}}
|
||||
|
@ -3,5 +3,4 @@
|
||||
@JacksonXmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
{{/jackson}}
|
||||
@XmlRootElement({{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
{{/withXml}}
|
||||
@XmlAccessorType(XmlAccessType.FIELD){{/withXml}}
|
@ -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}}
|
@ -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}}
|
@ -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}}
|
||||
|
@ -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}}
|
||||
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{#isXmlWrapped}}
|
||||
@XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
|
||||
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
|
||||
{{/isXmlWrapped}}
|
||||
{{/isContainer}}
|
||||
{{/isXmlAttribute}}
|
||||
{{/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}}}")
|
||||
|
@ -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}}
|
||||
|
@ -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}}")
|
||||
@ -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}}
|
||||
|
@ -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\""));
|
||||
}
|
||||
}
|
||||
|
@ -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\""));
|
||||
}
|
||||
}
|
@ -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\""));
|
||||
}
|
||||
}
|
@ -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\""));
|
||||
}
|
||||
}
|
||||
|
@ -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\""));
|
||||
}
|
||||
}
|
@ -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'
|
@ -1485,10 +1485,11 @@ components:
|
||||
photoUrls:
|
||||
type: array
|
||||
xml:
|
||||
name: photoUrl
|
||||
wrapped: true
|
||||
items:
|
||||
type: string
|
||||
xml:
|
||||
name: photoUrl
|
||||
uniqueItems: true
|
||||
tags:
|
||||
type: array
|
||||
|
@ -53,7 +53,7 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -78,7 +78,7 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -53,7 +53,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -78,7 +78,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -63,7 +63,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -88,7 +88,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -113,7 +113,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -130,7 +130,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -163,7 +163,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -196,7 +196,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -229,7 +229,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -262,7 +262,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -299,7 +299,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -344,7 +344,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -377,7 +377,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -83,7 +83,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -110,7 +110,7 @@ public class NumberPropertiesOnly {
|
||||
* minimum: 0.8
|
||||
* maximum: 50.2
|
||||
* @return _double
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DOUBLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -111,7 +111,7 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -136,7 +136,7 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
@ -161,7 +161,7 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_CATEGORY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -194,7 +194,7 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
@ -227,7 +227,7 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TAGS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -252,7 +252,7 @@ public class Pet {
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -93,7 +93,7 @@ public class Query {
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -126,7 +126,7 @@ public class Query {
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -53,7 +53,7 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -78,7 +78,7 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -62,7 +62,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -87,7 +87,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -112,7 +112,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -137,7 +137,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -61,7 +61,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_VALUES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -47,7 +47,7 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSize() {
|
||||
@ -69,7 +69,7 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getColor() {
|
||||
|
@ -47,7 +47,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
@ -69,7 +69,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getName() {
|
||||
|
@ -57,7 +57,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSuffix() {
|
||||
@ -79,7 +79,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getText() {
|
||||
@ -101,7 +101,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public OffsetDateTime getDate() {
|
||||
|
@ -133,7 +133,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<StringEnumRef> getArrayStringEnumRefDefault() {
|
||||
@ -163,7 +163,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {
|
||||
@ -193,7 +193,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<String> getArrayStringDefault() {
|
||||
@ -223,7 +223,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<Integer> getArrayIntegerDefault() {
|
||||
@ -253,7 +253,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<String> getArrayString() {
|
||||
@ -283,7 +283,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<String> getArrayStringNullable() {
|
||||
@ -313,7 +313,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<String> getArrayStringExtensionNullable() {
|
||||
@ -335,7 +335,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getStringNullable() {
|
||||
|
@ -52,7 +52,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public BigDecimal getNumber() {
|
||||
@ -74,7 +74,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Float getFloat() {
|
||||
@ -98,7 +98,7 @@ public class NumberPropertiesOnly {
|
||||
* minimum: 0.8
|
||||
* maximum: 50.2
|
||||
* @return _double
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Double getDouble() {
|
||||
|
@ -117,7 +117,7 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
@ -139,7 +139,7 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
|
||||
public String getName() {
|
||||
@ -161,7 +161,7 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Category getCategory() {
|
||||
@ -191,7 +191,7 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
@ -221,7 +221,7 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<Tag> getTags() {
|
||||
@ -243,7 +243,7 @@ public class Pet {
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
|
@ -99,7 +99,7 @@ public class Query {
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
@ -129,7 +129,7 @@ public class Query {
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
|
@ -47,7 +47,7 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
@ -69,7 +69,7 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getName() {
|
||||
|
@ -43,7 +43,7 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getName() {
|
||||
|
@ -55,7 +55,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getSize() {
|
||||
@ -77,7 +77,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getColor() {
|
||||
@ -99,7 +99,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public Long getId() {
|
||||
@ -121,7 +121,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public String getName() {
|
||||
|
@ -54,7 +54,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
|
||||
public List<String> getValues() {
|
||||
|
@ -55,11 +55,10 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
@ -80,11 +79,10 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
@ -55,11 +55,10 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -80,11 +79,10 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -63,11 +63,10 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
@ -88,11 +87,10 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@ -113,11 +111,10 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Instant getDate() {
|
||||
return date;
|
||||
}
|
||||
|
@ -131,11 +131,10 @@ public class DefaultValue {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@ -164,11 +163,10 @@ public class DefaultValue {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@ -197,11 +195,10 @@ public class DefaultValue {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@ -230,11 +227,10 @@ public class DefaultValue {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@ -263,11 +259,10 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<String> getArrayString() {
|
||||
return arrayString;
|
||||
}
|
||||
@ -300,10 +295,9 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
public List<String> getArrayStringNullable() {
|
||||
return arrayStringNullable.orElse(null);
|
||||
}
|
||||
@ -345,10 +339,9 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
public List<String> getArrayStringExtensionNullable() {
|
||||
return arrayStringExtensionNullable.orElse(null);
|
||||
}
|
||||
@ -378,10 +371,9 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
public String getStringNullable() {
|
||||
return stringNullable.orElse(null);
|
||||
}
|
||||
|
@ -60,11 +60,10 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
@ -85,11 +84,10 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
@ -112,11 +110,10 @@ public class NumberPropertiesOnly {
|
||||
* 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;
|
||||
}
|
||||
|
@ -112,11 +112,10 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -137,11 +136,10 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -162,11 +160,10 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_CATEGORY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -195,11 +192,10 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -228,11 +224,10 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TAGS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -253,11 +248,10 @@ public class Pet {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
@ -94,11 +94,10 @@ public class Query {
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -127,11 +126,10 @@ public class Query {
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
}
|
||||
|
@ -55,11 +55,10 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -80,11 +79,10 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -51,11 +51,10 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -63,11 +63,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
@ -88,11 +87,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
@ -113,11 +111,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -138,11 +135,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -61,11 +61,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_VALUES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<String> getValues() {
|
||||
return values;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -89,7 +89,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -74,7 +74,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
@ -93,7 +93,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getType() {
|
||||
return type;
|
||||
@ -112,7 +112,7 @@ public class ModelApiResponse {
|
||||
/**
|
||||
* Get message
|
||||
* @return message
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getMessage() {
|
||||
return message;
|
||||
|
@ -141,7 +141,7 @@ public class Order {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -160,7 +160,7 @@ public class Order {
|
||||
/**
|
||||
* Get petId
|
||||
* @return petId
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
@ -179,7 +179,7 @@ public class Order {
|
||||
/**
|
||||
* Get quantity
|
||||
* @return quantity
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
@ -198,7 +198,7 @@ public class Order {
|
||||
/**
|
||||
* Get shipDate
|
||||
* @return shipDate
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
@ -217,7 +217,7 @@ public class Order {
|
||||
/**
|
||||
* Order Status
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
@ -236,7 +236,7 @@ public class Order {
|
||||
/**
|
||||
* Get complete
|
||||
* @return complete
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
|
@ -145,7 +145,7 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -164,7 +164,7 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
@ -183,7 +183,7 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public String getName() {
|
||||
return name;
|
||||
@ -210,7 +210,7 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
@ -237,7 +237,7 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
@ -258,7 +258,7 @@ public class Pet {
|
||||
* pet status in the store
|
||||
* @return status
|
||||
* @deprecated
|
||||
**/
|
||||
*/
|
||||
@Deprecated
|
||||
@javax.annotation.Nullable
|
||||
public StatusEnum getStatus() {
|
||||
|
@ -70,7 +70,7 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -89,7 +89,7 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -94,7 +94,7 @@ public class User {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -113,7 +113,7 @@ public class User {
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getUsername() {
|
||||
return username;
|
||||
@ -132,7 +132,7 @@ public class User {
|
||||
/**
|
||||
* Get firstName
|
||||
* @return firstName
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
@ -151,7 +151,7 @@ public class User {
|
||||
/**
|
||||
* Get lastName
|
||||
* @return lastName
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
@ -170,7 +170,7 @@ public class User {
|
||||
/**
|
||||
* Get email
|
||||
* @return email
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getEmail() {
|
||||
return email;
|
||||
@ -189,7 +189,7 @@ public class User {
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getPassword() {
|
||||
return password;
|
||||
@ -208,7 +208,7 @@ public class User {
|
||||
/**
|
||||
* Get phone
|
||||
* @return phone
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
@ -227,7 +227,7 @@ public class User {
|
||||
/**
|
||||
* User Status
|
||||
* @return userStatus
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
|
@ -70,7 +70,7 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getSize() {
|
||||
return size;
|
||||
@ -89,7 +89,7 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getColor() {
|
||||
return color;
|
||||
|
@ -70,7 +70,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -89,7 +89,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -78,7 +78,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
@ -97,7 +97,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getText() {
|
||||
return text;
|
||||
@ -116,7 +116,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
|
@ -160,7 +160,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<StringEnumRef> getArrayStringEnumRefDefault() {
|
||||
return arrayStringEnumRefDefault;
|
||||
@ -187,7 +187,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {
|
||||
return arrayStringEnumDefault;
|
||||
@ -214,7 +214,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayStringDefault() {
|
||||
return arrayStringDefault;
|
||||
@ -241,7 +241,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<Integer> getArrayIntegerDefault() {
|
||||
return arrayIntegerDefault;
|
||||
@ -268,7 +268,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayString() {
|
||||
return arrayString;
|
||||
@ -295,7 +295,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayStringNullable() {
|
||||
return arrayStringNullable;
|
||||
@ -322,7 +322,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayStringExtensionNullable() {
|
||||
return arrayStringExtensionNullable;
|
||||
@ -341,7 +341,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getStringNullable() {
|
||||
return stringNullable;
|
||||
|
@ -75,7 +75,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
@ -94,7 +94,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
@ -115,7 +115,7 @@ public class NumberPropertiesOnly {
|
||||
* minimum: 0.8
|
||||
* maximum: 50.2
|
||||
* @return _double
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
|
@ -144,7 +144,7 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -163,7 +163,7 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public String getName() {
|
||||
return name;
|
||||
@ -182,7 +182,7 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
@ -209,7 +209,7 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
@ -236,7 +236,7 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
@ -255,7 +255,7 @@ public class Pet {
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
|
@ -126,7 +126,7 @@ public class Query {
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -153,7 +153,7 @@ public class Query {
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
|
@ -70,7 +70,7 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -89,7 +89,7 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -66,7 +66,7 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -78,7 +78,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getSize() {
|
||||
return size;
|
||||
@ -97,7 +97,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getColor() {
|
||||
return color;
|
||||
@ -116,7 +116,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@ -135,7 +135,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
|
@ -76,7 +76,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getValues() {
|
||||
return values;
|
||||
|
@ -50,7 +50,7 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -60,7 +60,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -85,7 +85,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -110,7 +110,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -127,7 +127,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -160,7 +160,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -193,7 +193,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -226,7 +226,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -259,7 +259,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -296,7 +296,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -341,7 +341,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -374,7 +374,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -80,7 +80,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -107,7 +107,7 @@ public class NumberPropertiesOnly {
|
||||
* minimum: 0.8
|
||||
* maximum: 50.2
|
||||
* @return _double
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DOUBLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -108,7 +108,7 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -133,7 +133,7 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
@ -158,7 +158,7 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_CATEGORY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -191,7 +191,7 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
@ -224,7 +224,7 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TAGS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -249,7 +249,7 @@ public class Pet {
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -90,7 +90,7 @@ public class Query {
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -123,7 +123,7 @@ public class Query {
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -47,7 +47,7 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -59,7 +59,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -84,7 +84,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -109,7 +109,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -134,7 +134,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -58,7 +58,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_VALUES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -60,7 +60,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -85,7 +85,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -110,7 +110,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -127,7 +127,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -160,7 +160,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -193,7 +193,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -226,7 +226,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -259,7 +259,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -296,7 +296,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -341,7 +341,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -374,7 +374,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -80,7 +80,7 @@ public class NumberPropertiesOnly {
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -107,7 +107,7 @@ public class NumberPropertiesOnly {
|
||||
* minimum: 0.8
|
||||
* maximum: 50.2
|
||||
* @return _double
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DOUBLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -108,7 +108,7 @@ public class Pet {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -133,7 +133,7 @@ public class Pet {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
@ -158,7 +158,7 @@ public class Pet {
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_CATEGORY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -191,7 +191,7 @@ public class Pet {
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
@ -224,7 +224,7 @@ public class Pet {
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TAGS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -249,7 +249,7 @@ public class Pet {
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -90,7 +90,7 @@ public class Query {
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -123,7 +123,7 @@ public class Query {
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_OUTCOMES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Tag {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Tag {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -47,7 +47,7 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -59,7 +59,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -84,7 +84,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -109,7 +109,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -134,7 +134,7 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -58,7 +58,7 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_VALUES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Bird {
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SIZE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Bird {
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -50,7 +50,7 @@ public class Category {
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -75,7 +75,7 @@ public class Category {
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -60,7 +60,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SUFFIX)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -85,7 +85,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_TEXT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -110,7 +110,7 @@ public class DataQuery extends Query {
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
@ -127,7 +127,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -160,7 +160,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -193,7 +193,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -226,7 +226,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -259,7 +259,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
@ -296,7 +296,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -341,7 +341,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
@ -374,7 +374,7 @@ public class DefaultValue {
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
@JsonIgnore
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user