From 6f797bbdbe35727e30fa88edac0faf4b47abe389 Mon Sep 17 00:00:00 2001 From: Stephan Schnabel Date: Thu, 17 Aug 2023 10:15:58 +0200 Subject: [PATCH] Records: add testcases --- .../AdditionalPropertiesModel.java | 72 ++ .../AdditionalPropertiesModelValue.java | 9 + .../micronaut_record/EnumerationInteger.java | 40 + .../micronaut_record/EnumerationModel.java | 181 ++++ .../micronaut_record/EnumerationNumber.java | 36 + .../micronaut_record/EnumerationString.java | 34 + .../EnumerationStringDefault.java | 34 + .../micronaut_record/FirstModel.java | 98 +++ .../micronaut_record/InheritanceExtended.java | 78 ++ .../micronaut_record/InheritanceSimple.java | 15 + .../InheritanceSimpleDefault.java | 56 ++ .../InheritanceWithEnumType.java | 16 + .../InheritanceWithEnumType1.java | 62 ++ .../InheritanceWithEnumType2.java | 62 ++ .../InheritanceWithEnumType3.java | 37 + .../InheritanceWithEnumTypeEnum.java | 36 + .../InheritanceWithStringType.java | 23 + .../InheritanceWithStringType1.java | 81 ++ .../InheritanceWithStringType2.java | 81 ++ .../InheritanceWithoutType.java | 23 + .../InheritanceWithoutType1.java | 81 ++ .../InheritanceWithoutType2.java | 81 ++ .../testmodel/micronaut_record/Model.java | 828 ++++++++++++++++++ .../micronaut_record/OneOfImplementor1.java | 62 ++ .../micronaut_record/OneOfImplementor2.java | 62 ++ .../micronaut_record/OneOfInterface.java | 15 + .../micronaut_record/OneOfModel.java | 9 + .../micronaut_record/PropertyTypeOne.java | 87 ++ .../micronaut_record/PropertyTypeTwo.java | 87 ++ .../micronaut_record/SecondLevelModel.java | 9 + .../micronaut_record/SecondLevelOneModel.java | 77 ++ .../micronaut_record/SecondLevelTwoModel.java | 77 ++ .../AdditionalPropertiesModel.java | 72 ++ .../AdditionalPropertiesModelValue.java | 9 + .../EnumerationInteger.java | 40 + .../EnumerationModel.java | 181 ++++ .../EnumerationNumber.java | 36 + .../EnumerationString.java | 34 + .../EnumerationStringDefault.java | 34 + .../micronaut_record_nullable/FirstModel.java | 98 +++ .../InheritanceExtended.java | 78 ++ .../InheritanceSimple.java | 15 + .../InheritanceSimpleDefault.java | 56 ++ .../InheritanceWithEnumType.java | 16 + .../InheritanceWithEnumType1.java | 62 ++ .../InheritanceWithEnumType2.java | 62 ++ .../InheritanceWithEnumType3.java | 37 + .../InheritanceWithEnumTypeEnum.java | 36 + .../InheritanceWithStringType.java | 23 + .../InheritanceWithStringType1.java | 81 ++ .../InheritanceWithStringType2.java | 81 ++ .../InheritanceWithoutType.java | 23 + .../InheritanceWithoutType1.java | 81 ++ .../InheritanceWithoutType2.java | 81 ++ .../micronaut_record_nullable/Model.java | 828 ++++++++++++++++++ .../OneOfImplementor1.java | 62 ++ .../OneOfImplementor2.java | 62 ++ .../OneOfInterface.java | 15 + .../micronaut_record_nullable/OneOfModel.java | 9 + .../PropertyTypeOne.java | 87 ++ .../PropertyTypeTwo.java | 87 ++ .../SecondLevelModel.java | 9 + .../SecondLevelOneModel.java | 77 ++ .../SecondLevelTwoModel.java | 77 ++ .../languages/MicronautCodegenTest.java | 8 + 65 files changed, 5106 insertions(+) create mode 100644 gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModel.java create mode 100644 gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModelValue.java create mode 100644 gen/main/java/testmodel/micronaut_record/EnumerationInteger.java create mode 100644 gen/main/java/testmodel/micronaut_record/EnumerationModel.java create mode 100644 gen/main/java/testmodel/micronaut_record/EnumerationNumber.java create mode 100644 gen/main/java/testmodel/micronaut_record/EnumerationString.java create mode 100644 gen/main/java/testmodel/micronaut_record/EnumerationStringDefault.java create mode 100644 gen/main/java/testmodel/micronaut_record/FirstModel.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceExtended.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceSimple.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceSimpleDefault.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType1.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType2.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType3.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithEnumTypeEnum.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithStringType.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithStringType1.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithStringType2.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithoutType.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithoutType1.java create mode 100644 gen/main/java/testmodel/micronaut_record/InheritanceWithoutType2.java create mode 100644 gen/main/java/testmodel/micronaut_record/Model.java create mode 100644 gen/main/java/testmodel/micronaut_record/OneOfImplementor1.java create mode 100644 gen/main/java/testmodel/micronaut_record/OneOfImplementor2.java create mode 100644 gen/main/java/testmodel/micronaut_record/OneOfInterface.java create mode 100644 gen/main/java/testmodel/micronaut_record/OneOfModel.java create mode 100644 gen/main/java/testmodel/micronaut_record/PropertyTypeOne.java create mode 100644 gen/main/java/testmodel/micronaut_record/PropertyTypeTwo.java create mode 100644 gen/main/java/testmodel/micronaut_record/SecondLevelModel.java create mode 100644 gen/main/java/testmodel/micronaut_record/SecondLevelOneModel.java create mode 100644 gen/main/java/testmodel/micronaut_record/SecondLevelTwoModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModelValue.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/EnumerationInteger.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/EnumerationModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/EnumerationNumber.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/EnumerationString.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/EnumerationStringDefault.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/FirstModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceExtended.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimple.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimpleDefault.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType1.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType2.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType3.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumTypeEnum.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType1.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType2.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType1.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType2.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/Model.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor1.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor2.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/OneOfInterface.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/OneOfModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeOne.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeTwo.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/SecondLevelModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/SecondLevelOneModel.java create mode 100644 gen/main/java/testmodel/micronaut_record_nullable/SecondLevelTwoModel.java diff --git a/gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModel.java b/gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModel.java new file mode 100644 index 00000000..bd29676e --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModel.java @@ -0,0 +1,72 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class AdditionalPropertiesModel { + + public static final java.lang.String JSON_PROPERTY_ID = "id"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String id; + + private java.util.Map additionalProperties; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + AdditionalPropertiesModel other = (AdditionalPropertiesModel) object; + return java.util.Objects.equals(id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(id); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("AdditionalPropertiesModel[") + .append("id=").append(id) + .append("]") + .toString(); + } + + // fluent + + public AdditionalPropertiesModel id(java.lang.String newId) { + this.id = newId; + return this; + } + + @com.fasterxml.jackson.annotation.JsonAnyGetter + public java.util.Map getAdditionalProperties() { + return additionalProperties; + } + + @com.fasterxml.jackson.annotation.JsonAnySetter + public void setAdditionalProperties(java.lang.String propertyKey, AdditionalPropertiesModelValue value) { + if (this.additionalProperties == null) { + this.additionalProperties = new java.util.HashMap<>(); + } + this.additionalProperties.put(propertyKey, value); + } + + // getter/setter + + public java.lang.String getId() { + return id; + } + + public void setId(java.lang.String newId) { + this.id = newId; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModelValue.java b/gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModelValue.java new file mode 100644 index 00000000..2d9dd248 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/AdditionalPropertiesModelValue.java @@ -0,0 +1,9 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.DEDUCTION, visible = true) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = PropertyTypeOne.class), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = PropertyTypeTwo.class) +}) +public sealed interface AdditionalPropertiesModelValue permits PropertyTypeOne, PropertyTypeTwo {} diff --git a/gen/main/java/testmodel/micronaut_record/EnumerationInteger.java b/gen/main/java/testmodel/micronaut_record/EnumerationInteger.java new file mode 100644 index 00000000..2583e23a --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/EnumerationInteger.java @@ -0,0 +1,40 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationInteger { + + NUMBER_MINUS_2147483648(-2147483648), + NUMBER_MINUS_1(-1), + NUMBER_0(0), + NUMBER_1(1), + NUMBER_2147483647(2147483647); + + public static final java.lang.Integer NUMBER_MINUS_2147483648_VALUE = -2147483648; + public static final java.lang.Integer NUMBER_MINUS_1_VALUE = -1; + public static final java.lang.Integer NUMBER_0_VALUE = 0; + public static final java.lang.Integer NUMBER_1_VALUE = 1; + public static final java.lang.Integer NUMBER_2147483647_VALUE = 2147483647; + + private final java.lang.Integer value; + + private EnumerationInteger(java.lang.Integer value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationInteger toEnum(java.lang.Integer value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.Integer value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.Integer getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/EnumerationModel.java b/gen/main/java/testmodel/micronaut_record/EnumerationModel.java new file mode 100644 index 00000000..46990e70 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/EnumerationModel.java @@ -0,0 +1,181 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class EnumerationModel { + + public static final java.lang.String JSON_PROPERTY_STRING = "string"; + public static final java.lang.String JSON_PROPERTY_STRING_DEFAULT = "string-default"; + public static final java.lang.String JSON_PROPERTY_EMBEDDED = "embedded"; + public static final java.lang.String JSON_PROPERTY_EMBEDDED_DEFAULT = "embedded-default"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_STRING) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EnumerationString string; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_STRING_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EnumerationStringDefault stringDefault = EnumerationStringDefault.THREE; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_EMBEDDED) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private Embedded embedded; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_EMBEDDED_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EmbeddedDefault embeddedDefault = EmbeddedDefault.FOUR; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + EnumerationModel other = (EnumerationModel) object; + return java.util.Objects.equals(string, other.string) + && java.util.Objects.equals(stringDefault, other.stringDefault) + && java.util.Objects.equals(embedded, other.embedded) + && java.util.Objects.equals(embeddedDefault, other.embeddedDefault); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(string, stringDefault, embedded, embeddedDefault); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("EnumerationModel[") + .append("string=").append(string).append(",") + .append("stringDefault=").append(stringDefault).append(",") + .append("embedded=").append(embedded).append(",") + .append("embeddedDefault=").append(embeddedDefault) + .append("]") + .toString(); + } + + // fluent + + public EnumerationModel string(EnumerationString newString) { + this.string = newString; + return this; + } + + public EnumerationModel stringDefault(EnumerationStringDefault newStringDefault) { + this.stringDefault = newStringDefault; + return this; + } + + public EnumerationModel embedded(Embedded newEmbedded) { + this.embedded = newEmbedded; + return this; + } + + public EnumerationModel embeddedDefault(EmbeddedDefault newEmbeddedDefault) { + this.embeddedDefault = newEmbeddedDefault; + return this; + } + + // getter/setter + + public EnumerationString getString() { + return string; + } + + public void setString(EnumerationString newString) { + this.string = newString; + } + + public EnumerationStringDefault getStringDefault() { + return stringDefault; + } + + public void setStringDefault(EnumerationStringDefault newStringDefault) { + this.stringDefault = newStringDefault; + } + + public Embedded getEmbedded() { + return embedded; + } + + public void setEmbedded(Embedded newEmbedded) { + this.embedded = newEmbedded; + } + + public EmbeddedDefault getEmbeddedDefault() { + return embeddedDefault; + } + + public void setEmbeddedDefault(EmbeddedDefault newEmbeddedDefault) { + this.embeddedDefault = newEmbeddedDefault; + } + +public enum Embedded { + + FIRST("first"), + SECOND("second"); + + public static final java.lang.String FIRST_VALUE = "first"; + public static final java.lang.String SECOND_VALUE = "second"; + + private final java.lang.String value; + + private Embedded(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static Embedded toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} + +public enum EmbeddedDefault { + + THREE("three"), + FOUR("four"); + + public static final java.lang.String THREE_VALUE = "three"; + public static final java.lang.String FOUR_VALUE = "four"; + + private final java.lang.String value; + + private EmbeddedDefault(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EmbeddedDefault toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} +} diff --git a/gen/main/java/testmodel/micronaut_record/EnumerationNumber.java b/gen/main/java/testmodel/micronaut_record/EnumerationNumber.java new file mode 100644 index 00000000..847e5525 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/EnumerationNumber.java @@ -0,0 +1,36 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationNumber { + + NUMBER_MINUS_1(-1D), + NUMBER_0(0D), + NUMBER_1(1D); + + public static final java.lang.Double NUMBER_MINUS_1_VALUE = -1D; + public static final java.lang.Double NUMBER_0_VALUE = 0D; + public static final java.lang.Double NUMBER_1_VALUE = 1D; + + private final java.lang.Double value; + + private EnumerationNumber(java.lang.Double value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationNumber toEnum(java.lang.Double value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.Double value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.Double getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/EnumerationString.java b/gen/main/java/testmodel/micronaut_record/EnumerationString.java new file mode 100644 index 00000000..8f559d4d --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/EnumerationString.java @@ -0,0 +1,34 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationString { + + ONE("one"), + TWO("two"); + + public static final java.lang.String ONE_VALUE = "one"; + public static final java.lang.String TWO_VALUE = "two"; + + private final java.lang.String value; + + private EnumerationString(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationString toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/EnumerationStringDefault.java b/gen/main/java/testmodel/micronaut_record/EnumerationStringDefault.java new file mode 100644 index 00000000..76c8bbaa --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/EnumerationStringDefault.java @@ -0,0 +1,34 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationStringDefault { + + THREE("three"), + FOUR("four"); + + public static final java.lang.String THREE_VALUE = "three"; + public static final java.lang.String FOUR_VALUE = "four"; + + private final java.lang.String value; + + private EnumerationStringDefault(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationStringDefault toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/FirstModel.java b/gen/main/java/testmodel/micronaut_record/FirstModel.java new file mode 100644 index 00000000..359f8057 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/FirstModel.java @@ -0,0 +1,98 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class FirstModel implements OneOfModel { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + public static final java.lang.String JSON_PROPERTY_FIRST = "first"; + public static final java.lang.String JSON_PROPERTY_SECOND_LEVEL = "secondLevel"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String type; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FIRST) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String first; + + @jakarta.validation.Valid + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_SECOND_LEVEL) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private SecondLevelModel secondLevel; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + FirstModel other = (FirstModel) object; + return java.util.Objects.equals(type, other.type) + && java.util.Objects.equals(first, other.first) + && java.util.Objects.equals(secondLevel, other.secondLevel); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type, first, secondLevel); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("FirstModel[") + .append("type=").append(type).append(",") + .append("first=").append(first).append(",") + .append("secondLevel=").append(secondLevel) + .append("]") + .toString(); + } + + // fluent + + public FirstModel type(java.lang.String newType) { + this.type = newType; + return this; + } + + public FirstModel first(java.lang.String newFirst) { + this.first = newFirst; + return this; + } + + public FirstModel secondLevel(SecondLevelModel newSecondLevel) { + this.secondLevel = newSecondLevel; + return this; + } + + // getter/setter + + public java.lang.String getType() { + return type; + } + + public void setType(java.lang.String newType) { + this.type = newType; + } + + public java.lang.String getFirst() { + return first; + } + + public void setFirst(java.lang.String newFirst) { + this.first = newFirst; + } + + public SecondLevelModel getSecondLevel() { + return secondLevel; + } + + public void setSecondLevel(SecondLevelModel newSecondLevel) { + this.secondLevel = newSecondLevel; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceExtended.java b/gen/main/java/testmodel/micronaut_record/InheritanceExtended.java new file mode 100644 index 00000000..c7ea057b --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceExtended.java @@ -0,0 +1,78 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceExtended implements InheritanceSimple { + + public static final java.lang.String JSON_PROPERTY_BAR = "bar"; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String foo; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_BAR) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String bar; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceExtended other = (InheritanceExtended) object; + return java.util.Objects.equals(foo, other.foo) + && java.util.Objects.equals(bar, other.bar); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(foo, bar); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceExtended[") + .append("foo=").append(foo).append(",") + .append("bar=").append(bar) + .append("]") + .toString(); + } + + // fluent + + public InheritanceExtended foo(java.lang.String newFoo) { + this.foo = newFoo; + return this; + } + + public InheritanceExtended bar(java.lang.String newBar) { + this.bar = newBar; + return this; + } + + // getter/setter + + public java.lang.String getFoo() { + return foo; + } + + public void setFoo(java.lang.String newFoo) { + this.foo = newFoo; + } + + public java.lang.String getBar() { + return bar; + } + + public void setBar(java.lang.String newBar) { + this.bar = newBar; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceSimple.java b/gen/main/java/testmodel/micronaut_record/InheritanceSimple.java new file mode 100644 index 00000000..54470d72 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceSimple.java @@ -0,0 +1,15 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(as = InheritanceSimpleDefault.class) +public sealed interface InheritanceSimple permits InheritanceExtended, InheritanceSimpleDefault { + + java.lang.String JSON_PROPERTY_FOO = "foo"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + java.lang.String getFoo(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + void setFoo(java.lang.String newFoo); +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceSimpleDefault.java b/gen/main/java/testmodel/micronaut_record/InheritanceSimpleDefault.java new file mode 100644 index 00000000..e880229f --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceSimpleDefault.java @@ -0,0 +1,56 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceSimpleDefault implements InheritanceSimple { + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String foo; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceSimpleDefault other = (InheritanceSimpleDefault) object; + return java.util.Objects.equals(foo, other.foo); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(foo); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceSimpleDefault[") + .append("foo=").append(foo) + .append("]") + .toString(); + } + + // fluent + + public InheritanceSimpleDefault foo(java.lang.String newFoo) { + this.foo = newFoo; + return this; + } + + // getter/setter + + public java.lang.String getFoo() { + return foo; + } + + public void setFoo(java.lang.String newFoo) { + this.foo = newFoo; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType.java new file mode 100644 index 00000000..8e947454 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType.java @@ -0,0 +1,16 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = InheritanceWithEnumType.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithEnumType1.class, name = "Inheritance1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithEnumType2.class, name = "Inheritance2"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithEnumType3.class, name = "Inheritance3") +}) +public sealed interface InheritanceWithEnumType permits InheritanceWithEnumType1, InheritanceWithEnumType2, InheritanceWithEnumType3 { + + java.lang.String JSON_DISCRIMINATOR = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + InheritanceWithEnumTypeEnum getType(); +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType1.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType1.java new file mode 100644 index 00000000..419445cd --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType1.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithEnumType1 implements InheritanceWithEnumType { + + public static final java.lang.String JSON_PROPERTY_D = "d"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_D) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String d; + + @Override + public InheritanceWithEnumTypeEnum getType() { + return InheritanceWithEnumTypeEnum.INHERITANCE1; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithEnumType1 other = (InheritanceWithEnumType1) object; + return java.util.Objects.equals(d, other.d); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(d); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithEnumType1[") + .append("d=").append(d) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithEnumType1 d(java.lang.String newD) { + this.d = newD; + return this; + } + + // getter/setter + + public java.lang.String getD() { + return d; + } + + public void setD(java.lang.String newD) { + this.d = newD; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType2.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType2.java new file mode 100644 index 00000000..cd5c3454 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType2.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithEnumType2 implements InheritanceWithEnumType { + + public static final java.lang.String JSON_PROPERTY_E = "e"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String e; + + @Override + public InheritanceWithEnumTypeEnum getType() { + return InheritanceWithEnumTypeEnum.INHERITANCE2; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithEnumType2 other = (InheritanceWithEnumType2) object; + return java.util.Objects.equals(e, other.e); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(e); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithEnumType2[") + .append("e=").append(e) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithEnumType2 e(java.lang.String newE) { + this.e = newE; + return this; + } + + // getter/setter + + public java.lang.String getE() { + return e; + } + + public void setE(java.lang.String newE) { + this.e = newE; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType3.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType3.java new file mode 100644 index 00000000..fd128f38 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumType3.java @@ -0,0 +1,37 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithEnumType3 implements InheritanceWithEnumType { + + @Override + public InheritanceWithEnumTypeEnum getType() { + return InheritanceWithEnumTypeEnum.INHERITANCE3; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + return super.equals(object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithEnumType3[") + .append("]") + .toString(); + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumTypeEnum.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumTypeEnum.java new file mode 100644 index 00000000..c5355497 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithEnumTypeEnum.java @@ -0,0 +1,36 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum InheritanceWithEnumTypeEnum { + + INHERITANCE1("Inheritance1"), + INHERITANCE2("Inheritance2"), + INHERITANCE3("Inheritance3"); + + public static final java.lang.String INHERITANCE1_VALUE = "Inheritance1"; + public static final java.lang.String INHERITANCE2_VALUE = "Inheritance2"; + public static final java.lang.String INHERITANCE3_VALUE = "Inheritance3"; + + private final java.lang.String value; + + private InheritanceWithEnumTypeEnum(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static InheritanceWithEnumTypeEnum toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType.java new file mode 100644 index 00000000..4b4fb4a6 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType.java @@ -0,0 +1,23 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = InheritanceWithStringType.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithStringType1.class, name = "Inheritance1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithStringType2.class, name = "Inheritance2") +}) +public sealed interface InheritanceWithStringType permits InheritanceWithStringType1, InheritanceWithStringType2 { + + java.lang.String JSON_DISCRIMINATOR = "type"; + java.lang.String JSON_PROPERTY_A = "a"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + java.lang.String getType(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + java.lang.String getA(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + void setA(java.lang.String newA); +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType1.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType1.java new file mode 100644 index 00000000..1699ddfb --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType1.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithStringType1 implements InheritanceWithStringType { + + public static final java.lang.String JSON_PROPERTY_B = "b"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String a; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_B) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String b; + + @Override + public java.lang.String getType() { + return "Inheritance1"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithStringType1 other = (InheritanceWithStringType1) object; + return java.util.Objects.equals(a, other.a) + && java.util.Objects.equals(b, other.b); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(a, b); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithStringType1[") + .append("a=").append(a).append(",") + .append("b=").append(b) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithStringType1 a(java.lang.String newA) { + this.a = newA; + return this; + } + + public InheritanceWithStringType1 b(java.lang.String newB) { + this.b = newB; + return this; + } + + // getter/setter + + public java.lang.String getA() { + return a; + } + + public void setA(java.lang.String newA) { + this.a = newA; + } + + public java.lang.String getB() { + return b; + } + + public void setB(java.lang.String newB) { + this.b = newB; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType2.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType2.java new file mode 100644 index 00000000..f5efafa7 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithStringType2.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithStringType2 implements InheritanceWithStringType { + + public static final java.lang.String JSON_PROPERTY_C = "c"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String a; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_C) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String c; + + @Override + public java.lang.String getType() { + return "Inheritance2"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithStringType2 other = (InheritanceWithStringType2) object; + return java.util.Objects.equals(a, other.a) + && java.util.Objects.equals(c, other.c); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(a, c); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithStringType2[") + .append("a=").append(a).append(",") + .append("c=").append(c) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithStringType2 a(java.lang.String newA) { + this.a = newA; + return this; + } + + public InheritanceWithStringType2 c(java.lang.String newC) { + this.c = newC; + return this; + } + + // getter/setter + + public java.lang.String getA() { + return a; + } + + public void setA(java.lang.String newA) { + this.a = newA; + } + + public java.lang.String getC() { + return c; + } + + public void setC(java.lang.String newC) { + this.c = newC; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType.java new file mode 100644 index 00000000..8f6a5bf9 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType.java @@ -0,0 +1,23 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = InheritanceWithoutType.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithoutType1.class, name = "Inheritance1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithoutType2.class, name = "Inheritance2") +}) +public sealed interface InheritanceWithoutType permits InheritanceWithoutType1, InheritanceWithoutType2 { + + java.lang.String JSON_DISCRIMINATOR = "type"; + java.lang.String JSON_PROPERTY_E = "e"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + java.lang.String getType(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + java.lang.String getE(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + void setE(java.lang.String newE); +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType1.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType1.java new file mode 100644 index 00000000..3364f2dc --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType1.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithoutType1 implements InheritanceWithoutType { + + public static final java.lang.String JSON_PROPERTY_F = "f"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String e; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_F) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String f; + + @Override + public java.lang.String getType() { + return "Inheritance1"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithoutType1 other = (InheritanceWithoutType1) object; + return java.util.Objects.equals(e, other.e) + && java.util.Objects.equals(f, other.f); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(e, f); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithoutType1[") + .append("e=").append(e).append(",") + .append("f=").append(f) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithoutType1 e(java.lang.String newE) { + this.e = newE; + return this; + } + + public InheritanceWithoutType1 f(java.lang.String newF) { + this.f = newF; + return this; + } + + // getter/setter + + public java.lang.String getE() { + return e; + } + + public void setE(java.lang.String newE) { + this.e = newE; + } + + public java.lang.String getF() { + return f; + } + + public void setF(java.lang.String newF) { + this.f = newF; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType2.java b/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType2.java new file mode 100644 index 00000000..52603e9d --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/InheritanceWithoutType2.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class InheritanceWithoutType2 implements InheritanceWithoutType { + + public static final java.lang.String JSON_PROPERTY_G = "g"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String e; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_G) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String g; + + @Override + public java.lang.String getType() { + return "Inheritance2"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithoutType2 other = (InheritanceWithoutType2) object; + return java.util.Objects.equals(e, other.e) + && java.util.Objects.equals(g, other.g); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(e, g); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithoutType2[") + .append("e=").append(e).append(",") + .append("g=").append(g) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithoutType2 e(java.lang.String newE) { + this.e = newE; + return this; + } + + public InheritanceWithoutType2 g(java.lang.String newG) { + this.g = newG; + return this; + } + + // getter/setter + + public java.lang.String getE() { + return e; + } + + public void setE(java.lang.String newE) { + this.e = newE; + } + + public java.lang.String getG() { + return g; + } + + public void setG(java.lang.String newG) { + this.g = newG; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/Model.java b/gen/main/java/testmodel/micronaut_record/Model.java new file mode 100644 index 00000000..5c6cc796 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/Model.java @@ -0,0 +1,828 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class Model { + + public static final java.lang.String JSON_PROPERTY_ID = "id"; + public static final java.lang.String JSON_PROPERTY_ID_WITH_EXAMPLE = "idWithExample"; + public static final java.lang.String JSON_PROPERTY_ID_WITH_DEFAULT = "idWithDefault"; + public static final java.lang.String JSON_PROPERTY_NAME = "name"; + public static final java.lang.String JSON_PROPERTY_NAME_WITH_EXAMPLE = "nameWithExample"; + public static final java.lang.String JSON_PROPERTY_NAME_WITH_DEFAULT = "nameWithDefault"; + public static final java.lang.String JSON_PROPERTY_DATE = "date"; + public static final java.lang.String JSON_PROPERTY_DATE_WITH_EXAMPLE = "dateWithExample"; + public static final java.lang.String JSON_PROPERTY_DATE_TIME = "date-time"; + public static final java.lang.String JSON_PROPERTY_DATE_TIME_WITH_EXAMPLE = "date-timeWithExample"; + public static final java.lang.String JSON_PROPERTY_NUMBER = "number"; + public static final java.lang.String JSON_PROPERTY_BINARY = "binary"; + public static final java.lang.String JSON_PROPERTY_BYTES = "bytes"; + public static final java.lang.String JSON_PROPERTY_ANY = "any"; + public static final java.lang.String JSON_PROPERTY_ARRAY = "array"; + public static final java.lang.String JSON_PROPERTY_ARRAY_WITH_EXAMPLE = "arrayWithExample"; + public static final java.lang.String JSON_PROPERTY_SET = "set"; + public static final java.lang.String JSON_PROPERTY_SET_WITH_EXAMPLES = "setWithExamples"; + public static final java.lang.String JSON_PROPERTY_MAP = "map"; + public static final java.lang.String JSON_PROPERTY_MAP_WITH_EXAMPLE = "mapWithExample"; + public static final java.lang.String JSON_PROPERTY_OPTIONAL_ARRAY = "optionalArray"; + public static final java.lang.String JSON_PROPERTY_OPTIONAL_SET = "optionalSet"; + public static final java.lang.String JSON_PROPERTY_OPTIONAL_MAP = "optionalMap"; + public static final java.lang.String JSON_PROPERTY_NULLABLE_STRING = "nullableString"; + public static final java.lang.String JSON_PROPERTY_NULLABLE_ARRAY = "nullableArray"; + public static final java.lang.String JSON_PROPERTY_NULLABLE_SET = "nullableSet"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_STRING = "defaultString"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_INTEGER = "defaultInteger"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_LONG = "defaultLong"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_NULLABLE = "defaultNullable"; + public static final java.lang.String JSON_PROPERTY_REFERENED_MODEL = "referenedModel"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer id; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer idWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID_WITH_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer idWithDefault = 32; + + @jakarta.validation.constraints.NotNull + @jakarta.validation.constraints.Size(max = 36) + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NAME) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String name; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NAME_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String nameWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NAME_WITH_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String nameWithDefault = "MyDefaultName"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.LocalDate date; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.LocalDate dateWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE_TIME) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.Instant dateTime; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE_TIME_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.Instant dateTimeWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NUMBER) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Double number; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_BINARY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private byte[] binary; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_BYTES) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private byte[] bytes; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ANY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private java.lang.Object any; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ARRAY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.util.List array = new java.util.ArrayList<>(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ARRAY_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.List arrayWithExample; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_SET) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.util.Set set = new java.util.LinkedHashSet<>(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_SET_WITH_EXAMPLES) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Set setWithExamples; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_MAP) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.util.Map map = new java.util.HashMap<>(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_MAP_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Map mapWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_OPTIONAL_ARRAY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.List optionalArray; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_OPTIONAL_SET) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Set optionalSet; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_OPTIONAL_MAP) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Map optionalMap; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NULLABLE_STRING) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private java.lang.String nullableString; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NULLABLE_ARRAY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private java.util.List nullableArray; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NULLABLE_SET) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private java.util.Set nullableSet; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_STRING) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String defaultString = "defaultStringValue"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_INTEGER) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer defaultInteger = 1234; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_LONG) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Long defaultLong = 5678l; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_NULLABLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private java.lang.String defaultNullable; + + @jakarta.validation.Valid + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_REFERENED_MODEL) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EnumerationModel referenedModel; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + Model other = (Model) object; + return java.util.Objects.equals(id, other.id) + && java.util.Objects.equals(idWithExample, other.idWithExample) + && java.util.Objects.equals(idWithDefault, other.idWithDefault) + && java.util.Objects.equals(name, other.name) + && java.util.Objects.equals(nameWithExample, other.nameWithExample) + && java.util.Objects.equals(nameWithDefault, other.nameWithDefault) + && java.util.Objects.equals(date, other.date) + && java.util.Objects.equals(dateWithExample, other.dateWithExample) + && java.util.Objects.equals(dateTime, other.dateTime) + && java.util.Objects.equals(dateTimeWithExample, other.dateTimeWithExample) + && java.util.Objects.equals(number, other.number) + && java.util.Arrays.equals(binary, other.binary) + && java.util.Arrays.equals(bytes, other.bytes) + && java.util.Objects.equals(any, other.any) + && java.util.Objects.equals(array, other.array) + && java.util.Objects.equals(arrayWithExample, other.arrayWithExample) + && java.util.Objects.equals(set, other.set) + && java.util.Objects.equals(setWithExamples, other.setWithExamples) + && java.util.Objects.equals(map, other.map) + && java.util.Objects.equals(mapWithExample, other.mapWithExample) + && java.util.Objects.equals(optionalArray, other.optionalArray) + && java.util.Objects.equals(optionalSet, other.optionalSet) + && java.util.Objects.equals(optionalMap, other.optionalMap) + && java.util.Objects.equals(nullableString, other.nullableString) + && java.util.Objects.equals(nullableArray, other.nullableArray) + && java.util.Objects.equals(nullableSet, other.nullableSet) + && java.util.Objects.equals(defaultString, other.defaultString) + && java.util.Objects.equals(defaultInteger, other.defaultInteger) + && java.util.Objects.equals(defaultLong, other.defaultLong) + && java.util.Objects.equals(defaultNullable, other.defaultNullable) + && java.util.Objects.equals(referenedModel, other.referenedModel); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(id, idWithExample, idWithDefault, name, nameWithExample, nameWithDefault, date, dateWithExample, dateTime, dateTimeWithExample, number, java.util.Arrays.hashCode(binary), java.util.Arrays.hashCode(bytes), any, array, arrayWithExample, set, setWithExamples, map, mapWithExample, optionalArray, optionalSet, optionalMap, nullableString, nullableArray, nullableSet, defaultString, defaultInteger, defaultLong, defaultNullable, referenedModel); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("Model[") + .append("id=").append(id).append(",") + .append("idWithExample=").append(idWithExample).append(",") + .append("idWithDefault=").append(idWithDefault).append(",") + .append("name=").append(name).append(",") + .append("nameWithExample=").append(nameWithExample).append(",") + .append("nameWithDefault=").append(nameWithDefault).append(",") + .append("date=").append(date).append(",") + .append("dateWithExample=").append(dateWithExample).append(",") + .append("dateTime=").append(dateTime).append(",") + .append("dateTimeWithExample=").append(dateTimeWithExample).append(",") + .append("number=").append(number).append(",") + .append("binary=").append(binary).append(",") + .append("bytes.length=").append(bytes == null ? null : bytes.length).append(",") + .append("any=").append(any).append(",") + .append("array=").append(array).append(",") + .append("arrayWithExample=").append(arrayWithExample).append(",") + .append("set=").append(set).append(",") + .append("setWithExamples=").append(setWithExamples).append(",") + .append("map=").append(map).append(",") + .append("mapWithExample=").append(mapWithExample).append(",") + .append("optionalArray=").append(optionalArray).append(",") + .append("optionalSet=").append(optionalSet).append(",") + .append("optionalMap=").append(optionalMap).append(",") + .append("nullableString=").append(nullableString).append(",") + .append("nullableArray=").append(nullableArray).append(",") + .append("nullableSet=").append(nullableSet).append(",") + .append("defaultString=").append(defaultString).append(",") + .append("defaultInteger=").append(defaultInteger).append(",") + .append("defaultLong=").append(defaultLong).append(",") + .append("defaultNullable=").append(defaultNullable).append(",") + .append("referenedModel=").append(referenedModel) + .append("]") + .toString(); + } + + // fluent + + public Model id(java.lang.Integer newId) { + this.id = newId; + return this; + } + + public Model idWithExample(java.lang.Integer newIdWithExample) { + this.idWithExample = newIdWithExample; + return this; + } + + public Model idWithDefault(java.lang.Integer newIdWithDefault) { + this.idWithDefault = newIdWithDefault; + return this; + } + + public Model name(java.lang.String newName) { + this.name = newName; + return this; + } + + public Model nameWithExample(java.lang.String newNameWithExample) { + this.nameWithExample = newNameWithExample; + return this; + } + + public Model nameWithDefault(java.lang.String newNameWithDefault) { + this.nameWithDefault = newNameWithDefault; + return this; + } + + public Model date(java.time.LocalDate newDate) { + this.date = newDate; + return this; + } + + public Model dateWithExample(java.time.LocalDate newDateWithExample) { + this.dateWithExample = newDateWithExample; + return this; + } + + public Model dateTime(java.time.Instant newDateTime) { + this.dateTime = newDateTime; + return this; + } + + public Model dateTimeWithExample(java.time.Instant newDateTimeWithExample) { + this.dateTimeWithExample = newDateTimeWithExample; + return this; + } + + public Model number(java.lang.Double newNumber) { + this.number = newNumber; + return this; + } + + public Model binary(byte[] newBinary) { + this.binary = newBinary; + return this; + } + + public Model bytes(byte[] newBytes) { + this.bytes = newBytes; + return this; + } + + public Model any(java.lang.Object newAny) { + this.any = newAny; + return this; + } + + public Model array(java.util.List newArray) { + this.array = newArray; + return this; + } + + public Model addArrayItem(java.lang.String arrayItem) { + if (this.array == null) { + this.array = new java.util.ArrayList<>(); + } + this.array.add(arrayItem); + return this; + } + + public Model removeArrayItem(java.lang.String arrayItem) { + if (this.array != null) { + this.array.remove(arrayItem); + } + return this; + } + + public Model arrayWithExample(java.util.List newArrayWithExample) { + this.arrayWithExample = newArrayWithExample; + return this; + } + + public Model addArrayWithExampleItem(java.lang.String arrayWithExampleItem) { + if (this.arrayWithExample == null) { + this.arrayWithExample = new java.util.ArrayList<>(); + } + this.arrayWithExample.add(arrayWithExampleItem); + return this; + } + + public Model removeArrayWithExampleItem(java.lang.String arrayWithExampleItem) { + if (this.arrayWithExample != null) { + this.arrayWithExample.remove(arrayWithExampleItem); + } + return this; + } + + public Model set(java.util.Set newSet) { + this.set = newSet; + return this; + } + + public Model addSetItem(java.lang.String setItem) { + if (this.set == null) { + this.set = new java.util.LinkedHashSet<>(); + } + this.set.add(setItem); + return this; + } + + public Model removeSetItem(java.lang.String setItem) { + if (this.set != null) { + this.set.remove(setItem); + } + return this; + } + + public Model setWithExamples(java.util.Set newSetWithExamples) { + this.setWithExamples = newSetWithExamples; + return this; + } + + public Model addSetWithExamplesItem(java.lang.String setWithExamplesItem) { + if (this.setWithExamples == null) { + this.setWithExamples = new java.util.LinkedHashSet<>(); + } + this.setWithExamples.add(setWithExamplesItem); + return this; + } + + public Model removeSetWithExamplesItem(java.lang.String setWithExamplesItem) { + if (this.setWithExamples != null) { + this.setWithExamples.remove(setWithExamplesItem); + } + return this; + } + + public Model map(java.util.Map newMap) { + this.map = newMap; + return this; + } + + public Model putMapItem(java.lang.String key, java.lang.String mapItem) { + if (this.map == null) { + this.map = new java.util.HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + public Model removeMapItem(java.lang.String key) { + if (this.map != null) { + this.map.remove(key); + } + return this; + } + + public Model mapWithExample(java.util.Map newMapWithExample) { + this.mapWithExample = newMapWithExample; + return this; + } + + public Model putMapWithExampleItem(java.lang.String key, java.lang.String mapWithExampleItem) { + if (this.mapWithExample == null) { + this.mapWithExample = new java.util.HashMap<>(); + } + this.mapWithExample.put(key, mapWithExampleItem); + return this; + } + + public Model removeMapWithExampleItem(java.lang.String key) { + if (this.mapWithExample != null) { + this.mapWithExample.remove(key); + } + return this; + } + + public Model optionalArray(java.util.List newOptionalArray) { + this.optionalArray = newOptionalArray; + return this; + } + + public Model addOptionalArrayItem(java.lang.String optionalArrayItem) { + if (this.optionalArray == null) { + this.optionalArray = new java.util.ArrayList<>(); + } + this.optionalArray.add(optionalArrayItem); + return this; + } + + public Model removeOptionalArrayItem(java.lang.String optionalArrayItem) { + if (this.optionalArray != null) { + this.optionalArray.remove(optionalArrayItem); + } + return this; + } + + public Model optionalSet(java.util.Set newOptionalSet) { + this.optionalSet = newOptionalSet; + return this; + } + + public Model addOptionalSetItem(java.lang.String optionalSetItem) { + if (this.optionalSet == null) { + this.optionalSet = new java.util.LinkedHashSet<>(); + } + this.optionalSet.add(optionalSetItem); + return this; + } + + public Model removeOptionalSetItem(java.lang.String optionalSetItem) { + if (this.optionalSet != null) { + this.optionalSet.remove(optionalSetItem); + } + return this; + } + + public Model optionalMap(java.util.Map newOptionalMap) { + this.optionalMap = newOptionalMap; + return this; + } + + public Model putOptionalMapItem(java.lang.String key, java.lang.String optionalMapItem) { + if (this.optionalMap == null) { + this.optionalMap = new java.util.HashMap<>(); + } + this.optionalMap.put(key, optionalMapItem); + return this; + } + + public Model removeOptionalMapItem(java.lang.String key) { + if (this.optionalMap != null) { + this.optionalMap.remove(key); + } + return this; + } + + public Model nullableString(java.lang.String newNullableString) { + this.nullableString = newNullableString; + return this; + } + + public Model nullableArray(java.util.List newNullableArray) { + this.nullableArray = newNullableArray; + return this; + } + + public Model addNullableArrayItem(java.lang.String nullableArrayItem) { + if (this.nullableArray == null) { + this.nullableArray = new java.util.ArrayList<>(); + } + this.nullableArray.add(nullableArrayItem); + return this; + } + + public Model removeNullableArrayItem(java.lang.String nullableArrayItem) { + if (this.nullableArray != null) { + this.nullableArray.remove(nullableArrayItem); + } + return this; + } + + public Model nullableSet(java.util.Set newNullableSet) { + this.nullableSet = newNullableSet; + return this; + } + + public Model addNullableSetItem(java.lang.String nullableSetItem) { + if (this.nullableSet == null) { + this.nullableSet = new java.util.LinkedHashSet<>(); + } + this.nullableSet.add(nullableSetItem); + return this; + } + + public Model removeNullableSetItem(java.lang.String nullableSetItem) { + if (this.nullableSet != null) { + this.nullableSet.remove(nullableSetItem); + } + return this; + } + + public Model defaultString(java.lang.String newDefaultString) { + this.defaultString = newDefaultString; + return this; + } + + public Model defaultInteger(java.lang.Integer newDefaultInteger) { + this.defaultInteger = newDefaultInteger; + return this; + } + + public Model defaultLong(java.lang.Long newDefaultLong) { + this.defaultLong = newDefaultLong; + return this; + } + + public Model defaultNullable(java.lang.String newDefaultNullable) { + this.defaultNullable = newDefaultNullable; + return this; + } + + public Model referenedModel(EnumerationModel newReferenedModel) { + this.referenedModel = newReferenedModel; + return this; + } + + // getter/setter + + public java.lang.Integer getId() { + return id; + } + + public void setId(java.lang.Integer newId) { + this.id = newId; + } + + public java.lang.Integer getIdWithExample() { + return idWithExample; + } + + public void setIdWithExample(java.lang.Integer newIdWithExample) { + this.idWithExample = newIdWithExample; + } + + public java.lang.Integer getIdWithDefault() { + return idWithDefault; + } + + public void setIdWithDefault(java.lang.Integer newIdWithDefault) { + this.idWithDefault = newIdWithDefault; + } + + public java.lang.String getName() { + return name; + } + + public void setName(java.lang.String newName) { + this.name = newName; + } + + public java.lang.String getNameWithExample() { + return nameWithExample; + } + + public void setNameWithExample(java.lang.String newNameWithExample) { + this.nameWithExample = newNameWithExample; + } + + public java.lang.String getNameWithDefault() { + return nameWithDefault; + } + + public void setNameWithDefault(java.lang.String newNameWithDefault) { + this.nameWithDefault = newNameWithDefault; + } + + public java.time.LocalDate getDate() { + return date; + } + + public void setDate(java.time.LocalDate newDate) { + this.date = newDate; + } + + public java.time.LocalDate getDateWithExample() { + return dateWithExample; + } + + public void setDateWithExample(java.time.LocalDate newDateWithExample) { + this.dateWithExample = newDateWithExample; + } + + public java.time.Instant getDateTime() { + return dateTime; + } + + public void setDateTime(java.time.Instant newDateTime) { + this.dateTime = newDateTime; + } + + public java.time.Instant getDateTimeWithExample() { + return dateTimeWithExample; + } + + public void setDateTimeWithExample(java.time.Instant newDateTimeWithExample) { + this.dateTimeWithExample = newDateTimeWithExample; + } + + public java.lang.Double getNumber() { + return number; + } + + public void setNumber(java.lang.Double newNumber) { + this.number = newNumber; + } + + public byte[] getBinary() { + return binary; + } + + public void setBinary(byte[] newBinary) { + this.binary = newBinary; + } + + public byte[] getBytes() { + return bytes; + } + + public void setBytes(byte[] newBytes) { + this.bytes = newBytes; + } + + public java.lang.Object getAny() { + return any; + } + + public void setAny(java.lang.Object newAny) { + this.any = newAny; + } + + public java.util.List getArray() { + return array; + } + + public void setArray(java.util.List newArray) { + this.array = newArray; + } + + public java.util.List getArrayWithExample() { + return arrayWithExample; + } + + public void setArrayWithExample(java.util.List newArrayWithExample) { + this.arrayWithExample = newArrayWithExample; + } + + public java.util.Set getSet() { + return set; + } + + public void setSet(java.util.Set newSet) { + this.set = newSet; + } + + public java.util.Set getSetWithExamples() { + return setWithExamples; + } + + public void setSetWithExamples(java.util.Set newSetWithExamples) { + this.setWithExamples = newSetWithExamples; + } + + public java.util.Map getMap() { + return map; + } + + public void setMap(java.util.Map newMap) { + this.map = newMap; + } + + public java.util.Map getMapWithExample() { + return mapWithExample; + } + + public void setMapWithExample(java.util.Map newMapWithExample) { + this.mapWithExample = newMapWithExample; + } + + public java.util.List getOptionalArray() { + return optionalArray; + } + + public void setOptionalArray(java.util.List newOptionalArray) { + this.optionalArray = newOptionalArray; + } + + public java.util.Set getOptionalSet() { + return optionalSet; + } + + public void setOptionalSet(java.util.Set newOptionalSet) { + this.optionalSet = newOptionalSet; + } + + public java.util.Map getOptionalMap() { + return optionalMap; + } + + public void setOptionalMap(java.util.Map newOptionalMap) { + this.optionalMap = newOptionalMap; + } + + public java.lang.String getNullableString() { + return nullableString; + } + + public void setNullableString(java.lang.String newNullableString) { + this.nullableString = newNullableString; + } + + public java.util.List getNullableArray() { + return nullableArray; + } + + public void setNullableArray(java.util.List newNullableArray) { + this.nullableArray = newNullableArray; + } + + public java.util.Set getNullableSet() { + return nullableSet; + } + + public void setNullableSet(java.util.Set newNullableSet) { + this.nullableSet = newNullableSet; + } + + public java.lang.String getDefaultString() { + return defaultString; + } + + public void setDefaultString(java.lang.String newDefaultString) { + this.defaultString = newDefaultString; + } + + public java.lang.Integer getDefaultInteger() { + return defaultInteger; + } + + public void setDefaultInteger(java.lang.Integer newDefaultInteger) { + this.defaultInteger = newDefaultInteger; + } + + public java.lang.Long getDefaultLong() { + return defaultLong; + } + + public void setDefaultLong(java.lang.Long newDefaultLong) { + this.defaultLong = newDefaultLong; + } + + public java.lang.String getDefaultNullable() { + return defaultNullable; + } + + public void setDefaultNullable(java.lang.String newDefaultNullable) { + this.defaultNullable = newDefaultNullable; + } + + public EnumerationModel getReferenedModel() { + return referenedModel; + } + + public void setReferenedModel(EnumerationModel newReferenedModel) { + this.referenedModel = newReferenedModel; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/OneOfImplementor1.java b/gen/main/java/testmodel/micronaut_record/OneOfImplementor1.java new file mode 100644 index 00000000..a6c9d0e2 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/OneOfImplementor1.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class OneOfImplementor1 implements OneOfInterface { + + public static final java.lang.String JSON_PROPERTY_PROPERTY = "property"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_PROPERTY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String property; + + @Override + public java.lang.String getType() { + return "Implementation1"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + OneOfImplementor1 other = (OneOfImplementor1) object; + return java.util.Objects.equals(property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(property); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("OneOfImplementor1[") + .append("property=").append(property) + .append("]") + .toString(); + } + + // fluent + + public OneOfImplementor1 property(java.lang.String newProperty) { + this.property = newProperty; + return this; + } + + // getter/setter + + public java.lang.String getProperty() { + return property; + } + + public void setProperty(java.lang.String newProperty) { + this.property = newProperty; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/OneOfImplementor2.java b/gen/main/java/testmodel/micronaut_record/OneOfImplementor2.java new file mode 100644 index 00000000..76ab1cbf --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/OneOfImplementor2.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class OneOfImplementor2 implements OneOfInterface { + + public static final java.lang.String JSON_PROPERTY_PROPERTY = "property"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_PROPERTY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Double property; + + @Override + public java.lang.String getType() { + return "Implementation2"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + OneOfImplementor2 other = (OneOfImplementor2) object; + return java.util.Objects.equals(property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(property); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("OneOfImplementor2[") + .append("property=").append(property) + .append("]") + .toString(); + } + + // fluent + + public OneOfImplementor2 property(java.lang.Double newProperty) { + this.property = newProperty; + return this; + } + + // getter/setter + + public java.lang.Double getProperty() { + return property; + } + + public void setProperty(java.lang.Double newProperty) { + this.property = newProperty; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/OneOfInterface.java b/gen/main/java/testmodel/micronaut_record/OneOfInterface.java new file mode 100644 index 00000000..313cf927 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/OneOfInterface.java @@ -0,0 +1,15 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = OneOfInterface.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = OneOfImplementor1.class, name = "Implementation1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = OneOfImplementor2.class, name = "Implementation2"), +}) +public sealed interface OneOfInterface permits OneOfImplementor1, OneOfImplementor2 { + + java.lang.String JSON_DISCRIMINATOR = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + java.lang.String getType(); +} diff --git a/gen/main/java/testmodel/micronaut_record/OneOfModel.java b/gen/main/java/testmodel/micronaut_record/OneOfModel.java new file mode 100644 index 00000000..250e52b2 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/OneOfModel.java @@ -0,0 +1,9 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.DEDUCTION, visible = true) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = FirstModel.class), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = SecondLevelModel.class) +}) +public sealed interface OneOfModel permits FirstModel, SecondLevelModel {} diff --git a/gen/main/java/testmodel/micronaut_record/PropertyTypeOne.java b/gen/main/java/testmodel/micronaut_record/PropertyTypeOne.java new file mode 100644 index 00000000..a56d2c70 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/PropertyTypeOne.java @@ -0,0 +1,87 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class PropertyTypeOne implements AdditionalPropertiesModelValue { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private Type type; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + PropertyTypeOne other = (PropertyTypeOne) object; + return java.util.Objects.equals(type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("PropertyTypeOne[") + .append("type=").append(type) + .append("]") + .toString(); + } + + // fluent + + public PropertyTypeOne type(Type newType) { + this.type = newType; + return this; + } + + // getter/setter + + public Type getType() { + return type; + } + + public void setType(Type newType) { + this.type = newType; + } + +public enum Type { + + ONE("one"); + + public static final java.lang.String ONE_VALUE = "one"; + + private final java.lang.String value; + + private Type(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static Type toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} +} diff --git a/gen/main/java/testmodel/micronaut_record/PropertyTypeTwo.java b/gen/main/java/testmodel/micronaut_record/PropertyTypeTwo.java new file mode 100644 index 00000000..81cc42ca --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/PropertyTypeTwo.java @@ -0,0 +1,87 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class PropertyTypeTwo implements AdditionalPropertiesModelValue { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private Type type; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + PropertyTypeTwo other = (PropertyTypeTwo) object; + return java.util.Objects.equals(type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("PropertyTypeTwo[") + .append("type=").append(type) + .append("]") + .toString(); + } + + // fluent + + public PropertyTypeTwo type(Type newType) { + this.type = newType; + return this; + } + + // getter/setter + + public Type getType() { + return type; + } + + public void setType(Type newType) { + this.type = newType; + } + +public enum Type { + + TWO("two"); + + public static final java.lang.String TWO_VALUE = "two"; + + private final java.lang.String value; + + private Type(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static Type toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} +} diff --git a/gen/main/java/testmodel/micronaut_record/SecondLevelModel.java b/gen/main/java/testmodel/micronaut_record/SecondLevelModel.java new file mode 100644 index 00000000..ba0cee1c --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/SecondLevelModel.java @@ -0,0 +1,9 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.DEDUCTION, visible = true) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = SecondLevelOneModel.class), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = SecondLevelTwoModel.class) +}) +public sealed interface SecondLevelModel extends OneOfModel permits SecondLevelOneModel, SecondLevelTwoModel {} diff --git a/gen/main/java/testmodel/micronaut_record/SecondLevelOneModel.java b/gen/main/java/testmodel/micronaut_record/SecondLevelOneModel.java new file mode 100644 index 00000000..0165f20f --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/SecondLevelOneModel.java @@ -0,0 +1,77 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class SecondLevelOneModel implements SecondLevelModel { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + public static final java.lang.String JSON_PROPERTY_ONE = "one"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String type; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ONE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String one; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + SecondLevelOneModel other = (SecondLevelOneModel) object; + return java.util.Objects.equals(type, other.type) + && java.util.Objects.equals(one, other.one); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type, one); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("SecondLevelOneModel[") + .append("type=").append(type).append(",") + .append("one=").append(one) + .append("]") + .toString(); + } + + // fluent + + public SecondLevelOneModel type(java.lang.String newType) { + this.type = newType; + return this; + } + + public SecondLevelOneModel one(java.lang.String newOne) { + this.one = newOne; + return this; + } + + // getter/setter + + public java.lang.String getType() { + return type; + } + + public void setType(java.lang.String newType) { + this.type = newType; + } + + public java.lang.String getOne() { + return one; + } + + public void setOne(java.lang.String newOne) { + this.one = newOne; + } +} diff --git a/gen/main/java/testmodel/micronaut_record/SecondLevelTwoModel.java b/gen/main/java/testmodel/micronaut_record/SecondLevelTwoModel.java new file mode 100644 index 00000000..f34c3dc4 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record/SecondLevelTwoModel.java @@ -0,0 +1,77 @@ +package testmodel.micronaut_record; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public final class SecondLevelTwoModel implements SecondLevelModel { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + public static final java.lang.String JSON_PROPERTY_TWO = "two"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String type; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TWO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String two; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + SecondLevelTwoModel other = (SecondLevelTwoModel) object; + return java.util.Objects.equals(type, other.type) + && java.util.Objects.equals(two, other.two); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type, two); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("SecondLevelTwoModel[") + .append("type=").append(type).append(",") + .append("two=").append(two) + .append("]") + .toString(); + } + + // fluent + + public SecondLevelTwoModel type(java.lang.String newType) { + this.type = newType; + return this; + } + + public SecondLevelTwoModel two(java.lang.String newTwo) { + this.two = newTwo; + return this; + } + + // getter/setter + + public java.lang.String getType() { + return type; + } + + public void setType(java.lang.String newType) { + this.type = newType; + } + + public java.lang.String getTwo() { + return two; + } + + public void setTwo(java.lang.String newTwo) { + this.two = newTwo; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModel.java b/gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModel.java new file mode 100644 index 00000000..5b8610c2 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModel.java @@ -0,0 +1,72 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class AdditionalPropertiesModel { + + public static final java.lang.String JSON_PROPERTY_ID = "id"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String id; + + private java.util.Map additionalProperties; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + AdditionalPropertiesModel other = (AdditionalPropertiesModel) object; + return java.util.Objects.equals(id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(id); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("AdditionalPropertiesModel[") + .append("id=").append(id) + .append("]") + .toString(); + } + + // fluent + + public AdditionalPropertiesModel id(java.lang.String newId) { + this.id = newId; + return this; + } + + @com.fasterxml.jackson.annotation.JsonAnyGetter + public java.util.Map getAdditionalProperties() { + return additionalProperties; + } + + @com.fasterxml.jackson.annotation.JsonAnySetter + public void setAdditionalProperties(java.lang.String propertyKey, AdditionalPropertiesModelValue value) { + if (this.additionalProperties == null) { + this.additionalProperties = new java.util.HashMap<>(); + } + this.additionalProperties.put(propertyKey, value); + } + + // getter/setter + + public java.lang.String getId() { + return id; + } + + public void setId(java.lang.String newId) { + this.id = newId; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModelValue.java b/gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModelValue.java new file mode 100644 index 00000000..1c7bad42 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/AdditionalPropertiesModelValue.java @@ -0,0 +1,9 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.DEDUCTION, visible = true) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = PropertyTypeOne.class), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = PropertyTypeTwo.class) +}) +public interface AdditionalPropertiesModelValue {} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/EnumerationInteger.java b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationInteger.java new file mode 100644 index 00000000..c5b03c48 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationInteger.java @@ -0,0 +1,40 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationInteger { + + NUMBER_MINUS_2147483648(-2147483648), + NUMBER_MINUS_1(-1), + NUMBER_0(0), + NUMBER_1(1), + NUMBER_2147483647(2147483647); + + public static final java.lang.Integer NUMBER_MINUS_2147483648_VALUE = -2147483648; + public static final java.lang.Integer NUMBER_MINUS_1_VALUE = -1; + public static final java.lang.Integer NUMBER_0_VALUE = 0; + public static final java.lang.Integer NUMBER_1_VALUE = 1; + public static final java.lang.Integer NUMBER_2147483647_VALUE = 2147483647; + + private final java.lang.Integer value; + + private EnumerationInteger(java.lang.Integer value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationInteger toEnum(java.lang.Integer value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.Integer value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.Integer getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/EnumerationModel.java b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationModel.java new file mode 100644 index 00000000..8d8a7b29 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationModel.java @@ -0,0 +1,181 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class EnumerationModel { + + public static final java.lang.String JSON_PROPERTY_STRING = "string"; + public static final java.lang.String JSON_PROPERTY_STRING_DEFAULT = "string-default"; + public static final java.lang.String JSON_PROPERTY_EMBEDDED = "embedded"; + public static final java.lang.String JSON_PROPERTY_EMBEDDED_DEFAULT = "embedded-default"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_STRING) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EnumerationString string; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_STRING_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EnumerationStringDefault stringDefault = EnumerationStringDefault.THREE; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_EMBEDDED) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private Embedded embedded; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_EMBEDDED_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EmbeddedDefault embeddedDefault = EmbeddedDefault.FOUR; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + EnumerationModel other = (EnumerationModel) object; + return java.util.Objects.equals(string, other.string) + && java.util.Objects.equals(stringDefault, other.stringDefault) + && java.util.Objects.equals(embedded, other.embedded) + && java.util.Objects.equals(embeddedDefault, other.embeddedDefault); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(string, stringDefault, embedded, embeddedDefault); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("EnumerationModel[") + .append("string=").append(string).append(",") + .append("stringDefault=").append(stringDefault).append(",") + .append("embedded=").append(embedded).append(",") + .append("embeddedDefault=").append(embeddedDefault) + .append("]") + .toString(); + } + + // fluent + + public EnumerationModel string(EnumerationString newString) { + this.string = newString; + return this; + } + + public EnumerationModel stringDefault(EnumerationStringDefault newStringDefault) { + this.stringDefault = newStringDefault; + return this; + } + + public EnumerationModel embedded(Embedded newEmbedded) { + this.embedded = newEmbedded; + return this; + } + + public EnumerationModel embeddedDefault(EmbeddedDefault newEmbeddedDefault) { + this.embeddedDefault = newEmbeddedDefault; + return this; + } + + // getter/setter + + public EnumerationString getString() { + return string; + } + + public void setString(EnumerationString newString) { + this.string = newString; + } + + public EnumerationStringDefault getStringDefault() { + return stringDefault; + } + + public void setStringDefault(EnumerationStringDefault newStringDefault) { + this.stringDefault = newStringDefault; + } + + public Embedded getEmbedded() { + return embedded; + } + + public void setEmbedded(Embedded newEmbedded) { + this.embedded = newEmbedded; + } + + public EmbeddedDefault getEmbeddedDefault() { + return embeddedDefault; + } + + public void setEmbeddedDefault(EmbeddedDefault newEmbeddedDefault) { + this.embeddedDefault = newEmbeddedDefault; + } + +public enum Embedded { + + FIRST("first"), + SECOND("second"); + + public static final java.lang.String FIRST_VALUE = "first"; + public static final java.lang.String SECOND_VALUE = "second"; + + private final java.lang.String value; + + private Embedded(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static Embedded toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} + +public enum EmbeddedDefault { + + THREE("three"), + FOUR("four"); + + public static final java.lang.String THREE_VALUE = "three"; + public static final java.lang.String FOUR_VALUE = "four"; + + private final java.lang.String value; + + private EmbeddedDefault(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EmbeddedDefault toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/EnumerationNumber.java b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationNumber.java new file mode 100644 index 00000000..dd0524e5 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationNumber.java @@ -0,0 +1,36 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationNumber { + + NUMBER_MINUS_1(-1D), + NUMBER_0(0D), + NUMBER_1(1D); + + public static final java.lang.Double NUMBER_MINUS_1_VALUE = -1D; + public static final java.lang.Double NUMBER_0_VALUE = 0D; + public static final java.lang.Double NUMBER_1_VALUE = 1D; + + private final java.lang.Double value; + + private EnumerationNumber(java.lang.Double value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationNumber toEnum(java.lang.Double value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.Double value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.Double getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/EnumerationString.java b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationString.java new file mode 100644 index 00000000..570fb959 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationString.java @@ -0,0 +1,34 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationString { + + ONE("one"), + TWO("two"); + + public static final java.lang.String ONE_VALUE = "one"; + public static final java.lang.String TWO_VALUE = "two"; + + private final java.lang.String value; + + private EnumerationString(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationString toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/EnumerationStringDefault.java b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationStringDefault.java new file mode 100644 index 00000000..b20e25d6 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/EnumerationStringDefault.java @@ -0,0 +1,34 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum EnumerationStringDefault { + + THREE("three"), + FOUR("four"); + + public static final java.lang.String THREE_VALUE = "three"; + public static final java.lang.String FOUR_VALUE = "four"; + + private final java.lang.String value; + + private EnumerationStringDefault(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static EnumerationStringDefault toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/FirstModel.java b/gen/main/java/testmodel/micronaut_record_nullable/FirstModel.java new file mode 100644 index 00000000..b28c2703 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/FirstModel.java @@ -0,0 +1,98 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class FirstModel implements OneOfModel { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + public static final java.lang.String JSON_PROPERTY_FIRST = "first"; + public static final java.lang.String JSON_PROPERTY_SECOND_LEVEL = "secondLevel"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String type; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FIRST) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String first; + + @jakarta.validation.Valid + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_SECOND_LEVEL) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private SecondLevelModel secondLevel; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + FirstModel other = (FirstModel) object; + return java.util.Objects.equals(type, other.type) + && java.util.Objects.equals(first, other.first) + && java.util.Objects.equals(secondLevel, other.secondLevel); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type, first, secondLevel); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("FirstModel[") + .append("type=").append(type).append(",") + .append("first=").append(first).append(",") + .append("secondLevel=").append(secondLevel) + .append("]") + .toString(); + } + + // fluent + + public FirstModel type(java.lang.String newType) { + this.type = newType; + return this; + } + + public FirstModel first(java.lang.String newFirst) { + this.first = newFirst; + return this; + } + + public FirstModel secondLevel(SecondLevelModel newSecondLevel) { + this.secondLevel = newSecondLevel; + return this; + } + + // getter/setter + + public java.lang.String getType() { + return type; + } + + public void setType(java.lang.String newType) { + this.type = newType; + } + + public java.lang.String getFirst() { + return first; + } + + public void setFirst(java.lang.String newFirst) { + this.first = newFirst; + } + + public SecondLevelModel getSecondLevel() { + return secondLevel; + } + + public void setSecondLevel(SecondLevelModel newSecondLevel) { + this.secondLevel = newSecondLevel; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceExtended.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceExtended.java new file mode 100644 index 00000000..7d657018 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceExtended.java @@ -0,0 +1,78 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceExtended implements InheritanceSimple { + + public static final java.lang.String JSON_PROPERTY_BAR = "bar"; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String foo; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_BAR) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String bar; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceExtended other = (InheritanceExtended) object; + return java.util.Objects.equals(foo, other.foo) + && java.util.Objects.equals(bar, other.bar); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(foo, bar); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceExtended[") + .append("foo=").append(foo).append(",") + .append("bar=").append(bar) + .append("]") + .toString(); + } + + // fluent + + public InheritanceExtended foo(java.lang.String newFoo) { + this.foo = newFoo; + return this; + } + + public InheritanceExtended bar(java.lang.String newBar) { + this.bar = newBar; + return this; + } + + // getter/setter + + public java.lang.String getFoo() { + return foo; + } + + public void setFoo(java.lang.String newFoo) { + this.foo = newFoo; + } + + public java.lang.String getBar() { + return bar; + } + + public void setBar(java.lang.String newBar) { + this.bar = newBar; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimple.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimple.java new file mode 100644 index 00000000..b9390e1d --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimple.java @@ -0,0 +1,15 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(as = InheritanceSimpleDefault.class) +public interface InheritanceSimple { + + java.lang.String JSON_PROPERTY_FOO = "foo"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + java.lang.String getFoo(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + void setFoo(java.lang.String newFoo); +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimpleDefault.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimpleDefault.java new file mode 100644 index 00000000..5a3ae325 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceSimpleDefault.java @@ -0,0 +1,56 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceSimpleDefault implements InheritanceSimple { + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_FOO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String foo; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceSimpleDefault other = (InheritanceSimpleDefault) object; + return java.util.Objects.equals(foo, other.foo); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(foo); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceSimpleDefault[") + .append("foo=").append(foo) + .append("]") + .toString(); + } + + // fluent + + public InheritanceSimpleDefault foo(java.lang.String newFoo) { + this.foo = newFoo; + return this; + } + + // getter/setter + + public java.lang.String getFoo() { + return foo; + } + + public void setFoo(java.lang.String newFoo) { + this.foo = newFoo; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType.java new file mode 100644 index 00000000..bf0758f5 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType.java @@ -0,0 +1,16 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = InheritanceWithEnumType.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithEnumType1.class, name = "Inheritance1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithEnumType2.class, name = "Inheritance2"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithEnumType3.class, name = "Inheritance3") +}) +public interface InheritanceWithEnumType { + + java.lang.String JSON_DISCRIMINATOR = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + InheritanceWithEnumTypeEnum getType(); +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType1.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType1.java new file mode 100644 index 00000000..c6558932 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType1.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithEnumType1 implements InheritanceWithEnumType { + + public static final java.lang.String JSON_PROPERTY_D = "d"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_D) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String d; + + @Override + public InheritanceWithEnumTypeEnum getType() { + return InheritanceWithEnumTypeEnum.INHERITANCE1; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithEnumType1 other = (InheritanceWithEnumType1) object; + return java.util.Objects.equals(d, other.d); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(d); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithEnumType1[") + .append("d=").append(d) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithEnumType1 d(java.lang.String newD) { + this.d = newD; + return this; + } + + // getter/setter + + public java.lang.String getD() { + return d; + } + + public void setD(java.lang.String newD) { + this.d = newD; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType2.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType2.java new file mode 100644 index 00000000..db78fa95 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType2.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithEnumType2 implements InheritanceWithEnumType { + + public static final java.lang.String JSON_PROPERTY_E = "e"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String e; + + @Override + public InheritanceWithEnumTypeEnum getType() { + return InheritanceWithEnumTypeEnum.INHERITANCE2; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithEnumType2 other = (InheritanceWithEnumType2) object; + return java.util.Objects.equals(e, other.e); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(e); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithEnumType2[") + .append("e=").append(e) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithEnumType2 e(java.lang.String newE) { + this.e = newE; + return this; + } + + // getter/setter + + public java.lang.String getE() { + return e; + } + + public void setE(java.lang.String newE) { + this.e = newE; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType3.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType3.java new file mode 100644 index 00000000..22919983 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumType3.java @@ -0,0 +1,37 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithEnumType3 implements InheritanceWithEnumType { + + @Override + public InheritanceWithEnumTypeEnum getType() { + return InheritanceWithEnumTypeEnum.INHERITANCE3; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + return super.equals(object); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithEnumType3[") + .append("]") + .toString(); + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumTypeEnum.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumTypeEnum.java new file mode 100644 index 00000000..48c0ba3d --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithEnumTypeEnum.java @@ -0,0 +1,36 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +public enum InheritanceWithEnumTypeEnum { + + INHERITANCE1("Inheritance1"), + INHERITANCE2("Inheritance2"), + INHERITANCE3("Inheritance3"); + + public static final java.lang.String INHERITANCE1_VALUE = "Inheritance1"; + public static final java.lang.String INHERITANCE2_VALUE = "Inheritance2"; + public static final java.lang.String INHERITANCE3_VALUE = "Inheritance3"; + + private final java.lang.String value; + + private InheritanceWithEnumTypeEnum(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static InheritanceWithEnumTypeEnum toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType.java new file mode 100644 index 00000000..8de697d6 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType.java @@ -0,0 +1,23 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = InheritanceWithStringType.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithStringType1.class, name = "Inheritance1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithStringType2.class, name = "Inheritance2") +}) +public interface InheritanceWithStringType { + + java.lang.String JSON_DISCRIMINATOR = "type"; + java.lang.String JSON_PROPERTY_A = "a"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + java.lang.String getType(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + java.lang.String getA(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + void setA(java.lang.String newA); +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType1.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType1.java new file mode 100644 index 00000000..9c9d1ec2 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType1.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithStringType1 implements InheritanceWithStringType { + + public static final java.lang.String JSON_PROPERTY_B = "b"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String a; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_B) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String b; + + @Override + public java.lang.String getType() { + return "Inheritance1"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithStringType1 other = (InheritanceWithStringType1) object; + return java.util.Objects.equals(a, other.a) + && java.util.Objects.equals(b, other.b); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(a, b); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithStringType1[") + .append("a=").append(a).append(",") + .append("b=").append(b) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithStringType1 a(java.lang.String newA) { + this.a = newA; + return this; + } + + public InheritanceWithStringType1 b(java.lang.String newB) { + this.b = newB; + return this; + } + + // getter/setter + + public java.lang.String getA() { + return a; + } + + public void setA(java.lang.String newA) { + this.a = newA; + } + + public java.lang.String getB() { + return b; + } + + public void setB(java.lang.String newB) { + this.b = newB; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType2.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType2.java new file mode 100644 index 00000000..15870fde --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithStringType2.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithStringType2 implements InheritanceWithStringType { + + public static final java.lang.String JSON_PROPERTY_C = "c"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_A) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String a; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_C) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String c; + + @Override + public java.lang.String getType() { + return "Inheritance2"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithStringType2 other = (InheritanceWithStringType2) object; + return java.util.Objects.equals(a, other.a) + && java.util.Objects.equals(c, other.c); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(a, c); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithStringType2[") + .append("a=").append(a).append(",") + .append("c=").append(c) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithStringType2 a(java.lang.String newA) { + this.a = newA; + return this; + } + + public InheritanceWithStringType2 c(java.lang.String newC) { + this.c = newC; + return this; + } + + // getter/setter + + public java.lang.String getA() { + return a; + } + + public void setA(java.lang.String newA) { + this.a = newA; + } + + public java.lang.String getC() { + return c; + } + + public void setC(java.lang.String newC) { + this.c = newC; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType.java new file mode 100644 index 00000000..ecf03fe5 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType.java @@ -0,0 +1,23 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = InheritanceWithoutType.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithoutType1.class, name = "Inheritance1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = InheritanceWithoutType2.class, name = "Inheritance2") +}) +public interface InheritanceWithoutType { + + java.lang.String JSON_DISCRIMINATOR = "type"; + java.lang.String JSON_PROPERTY_E = "e"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + java.lang.String getType(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + java.lang.String getE(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + void setE(java.lang.String newE); +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType1.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType1.java new file mode 100644 index 00000000..3b875777 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType1.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithoutType1 implements InheritanceWithoutType { + + public static final java.lang.String JSON_PROPERTY_F = "f"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String e; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_F) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String f; + + @Override + public java.lang.String getType() { + return "Inheritance1"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithoutType1 other = (InheritanceWithoutType1) object; + return java.util.Objects.equals(e, other.e) + && java.util.Objects.equals(f, other.f); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(e, f); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithoutType1[") + .append("e=").append(e).append(",") + .append("f=").append(f) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithoutType1 e(java.lang.String newE) { + this.e = newE; + return this; + } + + public InheritanceWithoutType1 f(java.lang.String newF) { + this.f = newF; + return this; + } + + // getter/setter + + public java.lang.String getE() { + return e; + } + + public void setE(java.lang.String newE) { + this.e = newE; + } + + public java.lang.String getF() { + return f; + } + + public void setF(java.lang.String newF) { + this.f = newF; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType2.java b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType2.java new file mode 100644 index 00000000..88de5351 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/InheritanceWithoutType2.java @@ -0,0 +1,81 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class InheritanceWithoutType2 implements InheritanceWithoutType { + + public static final java.lang.String JSON_PROPERTY_G = "g"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_E) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String e; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_G) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String g; + + @Override + public java.lang.String getType() { + return "Inheritance2"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + InheritanceWithoutType2 other = (InheritanceWithoutType2) object; + return java.util.Objects.equals(e, other.e) + && java.util.Objects.equals(g, other.g); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(e, g); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("InheritanceWithoutType2[") + .append("e=").append(e).append(",") + .append("g=").append(g) + .append("]") + .toString(); + } + + // fluent + + public InheritanceWithoutType2 e(java.lang.String newE) { + this.e = newE; + return this; + } + + public InheritanceWithoutType2 g(java.lang.String newG) { + this.g = newG; + return this; + } + + // getter/setter + + public java.lang.String getE() { + return e; + } + + public void setE(java.lang.String newE) { + this.e = newE; + } + + public java.lang.String getG() { + return g; + } + + public void setG(java.lang.String newG) { + this.g = newG; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/Model.java b/gen/main/java/testmodel/micronaut_record_nullable/Model.java new file mode 100644 index 00000000..04d8acf4 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/Model.java @@ -0,0 +1,828 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class Model { + + public static final java.lang.String JSON_PROPERTY_ID = "id"; + public static final java.lang.String JSON_PROPERTY_ID_WITH_EXAMPLE = "idWithExample"; + public static final java.lang.String JSON_PROPERTY_ID_WITH_DEFAULT = "idWithDefault"; + public static final java.lang.String JSON_PROPERTY_NAME = "name"; + public static final java.lang.String JSON_PROPERTY_NAME_WITH_EXAMPLE = "nameWithExample"; + public static final java.lang.String JSON_PROPERTY_NAME_WITH_DEFAULT = "nameWithDefault"; + public static final java.lang.String JSON_PROPERTY_DATE = "date"; + public static final java.lang.String JSON_PROPERTY_DATE_WITH_EXAMPLE = "dateWithExample"; + public static final java.lang.String JSON_PROPERTY_DATE_TIME = "date-time"; + public static final java.lang.String JSON_PROPERTY_DATE_TIME_WITH_EXAMPLE = "date-timeWithExample"; + public static final java.lang.String JSON_PROPERTY_NUMBER = "number"; + public static final java.lang.String JSON_PROPERTY_BINARY = "binary"; + public static final java.lang.String JSON_PROPERTY_BYTES = "bytes"; + public static final java.lang.String JSON_PROPERTY_ANY = "any"; + public static final java.lang.String JSON_PROPERTY_ARRAY = "array"; + public static final java.lang.String JSON_PROPERTY_ARRAY_WITH_EXAMPLE = "arrayWithExample"; + public static final java.lang.String JSON_PROPERTY_SET = "set"; + public static final java.lang.String JSON_PROPERTY_SET_WITH_EXAMPLES = "setWithExamples"; + public static final java.lang.String JSON_PROPERTY_MAP = "map"; + public static final java.lang.String JSON_PROPERTY_MAP_WITH_EXAMPLE = "mapWithExample"; + public static final java.lang.String JSON_PROPERTY_OPTIONAL_ARRAY = "optionalArray"; + public static final java.lang.String JSON_PROPERTY_OPTIONAL_SET = "optionalSet"; + public static final java.lang.String JSON_PROPERTY_OPTIONAL_MAP = "optionalMap"; + public static final java.lang.String JSON_PROPERTY_NULLABLE_STRING = "nullableString"; + public static final java.lang.String JSON_PROPERTY_NULLABLE_ARRAY = "nullableArray"; + public static final java.lang.String JSON_PROPERTY_NULLABLE_SET = "nullableSet"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_STRING = "defaultString"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_INTEGER = "defaultInteger"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_LONG = "defaultLong"; + public static final java.lang.String JSON_PROPERTY_DEFAULT_NULLABLE = "defaultNullable"; + public static final java.lang.String JSON_PROPERTY_REFERENED_MODEL = "referenedModel"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer id; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer idWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ID_WITH_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer idWithDefault = 32; + + @jakarta.validation.constraints.NotNull + @jakarta.validation.constraints.Size(max = 36) + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NAME) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.lang.String name; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NAME_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String nameWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NAME_WITH_DEFAULT) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String nameWithDefault = "MyDefaultName"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.LocalDate date; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.LocalDate dateWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE_TIME) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.Instant dateTime; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DATE_TIME_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.time.Instant dateTimeWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NUMBER) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Double number; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_BINARY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private byte[] binary; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_BYTES) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private byte[] bytes; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ANY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private org.openapitools.jackson.nullable.JsonNullable any = org.openapitools.jackson.nullable.JsonNullable.of(null); + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ARRAY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.util.List array = new java.util.ArrayList<>(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ARRAY_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.List arrayWithExample; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_SET) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.util.Set set = new java.util.LinkedHashSet<>(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_SET_WITH_EXAMPLES) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Set setWithExamples; + + @jakarta.validation.constraints.NotNull + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_MAP) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.ALWAYS) + private java.util.Map map = new java.util.HashMap<>(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_MAP_WITH_EXAMPLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Map mapWithExample; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_OPTIONAL_ARRAY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.List optionalArray; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_OPTIONAL_SET) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Set optionalSet; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_OPTIONAL_MAP) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.util.Map optionalMap; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NULLABLE_STRING) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private org.openapitools.jackson.nullable.JsonNullable nullableString = org.openapitools.jackson.nullable.JsonNullable.undefined(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NULLABLE_ARRAY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private org.openapitools.jackson.nullable.JsonNullable> nullableArray = org.openapitools.jackson.nullable.JsonNullable.undefined(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_NULLABLE_SET) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private org.openapitools.jackson.nullable.JsonNullable> nullableSet = org.openapitools.jackson.nullable.JsonNullable.undefined(); + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_STRING) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String defaultString = "defaultStringValue"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_INTEGER) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Integer defaultInteger = 1234; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_LONG) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Long defaultLong = 5678l; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_DEFAULT_NULLABLE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_ABSENT) + private org.openapitools.jackson.nullable.JsonNullable defaultNullable = org.openapitools.jackson.nullable.JsonNullable.of("defaultNullableValue"); + + @jakarta.validation.Valid + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_REFERENED_MODEL) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private EnumerationModel referenedModel; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + Model other = (Model) object; + return java.util.Objects.equals(id, other.id) + && java.util.Objects.equals(idWithExample, other.idWithExample) + && java.util.Objects.equals(idWithDefault, other.idWithDefault) + && java.util.Objects.equals(name, other.name) + && java.util.Objects.equals(nameWithExample, other.nameWithExample) + && java.util.Objects.equals(nameWithDefault, other.nameWithDefault) + && java.util.Objects.equals(date, other.date) + && java.util.Objects.equals(dateWithExample, other.dateWithExample) + && java.util.Objects.equals(dateTime, other.dateTime) + && java.util.Objects.equals(dateTimeWithExample, other.dateTimeWithExample) + && java.util.Objects.equals(number, other.number) + && java.util.Arrays.equals(binary, other.binary) + && java.util.Arrays.equals(bytes, other.bytes) + && java.util.Objects.equals(any, other.any) + && java.util.Objects.equals(array, other.array) + && java.util.Objects.equals(arrayWithExample, other.arrayWithExample) + && java.util.Objects.equals(set, other.set) + && java.util.Objects.equals(setWithExamples, other.setWithExamples) + && java.util.Objects.equals(map, other.map) + && java.util.Objects.equals(mapWithExample, other.mapWithExample) + && java.util.Objects.equals(optionalArray, other.optionalArray) + && java.util.Objects.equals(optionalSet, other.optionalSet) + && java.util.Objects.equals(optionalMap, other.optionalMap) + && java.util.Objects.equals(nullableString, other.nullableString) + && java.util.Objects.equals(nullableArray, other.nullableArray) + && java.util.Objects.equals(nullableSet, other.nullableSet) + && java.util.Objects.equals(defaultString, other.defaultString) + && java.util.Objects.equals(defaultInteger, other.defaultInteger) + && java.util.Objects.equals(defaultLong, other.defaultLong) + && java.util.Objects.equals(defaultNullable, other.defaultNullable) + && java.util.Objects.equals(referenedModel, other.referenedModel); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(id, idWithExample, idWithDefault, name, nameWithExample, nameWithDefault, date, dateWithExample, dateTime, dateTimeWithExample, number, java.util.Arrays.hashCode(binary), java.util.Arrays.hashCode(bytes), any, array, arrayWithExample, set, setWithExamples, map, mapWithExample, optionalArray, optionalSet, optionalMap, nullableString, nullableArray, nullableSet, defaultString, defaultInteger, defaultLong, defaultNullable, referenedModel); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("Model[") + .append("id=").append(id).append(",") + .append("idWithExample=").append(idWithExample).append(",") + .append("idWithDefault=").append(idWithDefault).append(",") + .append("name=").append(name).append(",") + .append("nameWithExample=").append(nameWithExample).append(",") + .append("nameWithDefault=").append(nameWithDefault).append(",") + .append("date=").append(date).append(",") + .append("dateWithExample=").append(dateWithExample).append(",") + .append("dateTime=").append(dateTime).append(",") + .append("dateTimeWithExample=").append(dateTimeWithExample).append(",") + .append("number=").append(number).append(",") + .append("binary=").append(binary).append(",") + .append("bytes.length=").append(bytes == null ? null : bytes.length).append(",") + .append("any=").append(any).append(",") + .append("array=").append(array).append(",") + .append("arrayWithExample=").append(arrayWithExample).append(",") + .append("set=").append(set).append(",") + .append("setWithExamples=").append(setWithExamples).append(",") + .append("map=").append(map).append(",") + .append("mapWithExample=").append(mapWithExample).append(",") + .append("optionalArray=").append(optionalArray).append(",") + .append("optionalSet=").append(optionalSet).append(",") + .append("optionalMap=").append(optionalMap).append(",") + .append("nullableString=").append(nullableString).append(",") + .append("nullableArray=").append(nullableArray).append(",") + .append("nullableSet=").append(nullableSet).append(",") + .append("defaultString=").append(defaultString).append(",") + .append("defaultInteger=").append(defaultInteger).append(",") + .append("defaultLong=").append(defaultLong).append(",") + .append("defaultNullable=").append(defaultNullable).append(",") + .append("referenedModel=").append(referenedModel) + .append("]") + .toString(); + } + + // fluent + + public Model id(java.lang.Integer newId) { + this.id = newId; + return this; + } + + public Model idWithExample(java.lang.Integer newIdWithExample) { + this.idWithExample = newIdWithExample; + return this; + } + + public Model idWithDefault(java.lang.Integer newIdWithDefault) { + this.idWithDefault = newIdWithDefault; + return this; + } + + public Model name(java.lang.String newName) { + this.name = newName; + return this; + } + + public Model nameWithExample(java.lang.String newNameWithExample) { + this.nameWithExample = newNameWithExample; + return this; + } + + public Model nameWithDefault(java.lang.String newNameWithDefault) { + this.nameWithDefault = newNameWithDefault; + return this; + } + + public Model date(java.time.LocalDate newDate) { + this.date = newDate; + return this; + } + + public Model dateWithExample(java.time.LocalDate newDateWithExample) { + this.dateWithExample = newDateWithExample; + return this; + } + + public Model dateTime(java.time.Instant newDateTime) { + this.dateTime = newDateTime; + return this; + } + + public Model dateTimeWithExample(java.time.Instant newDateTimeWithExample) { + this.dateTimeWithExample = newDateTimeWithExample; + return this; + } + + public Model number(java.lang.Double newNumber) { + this.number = newNumber; + return this; + } + + public Model binary(byte[] newBinary) { + this.binary = newBinary; + return this; + } + + public Model bytes(byte[] newBytes) { + this.bytes = newBytes; + return this; + } + + public Model any(org.openapitools.jackson.nullable.JsonNullable newAny) { + this.any = newAny; + return this; + } + + public Model array(java.util.List newArray) { + this.array = newArray; + return this; + } + + public Model addArrayItem(java.lang.String arrayItem) { + if (this.array == null) { + this.array = new java.util.ArrayList<>(); + } + this.array.add(arrayItem); + return this; + } + + public Model removeArrayItem(java.lang.String arrayItem) { + if (this.array != null) { + this.array.remove(arrayItem); + } + return this; + } + + public Model arrayWithExample(java.util.List newArrayWithExample) { + this.arrayWithExample = newArrayWithExample; + return this; + } + + public Model addArrayWithExampleItem(java.lang.String arrayWithExampleItem) { + if (this.arrayWithExample == null) { + this.arrayWithExample = new java.util.ArrayList<>(); + } + this.arrayWithExample.add(arrayWithExampleItem); + return this; + } + + public Model removeArrayWithExampleItem(java.lang.String arrayWithExampleItem) { + if (this.arrayWithExample != null) { + this.arrayWithExample.remove(arrayWithExampleItem); + } + return this; + } + + public Model set(java.util.Set newSet) { + this.set = newSet; + return this; + } + + public Model addSetItem(java.lang.String setItem) { + if (this.set == null) { + this.set = new java.util.LinkedHashSet<>(); + } + this.set.add(setItem); + return this; + } + + public Model removeSetItem(java.lang.String setItem) { + if (this.set != null) { + this.set.remove(setItem); + } + return this; + } + + public Model setWithExamples(java.util.Set newSetWithExamples) { + this.setWithExamples = newSetWithExamples; + return this; + } + + public Model addSetWithExamplesItem(java.lang.String setWithExamplesItem) { + if (this.setWithExamples == null) { + this.setWithExamples = new java.util.LinkedHashSet<>(); + } + this.setWithExamples.add(setWithExamplesItem); + return this; + } + + public Model removeSetWithExamplesItem(java.lang.String setWithExamplesItem) { + if (this.setWithExamples != null) { + this.setWithExamples.remove(setWithExamplesItem); + } + return this; + } + + public Model map(java.util.Map newMap) { + this.map = newMap; + return this; + } + + public Model putMapItem(java.lang.String key, java.lang.String mapItem) { + if (this.map == null) { + this.map = new java.util.HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + public Model removeMapItem(java.lang.String key) { + if (this.map != null) { + this.map.remove(key); + } + return this; + } + + public Model mapWithExample(java.util.Map newMapWithExample) { + this.mapWithExample = newMapWithExample; + return this; + } + + public Model putMapWithExampleItem(java.lang.String key, java.lang.String mapWithExampleItem) { + if (this.mapWithExample == null) { + this.mapWithExample = new java.util.HashMap<>(); + } + this.mapWithExample.put(key, mapWithExampleItem); + return this; + } + + public Model removeMapWithExampleItem(java.lang.String key) { + if (this.mapWithExample != null) { + this.mapWithExample.remove(key); + } + return this; + } + + public Model optionalArray(java.util.List newOptionalArray) { + this.optionalArray = newOptionalArray; + return this; + } + + public Model addOptionalArrayItem(java.lang.String optionalArrayItem) { + if (this.optionalArray == null) { + this.optionalArray = new java.util.ArrayList<>(); + } + this.optionalArray.add(optionalArrayItem); + return this; + } + + public Model removeOptionalArrayItem(java.lang.String optionalArrayItem) { + if (this.optionalArray != null) { + this.optionalArray.remove(optionalArrayItem); + } + return this; + } + + public Model optionalSet(java.util.Set newOptionalSet) { + this.optionalSet = newOptionalSet; + return this; + } + + public Model addOptionalSetItem(java.lang.String optionalSetItem) { + if (this.optionalSet == null) { + this.optionalSet = new java.util.LinkedHashSet<>(); + } + this.optionalSet.add(optionalSetItem); + return this; + } + + public Model removeOptionalSetItem(java.lang.String optionalSetItem) { + if (this.optionalSet != null) { + this.optionalSet.remove(optionalSetItem); + } + return this; + } + + public Model optionalMap(java.util.Map newOptionalMap) { + this.optionalMap = newOptionalMap; + return this; + } + + public Model putOptionalMapItem(java.lang.String key, java.lang.String optionalMapItem) { + if (this.optionalMap == null) { + this.optionalMap = new java.util.HashMap<>(); + } + this.optionalMap.put(key, optionalMapItem); + return this; + } + + public Model removeOptionalMapItem(java.lang.String key) { + if (this.optionalMap != null) { + this.optionalMap.remove(key); + } + return this; + } + + public Model nullableString(org.openapitools.jackson.nullable.JsonNullable newNullableString) { + this.nullableString = newNullableString; + return this; + } + + public Model nullableArray(org.openapitools.jackson.nullable.JsonNullable> newNullableArray) { + this.nullableArray = newNullableArray; + return this; + } + + public Model addNullableArrayItem(java.lang.String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = org.openapitools.jackson.nullable.JsonNullable.>of(new java.util.ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + public Model removeNullableArrayItem(java.lang.String nullableArrayItem) { + if (this.nullableArray != null && this.nullableArray.isPresent()) { + this.nullableArray.get().remove(nullableArrayItem); + } + return this; + } + + public Model nullableSet(org.openapitools.jackson.nullable.JsonNullable> newNullableSet) { + this.nullableSet = newNullableSet; + return this; + } + + public Model addNullableSetItem(java.lang.String nullableSetItem) { + if (this.nullableSet == null || !this.nullableSet.isPresent()) { + this.nullableSet = org.openapitools.jackson.nullable.JsonNullable.>of(new java.util.LinkedHashSet<>()); + } + this.nullableSet.get().add(nullableSetItem); + return this; + } + + public Model removeNullableSetItem(java.lang.String nullableSetItem) { + if (this.nullableSet != null && this.nullableSet.isPresent()) { + this.nullableSet.get().remove(nullableSetItem); + } + return this; + } + + public Model defaultString(java.lang.String newDefaultString) { + this.defaultString = newDefaultString; + return this; + } + + public Model defaultInteger(java.lang.Integer newDefaultInteger) { + this.defaultInteger = newDefaultInteger; + return this; + } + + public Model defaultLong(java.lang.Long newDefaultLong) { + this.defaultLong = newDefaultLong; + return this; + } + + public Model defaultNullable(org.openapitools.jackson.nullable.JsonNullable newDefaultNullable) { + this.defaultNullable = newDefaultNullable; + return this; + } + + public Model referenedModel(EnumerationModel newReferenedModel) { + this.referenedModel = newReferenedModel; + return this; + } + + // getter/setter + + public java.lang.Integer getId() { + return id; + } + + public void setId(java.lang.Integer newId) { + this.id = newId; + } + + public java.lang.Integer getIdWithExample() { + return idWithExample; + } + + public void setIdWithExample(java.lang.Integer newIdWithExample) { + this.idWithExample = newIdWithExample; + } + + public java.lang.Integer getIdWithDefault() { + return idWithDefault; + } + + public void setIdWithDefault(java.lang.Integer newIdWithDefault) { + this.idWithDefault = newIdWithDefault; + } + + public java.lang.String getName() { + return name; + } + + public void setName(java.lang.String newName) { + this.name = newName; + } + + public java.lang.String getNameWithExample() { + return nameWithExample; + } + + public void setNameWithExample(java.lang.String newNameWithExample) { + this.nameWithExample = newNameWithExample; + } + + public java.lang.String getNameWithDefault() { + return nameWithDefault; + } + + public void setNameWithDefault(java.lang.String newNameWithDefault) { + this.nameWithDefault = newNameWithDefault; + } + + public java.time.LocalDate getDate() { + return date; + } + + public void setDate(java.time.LocalDate newDate) { + this.date = newDate; + } + + public java.time.LocalDate getDateWithExample() { + return dateWithExample; + } + + public void setDateWithExample(java.time.LocalDate newDateWithExample) { + this.dateWithExample = newDateWithExample; + } + + public java.time.Instant getDateTime() { + return dateTime; + } + + public void setDateTime(java.time.Instant newDateTime) { + this.dateTime = newDateTime; + } + + public java.time.Instant getDateTimeWithExample() { + return dateTimeWithExample; + } + + public void setDateTimeWithExample(java.time.Instant newDateTimeWithExample) { + this.dateTimeWithExample = newDateTimeWithExample; + } + + public java.lang.Double getNumber() { + return number; + } + + public void setNumber(java.lang.Double newNumber) { + this.number = newNumber; + } + + public byte[] getBinary() { + return binary; + } + + public void setBinary(byte[] newBinary) { + this.binary = newBinary; + } + + public byte[] getBytes() { + return bytes; + } + + public void setBytes(byte[] newBytes) { + this.bytes = newBytes; + } + + public org.openapitools.jackson.nullable.JsonNullable getAny() { + return any; + } + + public void setAny(org.openapitools.jackson.nullable.JsonNullable newAny) { + this.any = newAny; + } + + public java.util.List getArray() { + return array; + } + + public void setArray(java.util.List newArray) { + this.array = newArray; + } + + public java.util.List getArrayWithExample() { + return arrayWithExample; + } + + public void setArrayWithExample(java.util.List newArrayWithExample) { + this.arrayWithExample = newArrayWithExample; + } + + public java.util.Set getSet() { + return set; + } + + public void setSet(java.util.Set newSet) { + this.set = newSet; + } + + public java.util.Set getSetWithExamples() { + return setWithExamples; + } + + public void setSetWithExamples(java.util.Set newSetWithExamples) { + this.setWithExamples = newSetWithExamples; + } + + public java.util.Map getMap() { + return map; + } + + public void setMap(java.util.Map newMap) { + this.map = newMap; + } + + public java.util.Map getMapWithExample() { + return mapWithExample; + } + + public void setMapWithExample(java.util.Map newMapWithExample) { + this.mapWithExample = newMapWithExample; + } + + public java.util.List getOptionalArray() { + return optionalArray; + } + + public void setOptionalArray(java.util.List newOptionalArray) { + this.optionalArray = newOptionalArray; + } + + public java.util.Set getOptionalSet() { + return optionalSet; + } + + public void setOptionalSet(java.util.Set newOptionalSet) { + this.optionalSet = newOptionalSet; + } + + public java.util.Map getOptionalMap() { + return optionalMap; + } + + public void setOptionalMap(java.util.Map newOptionalMap) { + this.optionalMap = newOptionalMap; + } + + public org.openapitools.jackson.nullable.JsonNullable getNullableString() { + return nullableString; + } + + public void setNullableString(org.openapitools.jackson.nullable.JsonNullable newNullableString) { + this.nullableString = newNullableString; + } + + public org.openapitools.jackson.nullable.JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(org.openapitools.jackson.nullable.JsonNullable> newNullableArray) { + this.nullableArray = newNullableArray; + } + + public org.openapitools.jackson.nullable.JsonNullable> getNullableSet() { + return nullableSet; + } + + public void setNullableSet(org.openapitools.jackson.nullable.JsonNullable> newNullableSet) { + this.nullableSet = newNullableSet; + } + + public java.lang.String getDefaultString() { + return defaultString; + } + + public void setDefaultString(java.lang.String newDefaultString) { + this.defaultString = newDefaultString; + } + + public java.lang.Integer getDefaultInteger() { + return defaultInteger; + } + + public void setDefaultInteger(java.lang.Integer newDefaultInteger) { + this.defaultInteger = newDefaultInteger; + } + + public java.lang.Long getDefaultLong() { + return defaultLong; + } + + public void setDefaultLong(java.lang.Long newDefaultLong) { + this.defaultLong = newDefaultLong; + } + + public org.openapitools.jackson.nullable.JsonNullable getDefaultNullable() { + return defaultNullable; + } + + public void setDefaultNullable(org.openapitools.jackson.nullable.JsonNullable newDefaultNullable) { + this.defaultNullable = newDefaultNullable; + } + + public EnumerationModel getReferenedModel() { + return referenedModel; + } + + public void setReferenedModel(EnumerationModel newReferenedModel) { + this.referenedModel = newReferenedModel; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor1.java b/gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor1.java new file mode 100644 index 00000000..d25a81e4 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor1.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class OneOfImplementor1 implements OneOfInterface { + + public static final java.lang.String JSON_PROPERTY_PROPERTY = "property"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_PROPERTY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String property; + + @Override + public java.lang.String getType() { + return "Implementation1"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + OneOfImplementor1 other = (OneOfImplementor1) object; + return java.util.Objects.equals(property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(property); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("OneOfImplementor1[") + .append("property=").append(property) + .append("]") + .toString(); + } + + // fluent + + public OneOfImplementor1 property(java.lang.String newProperty) { + this.property = newProperty; + return this; + } + + // getter/setter + + public java.lang.String getProperty() { + return property; + } + + public void setProperty(java.lang.String newProperty) { + this.property = newProperty; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor2.java b/gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor2.java new file mode 100644 index 00000000..ad412ea5 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/OneOfImplementor2.java @@ -0,0 +1,62 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class OneOfImplementor2 implements OneOfInterface { + + public static final java.lang.String JSON_PROPERTY_PROPERTY = "property"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_PROPERTY) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.Double property; + + @Override + public java.lang.String getType() { + return "Implementation2"; + } + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + OneOfImplementor2 other = (OneOfImplementor2) object; + return java.util.Objects.equals(property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(property); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("OneOfImplementor2[") + .append("property=").append(property) + .append("]") + .toString(); + } + + // fluent + + public OneOfImplementor2 property(java.lang.Double newProperty) { + this.property = newProperty; + return this; + } + + // getter/setter + + public java.lang.Double getProperty() { + return property; + } + + public void setProperty(java.lang.Double newProperty) { + this.property = newProperty; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/OneOfInterface.java b/gen/main/java/testmodel/micronaut_record_nullable/OneOfInterface.java new file mode 100644 index 00000000..6e875a61 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/OneOfInterface.java @@ -0,0 +1,15 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = OneOfInterface.JSON_DISCRIMINATOR) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = OneOfImplementor1.class, name = "Implementation1"), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = OneOfImplementor2.class, name = "Implementation2"), +}) +public interface OneOfInterface { + + java.lang.String JSON_DISCRIMINATOR = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_DISCRIMINATOR) + java.lang.String getType(); +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/OneOfModel.java b/gen/main/java/testmodel/micronaut_record_nullable/OneOfModel.java new file mode 100644 index 00000000..4e884e90 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/OneOfModel.java @@ -0,0 +1,9 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.DEDUCTION, visible = true) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = FirstModel.class), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = SecondLevelModel.class) +}) +public interface OneOfModel {} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeOne.java b/gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeOne.java new file mode 100644 index 00000000..8cc21bd8 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeOne.java @@ -0,0 +1,87 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class PropertyTypeOne implements AdditionalPropertiesModelValue { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private Type type; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + PropertyTypeOne other = (PropertyTypeOne) object; + return java.util.Objects.equals(type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("PropertyTypeOne[") + .append("type=").append(type) + .append("]") + .toString(); + } + + // fluent + + public PropertyTypeOne type(Type newType) { + this.type = newType; + return this; + } + + // getter/setter + + public Type getType() { + return type; + } + + public void setType(Type newType) { + this.type = newType; + } + +public enum Type { + + ONE("one"); + + public static final java.lang.String ONE_VALUE = "one"; + + private final java.lang.String value; + + private Type(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static Type toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeTwo.java b/gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeTwo.java new file mode 100644 index 00000000..d79c1cee --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/PropertyTypeTwo.java @@ -0,0 +1,87 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class PropertyTypeTwo implements AdditionalPropertiesModelValue { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private Type type; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + PropertyTypeTwo other = (PropertyTypeTwo) object; + return java.util.Objects.equals(type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("PropertyTypeTwo[") + .append("type=").append(type) + .append("]") + .toString(); + } + + // fluent + + public PropertyTypeTwo type(Type newType) { + this.type = newType; + return this; + } + + // getter/setter + + public Type getType() { + return type; + } + + public void setType(Type newType) { + this.type = newType; + } + +public enum Type { + + TWO("two"); + + public static final java.lang.String TWO_VALUE = "two"; + + private final java.lang.String value; + + private Type(java.lang.String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static Type toEnum(java.lang.String value) { + return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); + } + + public static java.util.Optional toOptional(java.lang.String value) { + return java.util.Arrays + .stream(values()) + .filter(e -> e.value.equals(value)) + .findAny(); + } + + @com.fasterxml.jackson.annotation.JsonValue + public java.lang.String getValue() { + return value; + } +} +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelModel.java b/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelModel.java new file mode 100644 index 00000000..73d6b4e0 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelModel.java @@ -0,0 +1,9 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.DEDUCTION, visible = true) +@com.fasterxml.jackson.annotation.JsonSubTypes({ + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = SecondLevelOneModel.class), + @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = SecondLevelTwoModel.class) +}) +public interface SecondLevelModel extends OneOfModel {} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelOneModel.java b/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelOneModel.java new file mode 100644 index 00000000..6538ccf6 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelOneModel.java @@ -0,0 +1,77 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class SecondLevelOneModel implements SecondLevelModel { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + public static final java.lang.String JSON_PROPERTY_ONE = "one"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String type; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_ONE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String one; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + SecondLevelOneModel other = (SecondLevelOneModel) object; + return java.util.Objects.equals(type, other.type) + && java.util.Objects.equals(one, other.one); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type, one); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("SecondLevelOneModel[") + .append("type=").append(type).append(",") + .append("one=").append(one) + .append("]") + .toString(); + } + + // fluent + + public SecondLevelOneModel type(java.lang.String newType) { + this.type = newType; + return this; + } + + public SecondLevelOneModel one(java.lang.String newOne) { + this.one = newOne; + return this; + } + + // getter/setter + + public java.lang.String getType() { + return type; + } + + public void setType(java.lang.String newType) { + this.type = newType; + } + + public java.lang.String getOne() { + return one; + } + + public void setOne(java.lang.String newOne) { + this.one = newOne; + } +} diff --git a/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelTwoModel.java b/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelTwoModel.java new file mode 100644 index 00000000..cdee4ac3 --- /dev/null +++ b/gen/main/java/testmodel/micronaut_record_nullable/SecondLevelTwoModel.java @@ -0,0 +1,77 @@ +package testmodel.micronaut_record_nullable; + +@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") +@io.micronaut.serde.annotation.Serdeable +public class SecondLevelTwoModel implements SecondLevelModel { + + public static final java.lang.String JSON_PROPERTY_TYPE = "type"; + public static final java.lang.String JSON_PROPERTY_TWO = "two"; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TYPE) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String type; + + @com.fasterxml.jackson.annotation.JsonProperty(JSON_PROPERTY_TWO) + @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) + private java.lang.String two; + + // methods + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + SecondLevelTwoModel other = (SecondLevelTwoModel) object; + return java.util.Objects.equals(type, other.type) + && java.util.Objects.equals(two, other.two); + } + + @Override + public int hashCode() { + return java.util.Objects.hash(type, two); + } + + @Override + public java.lang.String toString() { + return new java.lang.StringBuilder() + .append("SecondLevelTwoModel[") + .append("type=").append(type).append(",") + .append("two=").append(two) + .append("]") + .toString(); + } + + // fluent + + public SecondLevelTwoModel type(java.lang.String newType) { + this.type = newType; + return this; + } + + public SecondLevelTwoModel two(java.lang.String newTwo) { + this.two = newTwo; + return this; + } + + // getter/setter + + public java.lang.String getType() { + return type; + } + + public void setType(java.lang.String newType) { + this.type = newType; + } + + public java.lang.String getTwo() { + return two; + } + + public void setTwo(java.lang.String newTwo) { + this.two = newTwo; + } +} diff --git a/src/test/java/org/openapitools/codegen/languages/MicronautCodegenTest.java b/src/test/java/org/openapitools/codegen/languages/MicronautCodegenTest.java index 349e40c2..cd9d5e4f 100644 --- a/src/test/java/org/openapitools/codegen/languages/MicronautCodegenTest.java +++ b/src/test/java/org/openapitools/codegen/languages/MicronautCodegenTest.java @@ -127,6 +127,14 @@ void modelPojoWithoutSealed() { .addAdditionalProperty(MicronautCodegen.SEALED, false)); } + @DisplayName("model records without JsonNullable") + @Test + void modelRecordsWithoutJsonNullable() { + generate(configurator(SPEC_MODEL, "testmodel.micronaut_record") + .addAdditionalProperty(AbstractJavaCodegen.OPENAPI_NULLABLE, false) + .addAdditionalProperty("record", true)); + } + @DisplayName("model without micronaut annotations") @Test void modelWithoutMicronaut() {