Re: [jackson-user] Re: [Jackson-user] Nested Polymorphic Deserialization using @JsonTypeInfo?

2024-05-22 Thread Chuanwise Rafter
Here is my codes : ```kotlin @JsonTypeInfo( use = JsonTypeInfo.Id.CUSTOM, property = "type", include = JsonTypeInfo.As.PROPERTY, visible = true ) @JsonNaming(SnakeCaseStrategy::class) @JsonTypeIdResolver(BaseTypeIdResolver::class) interface Base private object BaseTypeIdResolver

Re: [jackson-user] Re: [Jackson-user] Nested Polymorphic Deserialization using @JsonTypeInfo?

2024-05-22 Thread Joo Hyuk Kim
Or instead of using TypeIdResolver, how about writing a custom deserializer yourself. On Wed, May 22, 2024 at 5:04 PM Chuanwise Rafter wrote: > I searched and TypeIdResolver must return a type depend on single type id, > but I need type id combinations to know the final POJO class. I wrote >

[jackson-user] Re: [Jackson-user] Nested Polymorphic Deserialization using @JsonTypeInfo?

2024-05-22 Thread Chuanwise Rafter
I searched and TypeIdResolver must return a type depend on single type id, but I need type id combinations to know the final POJO class. I wrote custom deserializer but StackOverflow will be thrown because in the deserializer of `Sub`, I read field "type" and use statements like

[jackson-user] Re: [Jackson-user] Nested Polymorphic Deserialization using @JsonTypeInfo?

2024-05-22 Thread Joo Hyuk Kim (Vince)
Try searching on Stackoverflow, keyword might be "type id resolver" On Wednesday, May 22, 2024 at 3:13:21 PM UTC+9 Chuanwise Rafter wrote: > So how to deserialize them gracefully with the help of Jackson? > > On Wednesday, May 22, 2024 at 12:39:42 PM UTC+8 Tatu Saloranta wrote: > >> On Tue, May

[jackson-user] Re: [Jackson-user] Nested Polymorphic Deserialization using @JsonTypeInfo?

2024-05-22 Thread Chuanwise Rafter
So how to deserialize them gracefully with the help of Jackson? On Wednesday, May 22, 2024 at 12:39:42 PM UTC+8 Tatu Saloranta wrote: > On Tue, May 21, 2024 at 9:23 PM Chuanwise Rafter > wrote: > > > > I need to deserialize incoming packet encoded in JSON. For example, > there are two kind of