FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

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

Closed gitsupi closed 1 year ago

gitsupi commented 2 years ago

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]']""})

cowtowncoder commented 2 years ago

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.