TreeTraversingParser#readValueAsTree returns whole tree instead of current node
See original GitHub issueIf you create a TreeTraversingParser on a node, say on {"b": {"bValue" : 1}}
and have classes like:
class A {
B b;
}
@JsonDeserialize(using = B.Deserializer.class)
class B {
static class Deserializer extends JsonDeserializer<Expression> {
@Override
public Expression deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
JsonNode jsonNode = p.readValueAsTree();
}
}
}
then you would expect jsonNode
to represent {"bValue" : 1}
, but instead it is the whole original tree ({"b": {"bValue" : 1}}
).
The method p.currentNode
returns the correct value, but is protected.
Could TreeTraversingParser override readValueAsTree and return currentNode instead of the current behaviour?
(I’ve tried to extract this example from more complex code, but I think the essence is correct. I can produce a minimal test case if that would help repro this.)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How can I return a boolean while traversing a BinaryTree ...
It prints out false, although the Tree has a Node with Value of 40. My Console looks like this after running it: Value...
Read more >Check whether a binary tree is a complete tree or not
If the current node under examination is NULL, then the tree is a complete binary tree. Return true. If index (i) of the...
Read more >ast — Abstract Syntax Trees — Python 3.11.1 documentation
keys and values hold lists of nodes representing the keys and the values respectively, in matching order (what would be returned when calling...
Read more >sklearn.tree.DecisionTreeRegressor
If None, then nodes are expanded until all leaves are pure or until all ... the total number of samples, N_t is the...
Read more >Simply Scheme: Introducing Computer Science ch 18: Trees
The big advantage of full-featured lists over sentences is their ability to represent structure in ... Datum of a tree node returns the...
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
@robinkanters lol. Sorry about that. Auto-completion fail for some reason. 😃
@cowtowncoder thanks for the tag but that wasn’t me
@robinmessage