Jackson

JsonProperty&JsonIgnore

推荐配置中默认支持.

#Support for Jackson annotations
field.name=@com.fasterxml.jackson.annotation.JsonProperty#value
field.ignore=@com.fasterxml.jackson.annotation.JsonIgnore#value

JsonIgnoreProperties

推荐配置中有提供选项,但默认未选中.


#Support for Jackson annotation JsonIgnoreProperties

json.cache.disable=true
field.ignore=groovy:it.containingClass().annValue("com.fasterxml.jackson.annotation.JsonIgnoreProperties")?.contains(it.name())
json.group=@com.fasterxml.jackson.annotation.JsonIgnoreProperties
field.parse.before[@com.fasterxml.jackson.annotation.JsonIgnoreProperties]=groovy:```
    def properties = it.annValue("com.fasterxml.jackson.annotation.JsonIgnoreProperties")
    for(property in properties){
        def path = fieldContext.property(property)
        session.set("json-ignore", path, true)
    }
```
field.parse.after[@com.fasterxml.jackson.annotation.JsonIgnoreProperties]=groovy:```
    def properties = it.annValue("com.fasterxml.jackson.annotation.JsonIgnoreProperties")
    for(property in properties){
        def path = fieldContext.property(property)
        session.remove("json-ignore", path)
    }
```
field.ignore=groovy:```
    return session.get("json-ignore", fieldContext.path())
```