support nested property filters using Jackson [SPR-13622] #18200
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Uh oh!
There was an error while loading. Please reload this page.
rk opened SPR-13622 and commented
#17187 already supports filters but the underlying code does not filter nested properties because of the way Jakson and its spring integration works, there should be a custom filter to support simple nested property filtering (without any regular expressions). This is a very common use case to get only the fields clients are interested in runtime.
There are a few complex implementations already available, but these are not compatible with MappingJacksonValue as a drop in replacement, i.e., we cannot set their Filter implementations to MappingJacksonValue and expect them to work without explicitly adding JsonFilter annotation on all classes that will be filtered:
https://github.com/PressAssociation/partial-response/tree/master/filter-json-jackson
https://github.com/Antibrumm/jackson-antpathfilter
https://github.com/narusas/SpringMvcJacksonFilter
The following won't work without
@JsonFilter
("antPathFilter") on all classesOne hack is to explicitly set the same
@JsonFilter
("antPathFilter") on all classes that are nested, which did not make any sense to me. What if I wanted to support multiple filters at the same time tomorrow?No further details from SPR-13622
The text was updated successfully, but these errors were encountered: