How can jackson MappingJackson2HttpMessageConverter
converte a pogo into a json without @JSONProperty
ON every Property?
I use groovy in spring boot project and no java code, I hava a domain model named FileInfo.groovy
:
class FileInfo {
private String name
@JsonProperty("is_dir")
private boolean isDirectory
@JsonProperty("last_modified")
private String lastModifiedTime
}
I configured MappingJackson2HttpMessageConverter
in @Configuration @EnableWebMvc
class.
and when return a FileInfo
in controller handler with @ResponseBody
,THERE is no name
in result json;
I know the pogo property is accessed by public void setProperty(java.lang.String, java.lang.Object);
So are there a annotation on class that can mark a pogo that can convert by jackson? cuz it is too noisy use @JSONProperty
on every property.