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:
@@ -67,10 +67,10 @@ public class Bird {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getSize() {
|
||||
return size;
|
||||
@@ -86,10 +86,10 @@ public class Bird {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getColor() {
|
||||
return color;
|
||||
@@ -154,12 +154,12 @@ public class Bird {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Bird
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Bird
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!Bird.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -212,22 +212,22 @@ public class Bird {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Bird given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Bird
|
||||
* @throws IOException if the JSON string is invalid with respect to Bird
|
||||
*/
|
||||
/**
|
||||
* Create an instance of Bird given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Bird
|
||||
* @throws IOException if the JSON string is invalid with respect to Bird
|
||||
*/
|
||||
public static Bird fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Bird.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Bird to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of Bird to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -67,10 +67,10 @@ public class Category {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -86,10 +86,10 @@ public class Category {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -154,12 +154,12 @@ public class Category {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Category
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Category
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!Category.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -209,22 +209,22 @@ public class Category {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Category given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Category
|
||||
* @throws IOException if the JSON string is invalid with respect to Category
|
||||
*/
|
||||
/**
|
||||
* Create an instance of Category given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Category
|
||||
* @throws IOException if the JSON string is invalid with respect to Category
|
||||
*/
|
||||
public static Category fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Category.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Category to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of Category to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ public class DataQuery extends Query {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* test suffix
|
||||
* @return suffix
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
@@ -94,10 +94,10 @@ public class DataQuery extends Query {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Some text containing white spaces
|
||||
* @return text
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getText() {
|
||||
return text;
|
||||
@@ -113,10 +113,10 @@ public class DataQuery extends Query {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* A date
|
||||
* @return date
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public OffsetDateTime getDate() {
|
||||
return date;
|
||||
@@ -188,12 +188,12 @@ public class DataQuery extends Query {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to DataQuery
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to DataQuery
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!DataQuery.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -246,22 +246,22 @@ public class DataQuery extends Query {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DataQuery given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DataQuery
|
||||
* @throws IOException if the JSON string is invalid with respect to DataQuery
|
||||
*/
|
||||
/**
|
||||
* Create an instance of DataQuery given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DataQuery
|
||||
* @throws IOException if the JSON string is invalid with respect to DataQuery
|
||||
*/
|
||||
public static DataQuery fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DataQuery.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DataQuery to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of DataQuery to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -157,10 +157,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayStringEnumRefDefault
|
||||
* @return arrayStringEnumRefDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<StringEnumRef> getArrayStringEnumRefDefault() {
|
||||
return arrayStringEnumRefDefault;
|
||||
@@ -184,10 +184,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayStringEnumDefault
|
||||
* @return arrayStringEnumDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<ArrayStringEnumDefaultEnum> getArrayStringEnumDefault() {
|
||||
return arrayStringEnumDefault;
|
||||
@@ -211,10 +211,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayStringDefault
|
||||
* @return arrayStringDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayStringDefault() {
|
||||
return arrayStringDefault;
|
||||
@@ -238,10 +238,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayIntegerDefault
|
||||
* @return arrayIntegerDefault
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<Integer> getArrayIntegerDefault() {
|
||||
return arrayIntegerDefault;
|
||||
@@ -265,10 +265,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayString
|
||||
* @return arrayString
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayString() {
|
||||
return arrayString;
|
||||
@@ -292,10 +292,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayStringNullable
|
||||
* @return arrayStringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayStringNullable() {
|
||||
return arrayStringNullable;
|
||||
@@ -319,10 +319,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get arrayStringExtensionNullable
|
||||
* @return arrayStringExtensionNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getArrayStringExtensionNullable() {
|
||||
return arrayStringExtensionNullable;
|
||||
@@ -338,10 +338,10 @@ public class DefaultValue {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get stringNullable
|
||||
* @return stringNullable
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getStringNullable() {
|
||||
return stringNullable;
|
||||
@@ -435,12 +435,12 @@ public class DefaultValue {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to DefaultValue
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to DefaultValue
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!DefaultValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -518,22 +518,22 @@ public class DefaultValue {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DefaultValue given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DefaultValue
|
||||
* @throws IOException if the JSON string is invalid with respect to DefaultValue
|
||||
*/
|
||||
/**
|
||||
* Create an instance of DefaultValue given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DefaultValue
|
||||
* @throws IOException if the JSON string is invalid with respect to DefaultValue
|
||||
*/
|
||||
public static DefaultValue fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DefaultValue.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DefaultValue to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of DefaultValue to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ public class NumberPropertiesOnly {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get number
|
||||
* @return number
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
@@ -91,10 +91,10 @@ public class NumberPropertiesOnly {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get _float
|
||||
* @return _float
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
@@ -110,12 +110,12 @@ public class NumberPropertiesOnly {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get _double
|
||||
* minimum: 0.8
|
||||
* maximum: 50.2
|
||||
* @return _double
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
@@ -183,12 +183,12 @@ public class NumberPropertiesOnly {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to NumberPropertiesOnly
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to NumberPropertiesOnly
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!NumberPropertiesOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -235,22 +235,22 @@ public class NumberPropertiesOnly {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of NumberPropertiesOnly given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of NumberPropertiesOnly
|
||||
* @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly
|
||||
*/
|
||||
/**
|
||||
* Create an instance of NumberPropertiesOnly given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of NumberPropertiesOnly
|
||||
* @throws IOException if the JSON string is invalid with respect to NumberPropertiesOnly
|
||||
*/
|
||||
public static NumberPropertiesOnly fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, NumberPropertiesOnly.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of NumberPropertiesOnly to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of NumberPropertiesOnly to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -141,10 +141,10 @@ public class Pet {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -160,10 +160,10 @@ public class Pet {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -179,10 +179,10 @@ public class Pet {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
@@ -206,10 +206,10 @@ public class Pet {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
@@ -233,10 +233,10 @@ public class Pet {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
@@ -252,10 +252,10 @@ public class Pet {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
@@ -334,12 +334,12 @@ public class Pet {
|
||||
openapiRequiredFields.add("photoUrls");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Pet
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Pet
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!Pet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -427,22 +427,22 @@ public class Pet {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Pet given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Pet
|
||||
* @throws IOException if the JSON string is invalid with respect to Pet
|
||||
*/
|
||||
/**
|
||||
* Create an instance of Pet given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Pet
|
||||
* @throws IOException if the JSON string is invalid with respect to Pet
|
||||
*/
|
||||
public static Pet fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Pet.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Pet to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of Pet to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@ public class Query {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Query
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -150,10 +150,10 @@ public class Query {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get outcomes
|
||||
* @return outcomes
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<OutcomesEnum> getOutcomes() {
|
||||
return outcomes;
|
||||
@@ -218,12 +218,12 @@ public class Query {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Query
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Query
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -238,22 +238,22 @@ public class Query {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance of Query given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Query
|
||||
* @throws IOException if the JSON string is invalid with respect to Query
|
||||
*/
|
||||
/**
|
||||
* Create an instance of Query given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Query
|
||||
* @throws IOException if the JSON string is invalid with respect to Query
|
||||
*/
|
||||
public static Query fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Query.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Query to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of Query to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -67,10 +67,10 @@ public class Tag {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -86,10 +86,10 @@ public class Tag {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -154,12 +154,12 @@ public class Tag {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Tag
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to Tag
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -209,22 +209,22 @@ public class Tag {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Tag given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Tag
|
||||
* @throws IOException if the JSON string is invalid with respect to Tag
|
||||
*/
|
||||
/**
|
||||
* Create an instance of Tag given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Tag
|
||||
* @throws IOException if the JSON string is invalid with respect to Tag
|
||||
*/
|
||||
public static Tag fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Tag.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Tag to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of Tag to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -63,10 +63,10 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -128,12 +128,12 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to TestFormObjectMultipartRequestMarker
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to TestFormObjectMultipartRequestMarker
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!TestFormObjectMultipartRequestMarker.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -183,22 +183,22 @@ public class TestFormObjectMultipartRequestMarker {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of TestFormObjectMultipartRequestMarker given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of TestFormObjectMultipartRequestMarker
|
||||
* @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker
|
||||
*/
|
||||
/**
|
||||
* Create an instance of TestFormObjectMultipartRequestMarker given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of TestFormObjectMultipartRequestMarker
|
||||
* @throws IOException if the JSON string is invalid with respect to TestFormObjectMultipartRequestMarker
|
||||
*/
|
||||
public static TestFormObjectMultipartRequestMarker fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, TestFormObjectMultipartRequestMarker.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of TestFormObjectMultipartRequestMarker to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of TestFormObjectMultipartRequestMarker to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get size
|
||||
* @return size
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getSize() {
|
||||
return size;
|
||||
@@ -94,10 +94,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getColor() {
|
||||
return color;
|
||||
@@ -113,10 +113,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -132,10 +132,10 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -206,12 +206,12 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -267,22 +267,22 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
/**
|
||||
* Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
public static TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
@@ -73,10 +73,10 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get values
|
||||
* @return values
|
||||
**/
|
||||
*/
|
||||
@javax.annotation.Nullable
|
||||
public List<String> getValues() {
|
||||
return values;
|
||||
@@ -138,12 +138,12 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
*/
|
||||
/**
|
||||
* Validates the JSON Element and throws an exception if issues found
|
||||
*
|
||||
* @param jsonElement JSON Element
|
||||
* @throws IOException if the JSON Element is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
*/
|
||||
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
|
||||
if (jsonElement == null) {
|
||||
if (!TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
|
||||
@@ -194,22 +194,22 @@ public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
*/
|
||||
/**
|
||||
* Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
* @throws IOException if the JSON string is invalid with respect to TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
*/
|
||||
public static TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
/**
|
||||
* Convert an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user