@JsonView is not working with inheritance

268 Views Asked by At

I'm using @JsonView on simple classes (without inheritance) and it works fine.

But I have another case : class B, C, D inheriting A and Class A inherits T. I put the @JsonView in th right get methods, but the filter is not working I always get all attributes in Json Body response.

Should I add a specific configuration in inheritance case?

I used the following tutorial :

https://www.baeldung.com/jackson-json-view-annotation

Ps: I have added the @JsonView on the controller method also. @JsonView(DeliveryPrdViews.History.class)

Did I miss anything?

Kr,

0

There are 0 best solutions below