Skip to content

How to parse polymorphic JSON? #118

Discussion options

You must be logged in to vote

+1 for @pjfanning's answer. In addition, mode of use = Id.DEDUCTION would probably work well for this particular case -- it does not use explicit type id but bases it on "unique properties" found. An article that explains this is:

https://www.baeldung.com/jackson-deduction-based-polymorphism

(see paragraph 3, "Deduction-based Polymorphism")

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CypherpunkSamurai
Comment options

Answer selected by CypherpunkSamurai
Comment options

You must be logged in to vote
7 replies
@CypherpunkSamurai
Comment options

@CypherpunkSamurai
Comment options

@cowtowncoder
Comment options

@CypherpunkSamurai
Comment options

@cowtowncoder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants