-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilteringGeneratorDelegate
does not create new filterContext
if tokenFilter
is null
#890
Comments
Yes, I think you are right @DemonicTutor. It definitely looks like this:
should be added before return statement. This could be fixed to be included in 2.14.2, I think, all we need is a PR. |
Quick note: adding fix as suggested does not break any of existing unit tests, fwtw. At any rate, would really love reproduction unit test. |
yeah sure i can do that - will provide a PR for you! |
@cowtowncoder let me know if this is somewhat how you expected it! |
while i'm at it.. i also opened a feature-request: #892 let me know if that makes sense to you - maybe im just off the rails and misusing this one but for what im currently doing its a neat hack |
FilteringGeneratorDelegate
does not create new filterContext
if tokenFilter
is null
The usecase is to filter Json while generating it but instead of a single property i wanted to be able to match multiples.
see: https://github.com/FasterXML/jackson-core/blob/2.15/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java#L314-L317
for arrays it already happens: https://github.com/FasterXML/jackson-core/blob/2.15/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java#L178-L182
I wrote a simple OR composite:
new FilteringGeneratorDelegate(createGenerator(new ByteBufOutputStream(unpooled)), OrTokenFilter.create(jsonPointers), TokenFilter.Inclusion.INCLUDE_ALL_AND_PATH, true)
example:
without creating the new context the generator will fail at the second object in the stuff array because the _startHandled is set to true from the first object.
The text was updated successfully, but these errors were encountered: