Jackson version (BOM): 2.15.2
While experimenting with JsonPointer in Spring Framework, I tried to build up on the existing FilteringParserDelegate and associated JsonPointerBasedTokenFilter. Unfortunately, this doesn't seem to work with a non-blocking JsonParser delegate, for several reasons:
- it doesn't delegate method
canParseAsync() (ends up returning the default interface implem => false)
- it doesn't delegate method
getNonBlockingInputFeeder() (same as above => null)
- it isn't aware of
JsonToken.NOT_AVAILABLE
While the first two are easily circumvented by extending FilteringParserDelegate, the last one is the truly problematic one. It results in going down the code path of a "scalar value", and will continuously call delegate.nextToken() which continues to result in NOT_AVAILABLE.
This leads to an infinite loop when attempting to filter based on a JsonPointer on top of a non-blocking parser.
Is there anything fundamentally preventing FilteringParserDelegate from being compatible with non-blocking parsers that I might have overlooked? Otherwise I think it's pretty close, hopefully that can be fixed 😄
Jackson version (BOM):
2.15.2While experimenting with
JsonPointerin Spring Framework, I tried to build up on the existingFilteringParserDelegateand associatedJsonPointerBasedTokenFilter. Unfortunately, this doesn't seem to work with a non-blockingJsonParserdelegate, for several reasons:canParseAsync()(ends up returning the default interface implem =>false)getNonBlockingInputFeeder()(same as above =>null)JsonToken.NOT_AVAILABLEWhile the first two are easily circumvented by extending
FilteringParserDelegate, the last one is the truly problematic one. It results in going down the code path of a "scalar value", and will continuously calldelegate.nextToken()which continues to result inNOT_AVAILABLE.This leads to an infinite loop when attempting to filter based on a
JsonPointeron top of a non-blocking parser.Is there anything fundamentally preventing
FilteringParserDelegatefrom being compatible with non-blocking parsers that I might have overlooked? Otherwise I think it's pretty close, hopefully that can be fixed 😄