diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index a0f064611b15..c9f70210eb53 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2087,6 +2087,10 @@ components: properties: name: type: string + pet_type: + enum: + - ChildCat + default: ChildCat ArrayOfEnums: type: array items: diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index e09549a0c3d6..0b8f772ca8ad 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -2401,6 +2401,11 @@ components: properties: name: type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string type: object securitySchemes: petstore_auth: diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md index e6548f036ffb..04014f333fcc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md @@ -7,6 +7,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | | [optional] +**petType** | [**PetTypeEnum**](#PetTypeEnum) | | [optional] + + + +## Enum: PetTypeEnum + +Name | Value +---- | ----- +CHILDCAT | "ChildCat" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md index abd7adedbcc5..9a050eddff36 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md @@ -7,6 +7,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | | [optional] +**petType** | [**PetTypeEnum**](#PetTypeEnum) | | [optional] + + + +## Enum: PetTypeEnum + +Name | Value +---- | ----- +CHILDCAT | "ChildCat" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index e96b56a28479..001f5d3ee0b5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -40,7 +40,8 @@ * ChildCat */ @JsonPropertyOrder({ - ChildCat.JSON_PROPERTY_NAME + ChildCat.JSON_PROPERTY_NAME, + ChildCat.JSON_PROPERTY_PET_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true) @@ -49,6 +50,42 @@ public class ChildCat extends ParentPet { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** + * Gets or Sets petType + */ + public enum PetTypeEnum { + CHILDCAT("ChildCat"); + + private String value; + + PetTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PetTypeEnum fromValue(String value) { + for (PetTypeEnum b : PetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + private PetTypeEnum petType = PetTypeEnum.CHILDCAT; + public ChildCat name(String name) { this.name = name; @@ -73,6 +110,30 @@ public void setName(String name) { this.name = name; } + + public ChildCat petType(PetTypeEnum petType) { + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PetTypeEnum getPetType() { + return petType; + } + + + public void setPetType(PetTypeEnum petType) { + this.petType = petType; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -123,14 +184,15 @@ public boolean equals(java.lang.Object o) { return false; } ChildCat childCat = (ChildCat) o; - return Objects.equals(this.name, childCat.name)&& + return Objects.equals(this.name, childCat.name) && + Objects.equals(this.petType, childCat.petType)&& Objects.equals(this.additionalProperties, childCat.additionalProperties) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); + return Objects.hash(name, petType, super.hashCode(), additionalProperties); } @@ -140,6 +202,7 @@ public String toString() { sb.append("class ChildCat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java index 8ad157bf8d82..b2a7487e4248 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -32,13 +32,50 @@ * ChildCatAllOf */ @JsonPropertyOrder({ - ChildCatAllOf.JSON_PROPERTY_NAME + ChildCatAllOf.JSON_PROPERTY_NAME, + ChildCatAllOf.JSON_PROPERTY_PET_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ChildCatAllOf { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** + * Gets or Sets petType + */ + public enum PetTypeEnum { + CHILDCAT("ChildCat"); + + private String value; + + PetTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PetTypeEnum fromValue(String value) { + for (PetTypeEnum b : PetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + private PetTypeEnum petType = PetTypeEnum.CHILDCAT; + public ChildCatAllOf name(String name) { this.name = name; @@ -64,6 +101,30 @@ public void setName(String name) { } + public ChildCatAllOf petType(PetTypeEnum petType) { + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PetTypeEnum getPetType() { + return petType; + } + + + public void setPetType(PetTypeEnum petType) { + this.petType = petType; + } + + /** * Return true if this ChildCat_allOf object is equal to o. */ @@ -76,12 +137,13 @@ public boolean equals(java.lang.Object o) { return false; } ChildCatAllOf childCatAllOf = (ChildCatAllOf) o; - return Objects.equals(this.name, childCatAllOf.name); + return Objects.equals(this.name, childCatAllOf.name) && + Objects.equals(this.petType, childCatAllOf.petType); } @Override public int hashCode() { - return Objects.hash(name); + return Objects.hash(name, petType); } @@ -90,6 +152,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ChildCatAllOf {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); sb.append("}"); return sb.toString(); }