Add common DockerObject parent to every model class#1635
Conversation
| public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { | ||
| JsonNode jsonNode = p.readValueAsTree(); | ||
|
|
||
| Object deserializedObject = originalMapper.treeToValue(jsonNode, beanDescription.getBeanClass()); |
There was a problem hiding this comment.
Jackson 2.13 will help here with method DeserializationContext.readTreeAsValue(JsonNode, Class), but alas not yet available. But there is DeserializationContext.readTree(JsonParser) which has some small benefits over going through JsonParser -- probably not much difference here just minor improvement.
There was a problem hiding this comment.
@cowtowncoder thanks for having a look!
I tried DeserializationContext.readTree(JsonParser) but ended up getting a recursive problem 😅 Hence the "originalMapper" workaround.
There was a problem hiding this comment.
Ah. Odd... would be interested in details if you have any (just to see if there's something to fix), but makes sense to skip in that case.
There was a problem hiding this comment.
As now I have your aura around, let me try it again and report back :)
Can also share how to try it, without even having Docker running (a.k.a. in memory)
There was a problem hiding this comment.
Ah, okay, I am stupid :D I confused readTree with readValue 😅
readValue gives a recursive problem, while JsonNode jsonNode = ctxt.readTree(p); (previous line) works just fine, thanks!
No description provided.