jackson-annotations icon indicating copy to clipboard operation
jackson-annotations copied to clipboard

enable @jsonignores ignore property of property of and more...

Open gitsupi opened this issue 4 years ago • 1 comments

suppose we have Product Object it has

 
Attribute["attributeValues"]
->
AttributeValue["products"]
->
Product["seller"]
->
Seller["shops"]
->
Shop["attributes"]
->
Attribute["attributeValues"]
->
AttributeValue["products"]
->
Product["seller"]
 
Seller["shops"]
->
Shop["attributes"]
->
Attribute["attributeValues"]  

we need something like

@JsonIgnoreProperties(value = {"products","shops['products'],"S['X[""Z]']""})

gitsupi avatar Dec 15 '21 20:12 gitsupi

No, Jackson does not support such nested configuration. The reason is technical, in that serializers/deserializers do not have access in hierarchy beyond immediate next level: because of this, annotations cannot specify deeper processing constraints either.

You can add @JsonIgnoreProperties on fields, however, to do some of what you want. But it does and will not support general path expressions.

cowtowncoder avatar Dec 15 '21 22:12 cowtowncoder