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

Improve @JsonSubtypes Handling #390

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Conversation

andriy-dmytruk
Copy link
Contributor

  • The @JsonSubtypes.Type names property is now used and merged with type name to be used for deserialization
  • The name property is used even if the subtype has @SerdeConfig annotation (in previous behavior the subtype annotation wasn't visited and therefore name wasn't used)
  • The @JsonTypeName is prioritized over @JsonSubtypes.Type name and names properties

Examples of jackson behavior in this tutorial: https://www.logicbig.com/tutorials/misc/jackson/json-type-info-with-logical-type-name.html

- The names property is now used and merged with type name to be used for deserialization
- The name property is used even if the subtype has @SerdeConfig annotation (in previous behavior the subtype annotation wasn't visited and therefore name wasn't used)
- The JsonTypeName is prioritized over JsonSubtype name and names properties
@sonarcloud
Copy link

sonarcloud bot commented Mar 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

89.4% 89.4% Coverage
0.0% 0.0% Duplication

@graemerocher graemerocher added the type: improvement A minor improvement to an existing feature label Mar 3, 2023
@graemerocher graemerocher merged commit a8f80a4 into 1.5.x Mar 3, 2023
@graemerocher graemerocher deleted the json-subtypes-improve branch March 3, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants