let's say I have a controller with an endpoint.
@controller
public class booksController{
@SomeCustomAnnotation
public String getBookOnlyName(){
return new book();
}
public String getBookAllData(){
return new book();
}
}
In the book object I like to only serialize some fields.
class book{
@JsonView(Views.someClass.class)
public String name;
public String author;
}
Now I only want to serialize the "name" field from the book instance. And only from endPoint with annotation like "getBookOnlyName"