forked from loafle/openapi-generator-original
* Cleanup Jackson type info mess fixes (#9441) * fixup! add import mapping for JsonIgnoreProperties
This commit is contained in:
committed by
GitHub
parent
9a12bce41d
commit
c22997b9b8
@@ -2,6 +2,7 @@ package org.openapitools.model;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
@@ -19,7 +20,11 @@ import javax.annotation.Generated;
|
||||
* Animal
|
||||
*/
|
||||
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true)
|
||||
@JsonIgnoreProperties(
|
||||
value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization
|
||||
allowSetters = true // allows the className to be set during deserialization
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = BigCat.class, name = "BigCat"),
|
||||
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
|
||||
|
||||
Reference in New Issue
Block a user