I am using https://immutables.github.io/ library with Jackson.
I want my class to be Jackson-serializable. I would like to use custom PropertyNamingStrategy
(configured for com.fasterxml.jackson.databind.ObjectMapper
using mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
Unfortunately Immutables library puts @JsonProperty("propertyName")
at every field in generated code. That overrides PropertyNamingStrategy defined at mapper level (or at class level, using @com.fasterxml.jackson.databind.annotation.JsonNaming
annotation).
Is it possible to make Immutables library stop putting property name for every field (using org.immutables.value.Value.Style
or similar means)?
I have come with workaround, putting @JsonProperty (without value) at every property, but I am not satisfied with this.