I'm using MappingJacksonJsonView to serialize to JSON a class, however, I'd like to be able to rename some of the fields from the default name based on the getter name.
This is because I've to output field names like "delete_url" and "delete_type" for jQuery file upload. I'm using @Jsonserialize annotation to hand pick the fields to serialize.
@JsonAutoDetect(getterVisibility = Visibility.NONE)
public interface Picture {
@JsonSerialize
String getName();
@JsonSerialize
String getDelete_url();
...
For instance, I'm forced to call a method getDelete_url()
, while I'd like to call it getDeleteUrl()
, but still output the key "delete_url"
when serializing to JSON.