Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple names for jackson subtype #798

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewbents
Copy link

fixes #796

resolves all subtype names instead of only the first one

@@ -132,7 +132,7 @@ static Jackson2Parser getJackson2Parser() {

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonSubTypes({
@JsonSubTypes.Type(value = SubTypeDiscriminatedByName1.class, name = "SubType1"), // value from @JsonTypeName is used
@JsonSubTypes.Type(value = SubTypeDiscriminatedByName1.class, name = "SubType1"),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about this one

this is probably a breaking change, since @JsonTypeName would no longer have priority over @JsonSubTypes.Type, and all typenames would be included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@JsonSubTypes.Type names are neglected, only the first name is emitted
1 participant