Cleanup Jackson type info mess fixes (#9441) (#11691)

* Cleanup Jackson type info mess fixes (#9441)

* fixup! add import mapping for JsonIgnoreProperties
This commit is contained in:
Radek Postołowicz
2022-03-07 02:36:05 +01:00
committed by GitHub
parent 9a12bce41d
commit c22997b9b8
120 changed files with 617 additions and 105 deletions

View File

@@ -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";

View File

@@ -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";

View File

@@ -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"),