How to control the JSON serialization with Jackson @JsonView and Spring-Boot | code.relief();
When returning data to our Rest client application, depending on which Rest service was called, we need to limit which data will be serialized while using the same data model. To do this we can use the @JsonView annotation which is provided by the Jackson framework and its integration with Spring-Boot.
Let say we have a simple model like the one below:
And we want to create two Rest services.
The first Rest service would return some basic User information like its firstname and lastname but without the messages attached to it.
Read full article from How to control the JSON serialization with Jackson @JsonView and Spring-Boot | code.relief();
No comments:
Post a Comment