An extension of the Jackson serialisation filter framework which provides the ability to add conditional logic, through SpEL, to dynamically suppress fields serialised into json.
- Enable the SpEL filter by annotating your application configuration or main class with the @EnableJacksonSpELFilter. This will add an ObjectMapper bean tot he context, if there isn't one already, and add an instance of the SpELPropertyFilterImpl named 'spel'.
- Annotate the type in which the SpEL Filter will be applied with the JsonFilter annotation - @JsonFilter('spel').
- Annotate the fields within the class declared in 2, which are required to be conditionally suppressed, with the JsonFilterExpression annotation and declare the expression which will be evaluated to decide whether to suppress the field in json output.