-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OffsetDateTime
deserialization fails when using (specific?) date-time pattern
#279
Comments
Had the same issue and fixed it by updating the pattern to |
I faced error similar to what is posted above, when I upgraded lombok from '1.18.12' to '1.18.30'. So, I think this has something to do with one of the transitive dependencies not being compatible. Jdk 8 Azul Zulu |
Including JDK version for failing case would be useful as well. And obviously Jackson versions (plus need to ensure Jackson versions of components are aligned). Lombok version discrepancy sounds odd, but could be due to Lombok's changing Jackson annotations it adds. |
Added details in my original comment. |
@jaymanik Jackson 2.10 is very old version, as the latest is 2.17.2. So I would try out version upgrade first. But I also realized that the original issue did not refer to Lombok so not sure if @jaymanik 's problem is same as @cristibozga's. |
Thank you for your suggestion. I will try to upgrade jackson2 and give it a try. Apologies for not sharing stack trace. |
Sorry for missing some important data. So:
|
Jackson 2.13 is still old enough version that it'd definitely make sense to try with 2.17(.2) just rule out possibility of a fix. |
Ok; verified the issue exists in 2.18 branch; added failing test as well -- don't have time to look deeper but hopefully this helps whoever decides to work on it. |
OffsetDateTime
deserialization fails when using (specific?) date-time pattern
If we have an OffsetDateTime property inside a DTO where we specify the pattern, the deserialization operation fails:
Ex:
Inside OffsetDateDto:
The code of the application:
When we write the value (serialize dto I get displayed: '{"date":"2023-09-01T11:07:48Z",...'}
But the last line throws an error because deserialization fails:
I've tried also with the pattern 'yyyy-MM-dd'T'HH:mm:ssX' and I get the same error.
Am I doing something wrong here?
Thanks in advance
The text was updated successfully, but these errors were encountered: