Closed AlexUg closed 5 months ago
@AlexUg Thank you for reporting this. Not a problem wrt PR, we can do that (plus specifically need to test this(.
https://github.com/FasterXML/jackson-dataformat-xml/issues/609 is already open and describes why the nesting depth is not checked in jackson-dataformat-xml. TLDR is Woodstox can do the check.
609 is already open and describes why the nesting depth is not checked in jackson-dataformat-xml. TLDR is Woodstox can do the check.
The "jackson-dataformat-xml" should not check nesting, but "jackson-dataformat-xml" should provide consumers with correct nesting information, as do the JSON and YAML parsers provided by "FasterXML" (to avoid violating interface specs - users expect correct information by calling 'parser.getParsingContext().getNestingDepth()' regardless of the parser type).
True. There are some complexities here since nesting count will not necessarily be the same for logical content (JsonToken
stream) as physical XML tokens -- this because there's a bit of translation going on.
But it should probably be more useful than not having nesting depth at all.
I am also not sure how easy it'd be to implement #609 over doing it on XML module side.
Fixing tracking part as suggested, via #658.
This bug can be fixed with below patch (just like it is implemented in 'com.fasterxml.jackson.core.json.JsonReadContext'):
Sorry for not creating a pull request...