Refactor `StackItem` to use Jackson annotations for deserializing subclasses
See original GitHub issueThe StackItem
class currently uses a custom deserializer to deserialize its various subclasses.
See TransactionAttribute
as an example on how to do this.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Inheritance in Jackson | Baeldung
This tutorial will demonstrate how to handle inclusion of subtype metadata and ignoring properties inherited from superclasses with Jackson.
Read more >Jackon JSON: Polymorphic deseralization when subclasses ...
I'm trying to do some polymorphic deseralization of JSON using Jackson, however the list of subclasses is unknown at compile time, so I...
Read more >Jackson Annotations for JSON (Part 3): Deserialization - DZone
The @JsonSetter annotation tells Jackson to deserialize the JSON into Java object using the name given in the setter method. Use this annotation...
Read more >SUSE-SU-2022:1678-1: important: Security update for jackson ...
(bsc#1182481) Non security fixes: jackson-annotations - update from ... thrown for mismatched subclass deserialization + Add convenience ...
Read more >Polymorphism and Inheritance with Jackson - OctoPerf
Learn how to serialize and deserialize polymorphic object trees with Jackson Json Databind. Using practical code examples to make it easy to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried to do this and it works for all
StackItemTypes
except for Maps. For theStackItemType
Map, a custom Key deserialiser is needed.Reason for this: In a Map-StackItem the value is of type
Map<StackItem, StackItem>
, hence the key-value pair are both StackItems. Using Jackson annotations, however, by default the keys of a Map are deserialised as Strings. This leads to anInvalidDefinitionException
that asks for a(Map) Key deserialiser
.This was merged. I’ll close it.