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
@@ -21,6 +21,7 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
@@ -44,7 +45,11 @@ import org.openapitools.client.JSON;
|
||||
ChildSchema.JSON_PROPERTY_PROP1
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true)
|
||||
@JsonIgnoreProperties(
|
||||
value = "objectType", // ignore manually set objectType, it will be automatically generated by Jackson during serialization
|
||||
allowSetters = true // allows the objectType to be set during deserialization
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", visible = true)
|
||||
|
||||
public class ChildSchema extends Parent {
|
||||
public static final String JSON_PROPERTY_PROP1 = "prop1";
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
@@ -45,7 +46,11 @@ import org.openapitools.client.JSON;
|
||||
})
|
||||
@JsonTypeName("MySchemaName._-Characters")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true)
|
||||
@JsonIgnoreProperties(
|
||||
value = "objectType", // ignore manually set objectType, it will be automatically generated by Jackson during serialization
|
||||
allowSetters = true // allows the objectType to be set during deserialization
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", visible = true)
|
||||
|
||||
public class MySchemaNameCharacters extends Parent {
|
||||
public static final String JSON_PROPERTY_PROP2 = "prop2";
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
@@ -39,7 +40,11 @@ import org.openapitools.client.JSON;
|
||||
Parent.JSON_PROPERTY_OBJECT_TYPE
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true)
|
||||
@JsonIgnoreProperties(
|
||||
value = "objectType", // ignore manually set objectType, it will be automatically generated by Jackson during serialization
|
||||
allowSetters = true // allows the objectType to be set during deserialization
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = ChildSchema.class, name = "ChildSchema"),
|
||||
@JsonSubTypes.Type(value = MySchemaNameCharacters.class, name = "MySchemaName._-Characters"),
|
||||
|
||||
Reference in New Issue
Block a user