jackson-modules-java8 icon indicating copy to clipboard operation
jackson-modules-java8 copied to clipboard

I don't deserialize java 8 date/time type `java.time.Instant`

Open benjessie25 opened this issue 1 year ago • 2 comments

benjessie25 avatar Feb 14 '24 09:02 benjessie25

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.Instant not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling

benjessie25 avatar Feb 14 '24 09:02 benjessie25

Yes, if you have that type somewhere in your class definitions, you need to either add the module, or add something else to handle it (custom (de)serializer), or mark as "ignored type". Something like:

        mapper.configOverride(Instant.class).setIsIgnoredType(true);

which would then ignore all properties with declared type of Instant.

I hope this helps!

cowtowncoder avatar Feb 14 '24 17:02 cowtowncoder