I have an API where the response type is ResponseEntity<Book> and I would want to log the final json response string but with certain fields (e.g. "name" field only) only rather than all fields in Book, what's the best way to do this ?
public class Book implements Serializable {
@JsonProperty("id")
private String id;
@JsonProperty("name")
private String name;
@JsonProperty("isbn")
private String isbn;
//rest of implementation
}