Hi,
I have a requirement to uppercase certain values during serialisation, so I've created a custom serialiser that accepts an argument within the constructor as I only want this code executing when I use the ObjectMapper.
So in my code when I execute:
ObjectMapper mapper = new ObjectMapper().registerModule(new SimpleModule().addSerializer(new UpperCaseSerializer(true)));
String serialized = mapper.writeValueAsString(person);
it appears that the custom serialiser fires for any property that doesn't have
@JsonSerialize(using = UpperCaseSerializer.class)
attached? So if I have 10 properties, and this annotation is on only 1, I end up with a string where 9 of the values are uppercase and the one I actually want is lowercase? Is there something I'm missing with this?
Any help would be much appreciated.