diff --git a/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/assets/payload/UserSignedUpPayload.java b/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/assets/payload/UserSignedUpPayload.java index de8bdcbf..7f85038e 100644 --- a/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/assets/payload/UserSignedUpPayload.java +++ b/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/assets/payload/UserSignedUpPayload.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDateTime; import com.fasterxml.jackson.annotation.JsonFormat; @@ -21,6 +22,29 @@ public class UserSignedUpPayload { @JsonProperty(value ="createdAt") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") private LocalDateTime createdAt; + @JsonProperty(value ="numberEnum") + private NumberEnum numberEnum; + public enum NumberEnum { + _1234("1234"), + _2345("2345"), + _3456("3456"); + + private String value; + + NumberEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } @JsonProperty(value ="someOtherObject") private SomeOtherObject someOtherObject; @@ -29,6 +53,7 @@ private UserSignedUpPayload(UserSignedUpPayloadBuilder builder) { this.lastName = builder.lastName; this.email = builder.email; this.createdAt = builder.createdAt; + this.numberEnum = builder.numberEnum; this.someOtherObject = builder.someOtherObject; } @@ -48,6 +73,8 @@ public static class UserSignedUpPayloadBuilder { private LocalDateTime createdAt; + private NumberEnum numberEnum; + private SomeOtherObject someOtherObject; public UserSignedUpPayload.UserSignedUpPayloadBuilder createdAt(LocalDateTime createdAt) { @@ -55,6 +82,11 @@ public UserSignedUpPayload.UserSignedUpPayloadBuilder createdAt(LocalDateTime cr return this; } + public UserSignedUpPayload.UserSignedUpPayloadBuilder numberEnum(NumberEnum numberEnum) { + this.numberEnum = numberEnum; + return this; + } + public UserSignedUpPayload.UserSignedUpPayloadBuilder someOtherObject(SomeOtherObject someOtherObject) { this.someOtherObject = someOtherObject; return this; @@ -105,6 +137,18 @@ public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; } + /** + * Get numberEnum + * @return numberEnum + */ + @Schema(name = "numberEnum", required = false) + public NumberEnum getNumberEnum() { + return numberEnum; + } + public void setNumberEnum(NumberEnum numberEnum) { + this.numberEnum = numberEnum; + } + /** * Get someOtherObject * @return someOtherObject @@ -126,12 +170,12 @@ public boolean equals(Object o) { return false; } UserSignedUpPayload userSignedUpPayload = (UserSignedUpPayload) o; - return Objects.equals(this.firstName, userSignedUpPayload.firstName) && Objects.equals(this.lastName, userSignedUpPayload.lastName) && Objects.equals(this.email, userSignedUpPayload.email) && Objects.equals(this.createdAt, userSignedUpPayload.createdAt) && Objects.equals(this.someOtherObject, userSignedUpPayload.someOtherObject); + return Objects.equals(this.firstName, userSignedUpPayload.firstName) && Objects.equals(this.lastName, userSignedUpPayload.lastName) && Objects.equals(this.email, userSignedUpPayload.email) && Objects.equals(this.createdAt, userSignedUpPayload.createdAt) && Objects.equals(this.numberEnum, userSignedUpPayload.numberEnum) && Objects.equals(this.someOtherObject, userSignedUpPayload.someOtherObject); } @Override public int hashCode() { - return Objects.hash(firstName, lastName, email, createdAt, someOtherObject); + return Objects.hash(firstName, lastName, email, createdAt, numberEnum, someOtherObject); } @Override @@ -142,6 +186,7 @@ public String toString() { sb.append(" lastName:").append(lastName).append(","); sb.append(" email:").append(email).append(","); sb.append(" createdAt:").append(createdAt).append(","); + sb.append(" numberEnum:").append(numberEnum).append(","); sb.append(" someOtherObject:").append(someOtherObject); sb.append("}"); return sb.toString(); diff --git a/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/event-api.yml b/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/event-api.yml index cb672f60..822fe7a0 100644 --- a/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/event-api.yml +++ b/multiapi-engine/src/test/resources/asyncapigenerator/testConstantGeneration/event-api.yml @@ -40,6 +40,12 @@ components: createdAt: type: string format: date-time + numberEnum: + type: string + enum: + - '1234' + - '2345' + - '3456' someOtherObject: type: object properties: