@JsonFilter throws “JsonMappingException: Can not resolve BeanPropertyFilter”

后端 未结 4 1254
無奈伤痛
無奈伤痛 2021-01-01 17:46

Is it possible to selectively determine when the @JsonFilter annotation gets used at runtime?

I\'m getting JsonMappingException exception (see below) when I don\'t p

4条回答
  •  难免孤独
    2021-01-01 18:15

    I know it's already been answered but for any newcommers Jackson has actually added the ability to not fail on missing filters (JACKSON-650):
    You just need to call SimpleFilterProvider.setFailOnUnknownId(false) and you won't get this exception.

提交回复
热议问题