From 6ae61e2dfd92dd2d2ec61c991e93669cb99b776d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 9 May 2020 22:03:32 +0800 Subject: [PATCH] update java inflector samples --- .../java-inflector/.openapi-generator/VERSION | 2 +- .../petstore/java-inflector/inflector.yaml | 25 +- .../model/AdditionalPropertiesAnyType.java | 76 + .../model/AdditionalPropertiesArray.java | 77 + .../model/AdditionalPropertiesBoolean.java | 76 + .../model/AdditionalPropertiesClass.java | 245 ++- .../model/AdditionalPropertiesInteger.java | 76 + .../model/AdditionalPropertiesNumber.java | 77 + .../model/AdditionalPropertiesObject.java | 76 + .../model/AdditionalPropertiesString.java | 76 + .../java/org/openapitools/model/Animal.java | 2 +- .../java/org/openapitools/model/BigCat.java | 112 ++ .../org/openapitools/model/BigCatAllOf.java | 110 ++ .../openapitools/model/Capitalization.java | 12 +- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 74 + .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 2 +- .../java/org/openapitools/model/Client.java | 2 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 74 + .../org/openapitools/model/EnumArrays.java | 6 +- .../org/openapitools/model/EnumClass.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 18 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 54 +- .../openapitools/model/HasOnlyReadOnly.java | 4 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../openapitools/model/Model200Response.java | 4 +- .../openapitools/model/ModelApiResponse.java | 6 +- .../org/openapitools/model/ModelReturn.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 8 +- .../org/openapitools/model/NumberOnly.java | 2 +- .../java/org/openapitools/model/Order.java | 12 +- .../openapitools/model/OuterComposite.java | 6 +- .../org/openapitools/model/OuterEnum.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 10 +- .../org/openapitools/model/ReadOnlyFirst.java | 4 +- .../openapitools/model/SpecialModelName.java | 2 +- .../gen/java/org/openapitools/model/Tag.java | 4 +- .../openapitools/model/TypeHolderDefault.java | 165 ++ .../openapitools/model/TypeHolderExample.java | 187 +++ .../gen/java/org/openapitools/model/User.java | 16 +- .../java/org/openapitools/model/XmlItem.java | 693 +++++++++ .../controllers/AnotherFakeController.java | 2 +- .../FakeClassnameTestController.java | 2 +- .../controllers/FakeController.java | 29 +- .../controllers/PetController.java | 4 +- .../controllers/StoreController.java | 2 +- .../controllers/UserController.java | 8 +- .../src/main/openapi/openapi.yaml | 1355 ++++++++++++----- 52 files changed, 3279 insertions(+), 553 deletions(-) create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java create mode 100644 samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java diff --git a/samples/server/petstore/java-inflector/.openapi-generator/VERSION b/samples/server/petstore/java-inflector/.openapi-generator/VERSION index dde25ef08e8..d99e7162d01 100644 --- a/samples/server/petstore/java-inflector/.openapi-generator/VERSION +++ b/samples/server/petstore/java-inflector/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/inflector.yaml b/samples/server/petstore/java-inflector/inflector.yaml index fb8fb9cd90b..c75f4fce185 100644 --- a/samples/server/petstore/java-inflector/inflector.yaml +++ b/samples/server/petstore/java-inflector/inflector.yaml @@ -1,24 +1,35 @@ controllerPackage: org.openapitools.controllers modelPackage: org.openapitools.model -swaggerUrl: ./src/main/swagger/swagger.yaml +swaggerUrl: ./src/main/openapi/openapi.yaml modelMappings: # to enable explicit mappings, use this syntax: DefinitionFromSwaggerSpecification: fully.qualified.path.to.Model - AdditionalPropertiesClass : org.openapitools.model.AdditionalPropertiesClass + AdditionalPropertiesAnyType : org.openapitools.model.AdditionalPropertiesAnyType +AdditionalPropertiesArray : org.openapitools.model.AdditionalPropertiesArray +AdditionalPropertiesBoolean : org.openapitools.model.AdditionalPropertiesBoolean +AdditionalPropertiesClass : org.openapitools.model.AdditionalPropertiesClass +AdditionalPropertiesInteger : org.openapitools.model.AdditionalPropertiesInteger +AdditionalPropertiesNumber : org.openapitools.model.AdditionalPropertiesNumber +AdditionalPropertiesObject : org.openapitools.model.AdditionalPropertiesObject +AdditionalPropertiesString : org.openapitools.model.AdditionalPropertiesString Animal : org.openapitools.model.Animal -AnimalFarm : org.openapitools.model.AnimalFarm ArrayOfArrayOfNumberOnly : org.openapitools.model.ArrayOfArrayOfNumberOnly ArrayOfNumberOnly : org.openapitools.model.ArrayOfNumberOnly ArrayTest : org.openapitools.model.ArrayTest +BigCat : org.openapitools.model.BigCat +BigCatAllOf : org.openapitools.model.BigCatAllOf Capitalization : org.openapitools.model.Capitalization Cat : org.openapitools.model.Cat +CatAllOf : org.openapitools.model.CatAllOf Category : org.openapitools.model.Category ClassModel : org.openapitools.model.ClassModel Client : org.openapitools.model.Client Dog : org.openapitools.model.Dog +DogAllOf : org.openapitools.model.DogAllOf EnumArrays : org.openapitools.model.EnumArrays EnumClass : org.openapitools.model.EnumClass EnumTest : org.openapitools.model.EnumTest +FileSchemaTestClass : org.openapitools.model.FileSchemaTestClass FormatTest : org.openapitools.model.FormatTest HasOnlyReadOnly : org.openapitools.model.HasOnlyReadOnly MapTest : org.openapitools.model.MapTest @@ -29,18 +40,18 @@ ModelReturn : org.openapitools.model.ModelReturn Name : org.openapitools.model.Name NumberOnly : org.openapitools.model.NumberOnly Order : org.openapitools.model.Order -OuterBoolean : org.openapitools.model.OuterBoolean OuterComposite : org.openapitools.model.OuterComposite OuterEnum : org.openapitools.model.OuterEnum -OuterNumber : org.openapitools.model.OuterNumber -OuterString : org.openapitools.model.OuterString Pet : org.openapitools.model.Pet ReadOnlyFirst : org.openapitools.model.ReadOnlyFirst SpecialModelName : org.openapitools.model.SpecialModelName Tag : org.openapitools.model.Tag +TypeHolderDefault : org.openapitools.model.TypeHolderDefault +TypeHolderExample : org.openapitools.model.TypeHolderExample User : org.openapitools.model.User +XmlItem : org.openapitools.model.XmlItem entityProcessors: - json - xml - - yaml \ No newline at end of file + - yaml diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java new file mode 100644 index 00000000000..87b408f8664 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(name, additionalPropertiesAnyType.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java new file mode 100644 index 00000000000..a59423124b2 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -0,0 +1,77 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + + + + + +public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(name, additionalPropertiesArray.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java new file mode 100644 index 00000000000..03d6f1e0eba --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(name, additionalPropertiesBoolean.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index f9d5285bb6e..5485142beac 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -15,44 +16,224 @@ import java.util.Map; public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; + @JsonProperty("map_string") + private Map mapString = null; - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; + @JsonProperty("map_number") + private Map mapNumber = null; + + @JsonProperty("map_integer") + private Map mapInteger = null; + + @JsonProperty("map_boolean") + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1; + + @JsonProperty("anytype_2") + private Object anytype2; + + @JsonProperty("anytype_3") + private Object anytype3; /** **/ - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_property") - public Map getMapProperty() { - return mapProperty; + @JsonProperty("map_string") + public Map getMapString() { + return mapString; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setMapString(Map mapString) { + this.mapString = mapString; } /** **/ - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_of_map_property") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + @JsonProperty("map_number") + public Map getMapNumber() { + return mapNumber; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + /** + **/ + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_integer") + public Map getMapInteger() { + return mapInteger; + } + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_boolean") + public Map getMapBoolean() { + return mapBoolean; + } + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + /** + **/ + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_string") + public Map> getMapMapString() { + return mapMapString; + } + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + /** + **/ + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + /** + **/ + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_1") + public Object getAnytype1() { + return anytype1; + } + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + /** + **/ + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_2") + public Object getAnytype2() { + return anytype2; + } + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + /** + **/ + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_3") + public Object getAnytype3() { + return anytype3; + } + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -65,13 +246,22 @@ public class AdditionalPropertiesClass { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapString, additionalPropertiesClass.mapString) && + Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @Override @@ -79,8 +269,17 @@ public class AdditionalPropertiesClass { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java new file mode 100644 index 00000000000..7b2e3d212fb --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(name, additionalPropertiesInteger.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java new file mode 100644 index 00000000000..1a8fd4dc632 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -0,0 +1,77 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(name, additionalPropertiesNumber.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java new file mode 100644 index 00000000000..e298a87806f --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(name, additionalPropertiesObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java new file mode 100644 index 00000000000..7d557665eb6 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -0,0 +1,76 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; + + + + + + +public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") + private String name; + + /** + **/ + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(name, additionalPropertiesString.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java index dd9447b5ebe..bfcf5486f24 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java @@ -15,7 +15,7 @@ import io.swagger.annotations.ApiModelProperty; public class Animal { @JsonProperty("className") - private String className = null; + private String className; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 00000000000..76012471aee --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,112 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; + + + + + + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + /** + **/ + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(kind, bigCat.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 00000000000..e52cd7567fe --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + /** + **/ + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java index 02af8353e58..5ac9b3add79 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java @@ -13,22 +13,22 @@ import io.swagger.annotations.ApiModelProperty; public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel = null; + private String smallCamel; @JsonProperty("CapitalCamel") - private String capitalCamel = null; + private String capitalCamel; @JsonProperty("small_Snake") - private String smallSnake = null; + private String smallSnake; @JsonProperty("Capital_Snake") - private String capitalSnake = null; + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") - private String ATT_NAME = null; + private String ATT_NAME; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java index 5335d698a8b..c8a9293aba9 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; @@ -14,7 +15,7 @@ import org.openapitools.model.Animal; public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed = null; + private Boolean declawed; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java new file mode 100644 index 00000000000..80e67fbfdf7 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/CatAllOf.java @@ -0,0 +1,74 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + + +public class CatAllOf { + @JsonProperty("declawed") + private Boolean declawed; + + /** + **/ + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java index 873014460b2..fe52381c093 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java @@ -13,10 +13,10 @@ import io.swagger.annotations.ApiModelProperty; public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name = "default-name"; /** **/ @@ -43,7 +43,7 @@ public class Category { } - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java index d01849217ed..ca34fbd2017 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java @@ -16,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty; public class ClassModel { @JsonProperty("_class") - private String propertyClass = null; + private String propertyClass; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java index 9e2392899fa..a1838210b47 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; public class Client { @JsonProperty("client") - private String client = null; + private String client; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java index 3cc5ac3dad5..9198fef58d5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; @@ -14,7 +15,7 @@ import org.openapitools.model.Animal; public class Dog extends Animal { @JsonProperty("breed") - private String breed = null; + private String breed; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java new file mode 100644 index 00000000000..16c0b0451f5 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/DogAllOf.java @@ -0,0 +1,74 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + + + + + + +public class DogAllOf { + @JsonProperty("breed") + private String breed; + + /** + **/ + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("breed") + public String getBreed() { + return breed; + } + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java index e53b95e708f..56b5ce98e14 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java @@ -42,12 +42,12 @@ public class EnumArrays { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; + private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum @@ -76,7 +76,7 @@ public class EnumArrays { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java index 04b4b96e163..c0e2beefb8a 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java @@ -37,7 +37,7 @@ public enum EnumClass { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java index c3aa4764bd0..4c3d4a46380 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java @@ -43,12 +43,12 @@ public class EnumTest { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_string") - private EnumStringEnum enumString = null; + private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired @@ -79,12 +79,12 @@ public class EnumTest { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; + private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger @@ -113,12 +113,12 @@ public class EnumTest { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; + private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber @@ -147,15 +147,15 @@ public class EnumTest { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; + private OuterEnum outerEnum; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index c02bc42218b..2c58dcd8788 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,7 +15,7 @@ import java.util.List; public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") private List files = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java index b755b19fda8..c962633574c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java @@ -17,43 +17,46 @@ import java.util.UUID; public class FormatTest { @JsonProperty("integer") - private Integer integer = null; + private Integer integer; @JsonProperty("int32") - private Integer int32 = null; + private Integer int32; @JsonProperty("int64") - private Long int64 = null; + private Long int64; @JsonProperty("number") - private BigDecimal number = null; + private BigDecimal number; @JsonProperty("float") - private Float _float = null; + private Float _float; @JsonProperty("double") - private Double _double = null; + private Double _double; @JsonProperty("string") - private String string = null; + private String string; @JsonProperty("byte") - private byte[] _byte = null; + private byte[] _byte; @JsonProperty("binary") - private File binary = null; + private File binary; @JsonProperty("date") - private Date date = null; + private Date date; @JsonProperty("dateTime") - private Date dateTime = null; + private Date dateTime; @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("password") - private String password = null; + private String password; + + @JsonProperty("BigDecimal") + private BigDecimal bigDecimal; /** * minimum: 10 @@ -260,7 +263,7 @@ public class FormatTest { } - @ApiModelProperty(value = "") + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -286,6 +289,23 @@ public class FormatTest { this.password = password; } + /** + **/ + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + @Override public boolean equals(java.lang.Object o) { @@ -308,12 +328,13 @@ public class FormatTest { Objects.equals(date, formatTest.date) && Objects.equals(dateTime, formatTest.dateTime) && Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); + Objects.equals(password, formatTest.password) && + Objects.equals(bigDecimal, formatTest.bigDecimal); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } @Override @@ -334,6 +355,7 @@ public class FormatTest { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 7dce1117eb1..b3c40ffb503 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,10 +13,10 @@ import io.swagger.annotations.ApiModelProperty; public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("foo") - private String foo = null; + private String foo; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java index 2ba14f914eb..7f22d852e3c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; @@ -47,7 +46,7 @@ public class MapTest { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @@ -58,7 +57,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; /** **/ @@ -113,7 +112,7 @@ public class MapTest { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -121,10 +120,10 @@ public class MapTest { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1a09fa8a7f2..24b4ef0e1e7 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -19,10 +19,10 @@ import org.openapitools.model.Animal; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("dateTime") - private Date dateTime = null; + private Date dateTime; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java index 84f8223b804..d2bb5453737 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,10 +16,10 @@ import io.swagger.annotations.ApiModelProperty; public class Model200Response { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("class") - private String propertyClass = null; + private String propertyClass; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java index 9e77e3f7d0d..b711cae39dd 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,13 @@ import io.swagger.annotations.ApiModelProperty; public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java index 5e768ccc566..990b7b9a36d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,7 +16,7 @@ import io.swagger.annotations.ApiModelProperty; public class ModelReturn { @JsonProperty("return") - private Integer _return = null; + private Integer _return; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java index 5ec8687a8ba..e96e805ba3c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java @@ -16,16 +16,16 @@ import io.swagger.annotations.ApiModelProperty; public class Name { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("snake_case") - private Integer snakeCase = null; + private Integer snakeCase; @JsonProperty("property") - private String property = null; + private String property; @JsonProperty("123Number") - private Integer _123number = null; + private Integer _123number; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java index 24389e9446e..8bb6fd8fe02 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java @@ -14,7 +14,7 @@ import java.math.BigDecimal; public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber = null; + private BigDecimal justNumber; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java index 632b6f6e4ed..ac70304afda 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java @@ -15,16 +15,16 @@ import java.util.Date; public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private Date shipDate = null; + private Date shipDate; /** * Order Status @@ -55,12 +55,12 @@ public class Order { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java index cbbd53117cd..6d46e00e23c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java @@ -14,13 +14,13 @@ import java.math.BigDecimal; public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber = null; + private BigDecimal myNumber; @JsonProperty("my_string") - private String myString = null; + private String myString; @JsonProperty("my_boolean") - private Boolean myBoolean = null; + private Boolean myBoolean; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java index d46baedf6c2..f7dc82feebd 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java @@ -37,7 +37,7 @@ public enum OuterEnum { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java index 97a03717d3c..822ca68e118 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java @@ -18,13 +18,13 @@ import org.openapitools.model.Tag; public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); @@ -61,12 +61,12 @@ public class Pet { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 451402ed9bd..6c2e27d8bc3 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,10 +13,10 @@ import io.swagger.annotations.ApiModelProperty; public class ReadOnlyFirst { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("baz") - private String baz = null; + private String baz; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java index a85a7e51fdc..6582bf51884 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -13,7 +13,7 @@ import io.swagger.annotations.ApiModelProperty; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName = null; + private Long $specialPropertyName; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java index fb242eaafd8..24e27ce9b24 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java @@ -13,10 +13,10 @@ import io.swagger.annotations.ApiModelProperty; public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java new file mode 100644 index 00000000000..bef647c19a9 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -0,0 +1,165 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + + + +public class TypeHolderDefault { + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList(); + + /** + **/ + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("string_item") + public String getStringItem() { + return stringItem; + } + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + /** + **/ + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("number_item") + public BigDecimal getNumberItem() { + return numberItem; + } + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + /** + **/ + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("integer_item") + public Integer getIntegerItem() { + return integerItem; + } + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + /** + **/ + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("bool_item") + public Boolean getBoolItem() { + return boolItem; + } + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + /** + **/ + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("array_item") + public List getArrayItem() { + return arrayItem; + } + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(stringItem, typeHolderDefault.stringItem) && + Objects.equals(numberItem, typeHolderDefault.numberItem) && + Objects.equals(integerItem, typeHolderDefault.integerItem) && + Objects.equals(boolItem, typeHolderDefault.boolItem) && + Objects.equals(arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java new file mode 100644 index 00000000000..821a0dc1444 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -0,0 +1,187 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + + + +public class TypeHolderExample { + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("float_item") + private Float floatItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList(); + + /** + **/ + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty("string_item") + public String getStringItem() { + return stringItem; + } + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + /** + **/ + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("number_item") + public BigDecimal getNumberItem() { + return numberItem; + } + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + /** + **/ + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty("float_item") + public Float getFloatItem() { + return floatItem; + } + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + /** + **/ + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty("integer_item") + public Integer getIntegerItem() { + return integerItem; + } + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + /** + **/ + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty("bool_item") + public Boolean getBoolItem() { + return boolItem; + } + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + /** + **/ + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty("array_item") + public List getArrayItem() { + return arrayItem; + } + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(stringItem, typeHolderExample.stringItem) && + Objects.equals(numberItem, typeHolderExample.numberItem) && + Objects.equals(floatItem, typeHolderExample.floatItem) && + Objects.equals(integerItem, typeHolderExample.integerItem) && + Objects.equals(boolItem, typeHolderExample.boolItem) && + Objects.equals(arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java index b991f07867a..c1f4956c8e9 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java @@ -13,28 +13,28 @@ import io.swagger.annotations.ApiModelProperty; public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java new file mode 100644 index 00000000000..8a9de640ab6 --- /dev/null +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/XmlItem.java @@ -0,0 +1,693 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + + + +public class XmlItem { + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + private List prefixNsWrappedArray = null; + + /** + **/ + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("attribute_string") + public String getAttributeString() { + return attributeString; + } + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + /** + **/ + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("attribute_number") + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + /** + **/ + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("attribute_integer") + public Integer getAttributeInteger() { + return attributeInteger; + } + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + /** + **/ + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("attribute_boolean") + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + /** + **/ + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("wrapped_array") + public List getWrappedArray() { + return wrappedArray; + } + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + /** + **/ + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("name_string") + public String getNameString() { + return nameString; + } + public void setNameString(String nameString) { + this.nameString = nameString; + } + + /** + **/ + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("name_number") + public BigDecimal getNameNumber() { + return nameNumber; + } + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + /** + **/ + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("name_integer") + public Integer getNameInteger() { + return nameInteger; + } + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + /** + **/ + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("name_boolean") + public Boolean getNameBoolean() { + return nameBoolean; + } + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + /** + **/ + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name_array") + public List getNameArray() { + return nameArray; + } + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + /** + **/ + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name_wrapped_array") + public List getNameWrappedArray() { + return nameWrappedArray; + } + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + /** + **/ + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_string") + public String getPrefixString() { + return prefixString; + } + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + /** + **/ + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_number") + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + /** + **/ + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_integer") + public Integer getPrefixInteger() { + return prefixInteger; + } + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + /** + **/ + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_boolean") + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + /** + **/ + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_array") + public List getPrefixArray() { + return prefixArray; + } + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + /** + **/ + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_wrapped_array") + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + /** + **/ + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("namespace_string") + public String getNamespaceString() { + return namespaceString; + } + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + /** + **/ + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("namespace_number") + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + /** + **/ + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("namespace_integer") + public Integer getNamespaceInteger() { + return namespaceInteger; + } + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + /** + **/ + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("namespace_boolean") + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + /** + **/ + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("namespace_array") + public List getNamespaceArray() { + return namespaceArray; + } + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + /** + **/ + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("namespace_wrapped_array") + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + /** + **/ + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + + @ApiModelProperty(example = "string", value = "") + @JsonProperty("prefix_ns_string") + public String getPrefixNsString() { + return prefixNsString; + } + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + /** + **/ + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty("prefix_ns_number") + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + /** + **/ + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + + @ApiModelProperty(example = "-2", value = "") + @JsonProperty("prefix_ns_integer") + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + /** + **/ + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("prefix_ns_boolean") + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + /** + **/ + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_array") + public List getPrefixNsArray() { + return prefixNsArray; + } + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + /** + **/ + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("prefix_ns_wrapped_array") + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(attributeString, xmlItem.attributeString) && + Objects.equals(attributeNumber, xmlItem.attributeNumber) && + Objects.equals(attributeInteger, xmlItem.attributeInteger) && + Objects.equals(attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(wrappedArray, xmlItem.wrappedArray) && + Objects.equals(nameString, xmlItem.nameString) && + Objects.equals(nameNumber, xmlItem.nameNumber) && + Objects.equals(nameInteger, xmlItem.nameInteger) && + Objects.equals(nameBoolean, xmlItem.nameBoolean) && + Objects.equals(nameArray, xmlItem.nameArray) && + Objects.equals(nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(prefixString, xmlItem.prefixString) && + Objects.equals(prefixNumber, xmlItem.prefixNumber) && + Objects.equals(prefixInteger, xmlItem.prefixInteger) && + Objects.equals(prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(prefixArray, xmlItem.prefixArray) && + Objects.equals(prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(namespaceString, xmlItem.namespaceString) && + Objects.equals(namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(namespaceArray, xmlItem.namespaceArray) && + Objects.equals(namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(prefixNsString, xmlItem.prefixNsString) && + Objects.equals(prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java index 529234297d9..6c23f0dfa38 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java @@ -21,7 +21,7 @@ public class AnotherFakeController { **/ /* - public ResponseContext testSpecialTags(RequestContext request , Client client) { + public ResponseContext call123testSpecialTags(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java index f3e1b163c24..df32b5442dc 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java @@ -21,7 +21,7 @@ public class FakeClassnameTestController { **/ /* - public ResponseContext testClassname(RequestContext request , Client client) { + public ResponseContext testClassname(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java index e069a8c9751..30c90ea5c65 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java @@ -19,6 +19,7 @@ import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; +import org.openapitools.model.XmlItem; public class FakeController { @@ -28,6 +29,12 @@ public class FakeController { * Code allows you to implement logic incrementally, they are disabled. **/ + /* + public ResponseContext createXmlItem(RequestContext request , XmlItem xmlItem) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + /* public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolean body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); @@ -35,7 +42,7 @@ public class FakeController { */ /* - public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite outerComposite) { + public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,19 +60,19 @@ public class FakeController { */ /* - public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass fileSchemaTestClass) { + public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User user) { + public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testClientModel(RequestContext request , Client client) { + public ResponseContext testClientModel(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -83,7 +90,13 @@ public class FakeController { */ /* - public ResponseContext testInlineAdditionalProperties(RequestContext request , Map requestBody) { + public ResponseContext testGroupParameters(RequestContext request , Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + + /* + public ResponseContext testInlineAdditionalProperties(RequestContext request , Map param) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -94,6 +107,12 @@ public class FakeController { } */ + /* + public ResponseContext testQueryParameterCollectionFormat(RequestContext request , List pipe, List ioutil, List http, List url, List context) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + /* public ResponseContext uploadFileWithRequiredFile(RequestContext request , Long petId, FormDataContentDisposition fileDetail, String additionalMetadata) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java index cd276a63487..4475ca1323a 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java @@ -23,7 +23,7 @@ public class PetController { **/ /* - public ResponseContext addPet(RequestContext request , Pet pet) { + public ResponseContext addPet(RequestContext request , Pet body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,7 +53,7 @@ public class PetController { */ /* - public ResponseContext updatePet(RequestContext request , Pet pet) { + public ResponseContext updatePet(RequestContext request , Pet body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java index f67f43a380c..f77cc1110dd 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java @@ -40,7 +40,7 @@ public class StoreController { */ /* - public ResponseContext placeOrder(RequestContext request , Order order) { + public ResponseContext placeOrder(RequestContext request , Order body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java index 21ce727c628..01fd4b9873a 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java @@ -22,19 +22,19 @@ public class UserController { **/ /* - public ResponseContext createUser(RequestContext request , User user) { + public ResponseContext createUser(RequestContext request , User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithArrayInput(RequestContext request , List user) { + public ResponseContext createUsersWithArrayInput(RequestContext request , List body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithListInput(RequestContext request , List user) { + public ResponseContext createUsersWithListInput(RequestContext request , List body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -64,7 +64,7 @@ public class UserController { */ /* - public ResponseContext updateUser(RequestContext request , String username, User user) { + public ResponseContext updateUser(RequestContext request , String username, User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml index 277114e852d..0dbcb3868c6 100644 --- a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml @@ -32,7 +32,10 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 405: + "200": + content: {} + description: successful operation + "405": content: {} description: Invalid input security: @@ -42,6 +45,7 @@ paths: summary: Add a new pet to the store tags: - pet + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json put: @@ -57,13 +61,16 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 400: + "200": + content: {} + description: successful operation + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found - 405: + "405": content: {} description: Validation exception security: @@ -73,6 +80,7 @@ paths: summary: Update an existing pet tags: - pet + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /pet/findByStatus: @@ -96,7 +104,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -109,7 +117,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid status value security: @@ -123,7 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -137,7 +146,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -150,7 +159,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid tag value security: @@ -177,7 +186,10 @@ paths: format: int64 type: integer responses: - 400: + "200": + content: {} + description: successful operation + "400": content: {} description: Invalid pet value security: @@ -200,7 +212,7 @@ paths: format: int64 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -209,10 +221,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found security: @@ -243,7 +255,7 @@ paths: description: Updated status of the pet type: string responses: - 405: + "405": content: {} description: Invalid input security: @@ -279,7 +291,7 @@ paths: format: binary type: string responses: - 200: + "200": content: application/json: schema: @@ -299,7 +311,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -325,7 +337,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -334,17 +346,19 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid Order summary: Place an order for a pet tags: - store + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -354,10 +368,10 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Delete purchase order by ID @@ -365,7 +379,8 @@ paths: - store x-accepts: application/json get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -378,7 +393,7 @@ paths: minimum: 1 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -387,10 +402,10 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Find purchase order by ID @@ -415,6 +430,7 @@ paths: summary: Create user tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithArray: @@ -436,6 +452,7 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithList: @@ -457,6 +474,7 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/login: @@ -476,7 +494,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -496,7 +514,7 @@ paths: schema: format: date-time type: string - 400: + "400": content: {} description: Invalid username/password supplied summary: Logs user into the system @@ -526,10 +544,10 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Delete user @@ -546,7 +564,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -555,10 +573,10 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Get user by user name @@ -583,15 +601,16 @@ paths: description: Updated user object required: true responses: - 400: + "400": content: {} description: Invalid user supplied - 404: + "404": content: {} description: User not found summary: Updated user tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /fake_classname_test: @@ -606,7 +625,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -617,9 +636,58 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + "400": + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json get: description: To test enum parameters operationId: testEnumParameters @@ -711,10 +779,10 @@ paths: - (xyz) type: string responses: - 400: + "400": content: {} description: Invalid request - 404: + "404": content: {} description: Not found summary: To test enum parameters @@ -733,7 +801,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -742,14 +810,15 @@ paths: summary: To test "client" model tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json post: - description: | + description: |- Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: @@ -758,6 +827,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -827,19 +897,19 @@ paths: - pattern_without_delimiter required: true responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found security: - http_basic_test: [] - summary: | + summary: |- Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-contentType: application/x-www-form-urlencoded @@ -856,7 +926,7 @@ paths: description: Input number as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -864,6 +934,7 @@ paths: description: Output number tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/string: @@ -878,7 +949,7 @@ paths: description: Input string as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -886,6 +957,7 @@ paths: description: Output string tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/boolean: @@ -900,7 +972,7 @@ paths: description: Input boolean as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -908,6 +980,7 @@ paths: description: Output boolean tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/composite: @@ -922,7 +995,7 @@ paths: description: Input composite as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -930,6 +1003,7 @@ paths: description: Output composite tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/jsonFormData: @@ -951,7 +1025,7 @@ paths: - param2 required: true responses: - 200: + "200": content: {} description: successful operation summary: test json serialization of form data @@ -972,12 +1046,13 @@ paths: description: request body required: true responses: - 200: + "200": content: {} description: successful operation summary: test inline additionalProperties tags: - fake + x-codegen-request-body-name: param x-contentType: application/json x-accepts: application/json /fake/body-with-query-params: @@ -996,17 +1071,54 @@ paths: $ref: '#/components/schemas/User' required: true responses: - 200: + "200": content: {} description: Success tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: @@ -1015,7 +1127,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -1024,11 +1136,13 @@ paths: summary: To test special tags tags: - $another-fake? + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1037,13 +1151,68 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - 200: + "200": content: {} description: Success tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: {} + description: Success + tags: + - fake + x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1063,15 +1232,15 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: - 200: + "200": content: application/json: schema: @@ -1088,16 +1257,53 @@ paths: x-accepts: application/json components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: - name: name + name: default-name id: 6 properties: id: format: int64 type: integer name: + default: default-name type: string + required: + - name type: object xml: name: Category @@ -1135,45 +1341,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: + Tag: + example: + name: name + id: 1 properties: - ArrayNumber: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: items: - type: number + type: string type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1188,148 +1421,6 @@ components: message: type: string type: object - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - 123Number: - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list - properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - 200_response: - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - Client: - example: - client: client - properties: - client: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - type: object $special[model.name]: properties: $special[property.name]: @@ -1347,63 +1438,71 @@ components: type: object xml: name: Return - ReadOnlyFirst: + Name: + description: Model for testing model name same as property name properties: - bar: + name: + format: int32 + type: integer + snake_case: + format: int32 readOnly: true + type: integer + property: type: string - baz: + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: type: string type: object - ArrayOfArrayOfNumberOnly: + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - OuterComposite: - example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true - properties: - my_number: - type: number - my_string: + _class: type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array format_test: properties: integer: @@ -1449,6 +1548,7 @@ components: format: date-time type: string uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 format: uuid type: string password: @@ -1456,76 +1556,221 @@ components: maxLength: 64 minLength: 10 type: string + BigDecimal: + format: number + type: string required: - byte - date - number - password type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterString: + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) type: string - ClassModel: - description: Model for testing model with "_class" property + Enum_Test: properties: - _class: + enum_string: + enum: + - UPPER + - lower + - "" type: string - type: object - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red + enum_string_required: + enum: + - UPPER + - lower + - "" type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' required: - - className + - enum_string_required type: object - StringBooleanMap: + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: additionalProperties: type: boolean + properties: + name: + type: string type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object MapTest: properties: map_map_of_string: @@ -1546,26 +1791,114 @@ components: type: boolean type: object indirect_map: - $ref: '#/components/schemas/StringBooleanMap' + additionalProperties: + type: boolean + type: object type: object - Tag: - example: - name: name - id: 1 + ArrayTest: properties: - id: - format: int64 - type: integer - name: - type: string + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: + description: Must be named `File` for test. example: sourceURI: sourceURI properties: @@ -1573,68 +1906,260 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + TypeHolderDefault: properties: - id: - format: int64 + string_item: + default: what + type: string + number_item: + type: number + integer_item: type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: + bool_item: + default: true + type: boolean + array_item: items: - type: string + type: integer type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string required: - - name - - photoUrls + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what + type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true type: object xml: - name: Pet - hasOnlyReadOnly: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: properties: - bar: - readOnly: true + breed: type: string - foo: - readOnly: true + Cat_allOf: + properties: + declawed: + type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars type: string - type: object securitySchemes: petstore_auth: flows: @@ -1644,9 +2169,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1655,3 +2177,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http