I work on REST service using Spring MVC 3.1. Names of some of the object fields are customized. Also I use JSR-303 validation. For example,
@Valid
@JsonProperty("env_vars")
private List<EnvironmentVariable> env;
Works great, but there is an issue here: error messages contains names of Java fields. I mean if user produces invalid value in field *env_vars*, he get an error message that env field contains an error and it can be confusing.
Is there a way to keep names customization without providing full messages for each field?