jackson-future-ideas
jackson-future-ideas copied to clipboard
Rename a @JsonProperty only inside a @JsonView
It would be handy if one could rename a json property only inside a specific view.
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;
}
}
}
Here, default field name is "personname", but when using the view explicit, the field should only then be renamed to "firstname".