You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
change include = JsonTypeInfo.As.PROPERTY to EXISTING_PROPERTY
Tagged unions
Typescript-generator can generate tagged unions (#81) for Jackson polymorphic classes that uses @JsonTypeInfo annotation with include = JsonTypeInfo.As.PROPERTY.
New
Typescript-generator can now detect mentioned duplicate property issue and does not generate tagged unions for such classes. In addition to this it also logs warning.
The text was updated successfully, but these errors were encountered:
Consider following example which uses Jackson library:
If instance is created and serialized using Jackson:
Jackson generates following invalid JSON:
where first
kind
property comes from@JsonTypeInfo
annotation and second comes fromDuplicateKind.kind
field. (Tested with Jackson 2.9.7)Here are relevant issues tracked in
jackson-databind
repository: FasterXML/jackson-databind#2022, FasterXML/jackson-databind#1410.To resolve this issus either:
kind
field (preferred)include = JsonTypeInfo.As.PROPERTY
toEXISTING_PROPERTY
Tagged unions
Typescript-generator can generate tagged unions (#81) for Jackson polymorphic classes that uses
@JsonTypeInfo
annotation withinclude = JsonTypeInfo.As.PROPERTY
.New
Typescript-generator can now detect mentioned duplicate property issue and does not generate tagged unions for such classes. In addition to this it also logs warning.
The text was updated successfully, but these errors were encountered: