jackson-modules-java8
jackson-modules-java8 copied to clipboard
Set of support modules for Java 8 datatypes (Optionals, date/time) and features (parameter names)
Example: ```java public record MyRecord( Optional myField ) { } ``` When deserialized from: `{}` Expected: `myField.isPresent() == false` Actual: `myField.isPresent() == true` This is because `myField` gets set to...
Hey guys, I bumped into this issue and it took me some time to figure out what was wrong on my side. Maybe you don't even consider this as an...
As stated in the Jackson ObjectMapper the default should be UTC for writing Json: /** * Method for overriding default TimeZone to use for formatting. * Default value used is...
When having a `OffsetTime` field with e.g. `15:00:00Z` and serializing this with Jackson it outputs: `15:00Z` and thus the seconds are lost. Note I have the time module registered via...
Encountered while debugging through a project making use of this for Avro serialization/deserialization: For an object containing a java.time.Instant with associated Avro schema field of "type" : [ "null", {...
If we have an OffsetDateTime property inside a DTO where we specify the pattern, the deserialization operation fails: Ex: Inside OffsetDateDto: ``` private OffsetDateTime date= OffsetDateTime.now(ZoneId.of("UTC")).truncatedTo(ChronoUnit.SECONDS); @JsonFormat(shape = JsonFormat.Shape.STRING, pattern...
**Describe the bug** `ObjectMapper#readValue(String)` seems to preserve all nine digits of an `Instant`'s decimal, but `ObjectMapper#readTree(JsonParser)` does not. **Version information** Jackson 2.12.1 **To Reproduce** ```java ObjectMapper mapper = new ObjectMapper();...
jdk-17.0.6, code: ```java import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.time.OffsetDateTime; public class Main { public static void main(String[] args) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper() .registerModule(new JavaTimeModule());...
### Search before asking - [X] I searched in the [issues](https://github.com/FasterXML/jackson-databind/issues) and found nothing similar. ### Describe the bug A bean property with an inaccessible (private) field and an implicit...