I want to rename a json
field, but only within a specific @JsonView
.
Is that possible at all?
public class PersonDTO {
@JsonView(View.Specific.class)
private String personname;
static class View {
interface Specific {
//@JsonProperty("firstname") //TODO this does not work
private String personname;
}
}
}
If the view is not used, the fields name should just remain "personname".