FasterXML / jackson-modules-java8

Set of support modules for Java 8 datatypes (Optionals, date/time) and features (parameter names)
Apache License 2.0
398 stars 116 forks source link

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

Open benjessie25 opened 6 months ago

benjessie25 commented 6 months ago

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

cowtowncoder commented 6 months ago

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!