Skip to content
Advertisement

Tag: jackson2

‘com.google.api.client.json.jackson2.JacksonFactory’ is deprecated. What are my options?

While following the Gmail API java quickstart guide I came across this code snippet: Using it in the editor gave me a warning that it is deprecated. What are my options? Answer Look up the API documentation of class JacksonFactory. It tells you what to do: Deprecated. use com.google.api.client.json.GsonFactory instead Looking into the API documentation of class GsonFactory you see,

Jackson , java.time , ISO 8601 , serialize without milliseconds

I’m using Jackson 2.8 and need to communicate with an API that doesn’t allow milliseconds within ISO 8601 timestamps. The expected format is this: “2016-12-24T00:00:00Z” I’m using Jackson’s JavaTimeModule with WRITE_DATES_AS_TIMESTAMPS set to false. But this will print milliseconds. So I tried to use objectMapper.setDateFormat which didn’t change anything. My current workaround is this: I’m overriding the default serializer for

What is the difference between ObjectNode and JsonNode in Jackson?

According to the documetation of JsonNode: Most mutators, however, need to be accessed through specific sub-classes (such as ObjectNode and ArrayNode). However I am still confused since some stackoverflow answers seem to use them quite interchangeably. What different purpose do they serve? Answer JsonNode is a base class that ObjectNode and ArrayNode extend. JsonNode represents any valid Json structure whereas

Advertisement