I have a json file which looks like this:
{
\"ANIMALS\": {
\"TYPE\": \"MAMMAL\",
\"COLOR\": \"BLACK\",
\"HEIGHT\": \"45\",
}
}
>
You should implement new naming strategy for your case:
class LowerCaseNamingStrategy extends LowerCaseWithUnderscoresStrategy {
private static final long serialVersionUID = 1L;
@Override
public String translate(String arg0) {
return arg0.toUpperCase();
}
}
After that, configure ObjectMapper
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setPropertyNamingStrategy(new LowerCaseNamingStrategy());
See also @JsonProperty
annotation.