-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
452 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package issue._407; | ||
|
||
@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") | ||
@io.micronaut.serde.annotation.Serdeable | ||
public final class Cat implements Pet { | ||
|
||
@com.fasterxml.jackson.annotation.JsonProperty("hunts") | ||
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) | ||
private java.lang.Boolean hunts; | ||
|
||
@com.fasterxml.jackson.annotation.JsonProperty("age") | ||
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) | ||
private java.lang.Integer age; | ||
|
||
@Override | ||
public PetType getPetType() { | ||
return PetType.CAT; | ||
} | ||
|
||
// methods | ||
|
||
@Override | ||
public boolean equals(Object object) { | ||
if (object == this) { | ||
return true; | ||
} | ||
if (object == null || getClass() != object.getClass()) { | ||
return false; | ||
} | ||
Cat other = (Cat) object; | ||
return java.util.Objects.equals(hunts, other.hunts) | ||
&& java.util.Objects.equals(age, other.age); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return java.util.Objects.hash(hunts, age); | ||
} | ||
|
||
@Override | ||
public java.lang.String toString() { | ||
return new java.lang.StringBuilder() | ||
.append("Cat[") | ||
.append("hunts=").append(hunts).append(",") | ||
.append("age=").append(age) | ||
.append("]") | ||
.toString(); | ||
} | ||
|
||
// fluent | ||
|
||
public Cat hunts(java.lang.Boolean newHunts) { | ||
this.hunts = newHunts; | ||
return this; | ||
} | ||
|
||
public Cat age(java.lang.Integer newAge) { | ||
this.age = newAge; | ||
return this; | ||
} | ||
|
||
// getter/setter | ||
|
||
public java.lang.Boolean getHunts() { | ||
return hunts; | ||
} | ||
|
||
public void setHunts(java.lang.Boolean newHunts) { | ||
this.hunts = newHunts; | ||
} | ||
|
||
public java.lang.Integer getAge() { | ||
return age; | ||
} | ||
|
||
public void setAge(java.lang.Integer newAge) { | ||
this.age = newAge; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
package issue._407; | ||
|
||
@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") | ||
@io.micronaut.serde.annotation.Serdeable | ||
public final class Dog implements Pet { | ||
|
||
@com.fasterxml.jackson.annotation.JsonProperty("bark") | ||
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) | ||
private java.lang.Boolean bark; | ||
|
||
@com.fasterxml.jackson.annotation.JsonProperty("breed") | ||
@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) | ||
private Breed breed; | ||
|
||
@Override | ||
public PetType getPetType() { | ||
return PetType.DOG; | ||
} | ||
|
||
// methods | ||
|
||
@Override | ||
public boolean equals(Object object) { | ||
if (object == this) { | ||
return true; | ||
} | ||
if (object == null || getClass() != object.getClass()) { | ||
return false; | ||
} | ||
Dog other = (Dog) object; | ||
return java.util.Objects.equals(bark, other.bark) | ||
&& java.util.Objects.equals(breed, other.breed); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return java.util.Objects.hash(bark, breed); | ||
} | ||
|
||
@Override | ||
public java.lang.String toString() { | ||
return new java.lang.StringBuilder() | ||
.append("Dog[") | ||
.append("bark=").append(bark).append(",") | ||
.append("breed=").append(breed) | ||
.append("]") | ||
.toString(); | ||
} | ||
|
||
// fluent | ||
|
||
public Dog bark(java.lang.Boolean newBark) { | ||
this.bark = newBark; | ||
return this; | ||
} | ||
|
||
public Dog breed(Breed newBreed) { | ||
this.breed = newBreed; | ||
return this; | ||
} | ||
|
||
// getter/setter | ||
|
||
public java.lang.Boolean getBark() { | ||
return bark; | ||
} | ||
|
||
public void setBark(java.lang.Boolean newBark) { | ||
this.bark = newBark; | ||
} | ||
|
||
public Breed getBreed() { | ||
return breed; | ||
} | ||
|
||
public void setBreed(Breed newBreed) { | ||
this.breed = newBreed; | ||
} | ||
|
||
@io.micronaut.serde.annotation.Serdeable | ||
public enum Breed { | ||
|
||
DINGO("Dingo"), | ||
HUSKY("Husky"), | ||
RETRIEVER("Retriever"), | ||
SHEPHERD("Shepherd"); | ||
|
||
public static final java.lang.String DINGO_VALUE = "Dingo"; | ||
public static final java.lang.String HUSKY_VALUE = "Husky"; | ||
public static final java.lang.String RETRIEVER_VALUE = "Retriever"; | ||
public static final java.lang.String SHEPHERD_VALUE = "Shepherd"; | ||
|
||
private final java.lang.String value; | ||
|
||
private Breed(java.lang.String value) { | ||
this.value = value; | ||
} | ||
|
||
@com.fasterxml.jackson.annotation.JsonCreator | ||
public static Breed toEnum(java.lang.String value) { | ||
return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); | ||
} | ||
|
||
public static java.util.Optional<Breed> 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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package issue._407; | ||
|
||
@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 = "petType") | ||
@com.fasterxml.jackson.annotation.JsonSubTypes({ | ||
@com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Cat.class, name = "Cat"), | ||
@com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = Dog.class, name = "Dog") | ||
}) | ||
public sealed interface Pet permits Cat, Dog { | ||
|
||
@com.fasterxml.jackson.annotation.JsonProperty("petType") | ||
PetType getPetType(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package issue._407; | ||
|
||
@jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") | ||
@io.micronaut.serde.annotation.Serdeable | ||
public enum PetType { | ||
|
||
DOG("Dog"), | ||
CAT("Cat"); | ||
|
||
public static final java.lang.String DOG_VALUE = "Dog"; | ||
public static final java.lang.String CAT_VALUE = "Cat"; | ||
|
||
private final java.lang.String value; | ||
|
||
private PetType(java.lang.String value) { | ||
this.value = value; | ||
} | ||
|
||
@com.fasterxml.jackson.annotation.JsonCreator | ||
public static PetType toEnum(java.lang.String value) { | ||
return toOptional(value).orElseThrow(() -> new IllegalArgumentException("Unknown value '" + value + "'.")); | ||
} | ||
|
||
public static java.util.Optional<PetType> 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; | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
gen/main/java/issue/_414/ModelPrefixModelObjectModelSuffix.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gen/main/java/testmodel/micronaut_pojo/EnumerationStringDefault.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gen/main/java/testmodel/micronaut_pojo/InheritanceWithEnumTypeEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gen/main/java/testmodel/micronaut_pojo_constants/EnumerationInteger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gen/main/java/testmodel/micronaut_pojo_constants/EnumerationNumber.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.