what's the best way to keep only certain properties while serializing the object using jackson - should work for nested objects #4706
Unanswered
sidharthmittal
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I'm sorry but there are lots of articles online about Jackson. We are volunteers and we simply can't answer every user question. I would recommend https://www.baeldung.com/jackson-annotations - lots of annotations to try out. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to keep only additionalFields in the response, and that property can be present in nested objects as well.
I am trying to use jackson, since I am already using jackson to serialize my object.
now, I want to exclude all fields except additionalFields on all the objects in response.
I have tried the below implementation, but this has 2 issues -
SimpleFilterProvider filterProvider = new SimpleFilterProvider() .addFilter("additionalFieldsFilter", SimpleBeanPropertyFilter.filterOutAllExcept("additionalFields"));
Is there something simpler that I can use?
Beta Was this translation helpful? Give feedback.
All reactions