-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Description
openapi-generator/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache
Line 3 in 5c28ab4
| @JsonIgnoreProperties( |
I think that it should be removed, more details here: #12777
Best solution for fix is to conditionally remove JsonIgnoreProperties annotation which currently is generating likeso:
@JsonPropertyOrder({
AbstractRule.JSON_PROPERTY_RULE_TYPE,
AbstractRule.JSON_PROPERTY_SEVERITY
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@JsonIgnoreProperties(
value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization
allowSetters = true // allows the type to be set during deserialization
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = EntityVerificationRule.class, name = "impl_1"), // <-- this needs to go first as this is what is defined in the source model
@JsonSubTypes.Type(value = HostAvailabilityRule.class, name = "impl_2"), // <-- this needs to go first as this is what is defined in the source model
@JsonSubTypes.Type(value = EntityVerificationRule.class, name = "Impl1"),
@JsonSubTypes.Type(value = HostAvailabilityRule.class, name = "Impl2")
})
public class Base {
// ...
}
- Allow disable / configure the code generation of:
@JsonIgnoreProperties(
value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization
allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization
)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels