So, in our project, we are using a @JsonView to exclude the attributes that we don't want at each request from being serialiazed/called. The problem is that this is very crude, and we need to create a new View or annotate on the Model every time we need something different, following this example: very nice guy with a blog. We believe that this is not really optimal, and a pretty boilerplate-y way to do it, so we're looking to change that logic: instead of the server responding only what it wants, we want to request the server to respond only what the client wants, to move that responsability from the server. Instead of doing a simple $.get, i'd pass on the parameters of that $.get the attributes that i want at the moment (i.e. only name and picture, sometimes full-information for editing and etc). I know that this is possible, but i haven't been able to find any ways for doing this using Spring. We're using Spring 4.2 and Jackson 2.6.1 and consuming the REST with AngularJS, so this would really help. Any thoughts on how to do this, or any guidance? Really thanks for the help!
GET request:
{
username,
picture
}
And receive a json response:
{
"id":1,
"username":"john",
"picture":"/john.png"
}
Something along these lines.