Skip to content

Tag: jackson

Jackson encode all properties to base64

I have more than one class that I want to serialize using Jackson to generate Json, for example I need to encode all value of the json to base64, so I configure the object mapper like this The problem is it’s only encode the String type as the serializer only accept one type, is there any method to enco…

Serializing a double property as string

Which @JsonXyz annotation do I have to use when I have a bean to be jsonified but serializing a double proeprty as string. An example: I have a bean: And I wan tto have a JSON like: instead of: So, the value 100.0 shall be in quotes. Answer If you are using Jackson you can use @JsonSerialize and ToStringSeria…

Getting null values while mapping a JSON to POJO

I am trying to map a JSON to POJO using Jackson. However, as this JSON contains a nested map of objects, when i de-serialize it to the POJO, the timeseries information is not converted to the POJO. I am only able to get the metadata part and the date part in the timeseries block. The other fields in the times…