-
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
Deserializing java.time.Month
from an int causes an off-by-one error (0
->Jan
,11
->Dec
), because it's an enum
#274
Comments
java.time.Month
deserialization from an integer is off by one, because it's an enum.
java.time.Month
deserialization from an integer is off by one, because it's an enum.java.time.Month
from an int causes an off-by-one error (0
->Jan
,11
->Dec
), because it's an enum.
Looks like there is no explicit serializer/deserializer for type A challenge is that change in this logic is backwards incompatible change: so we'd probably need to add a configuration option -- f.ex add new config enum This sounds like a good idea, but quite a bit of work. Since Jackson 2.16.0 is being released any day now this probably has to wait until 2.17. |
Note: when implemented, should be enabled by a feature added to |
hello @cowtowncoder, I started looking into this issue. I'll need a bit of guidance for the test related to the Which code formatter should I use for this project? |
@etrandafir93 Ok sounds good: I added a few comments on PR. ConfigOverrides can be handled by something similar to what As to formatter, I don't think we have one so it's more of "When in Rome" style to follow -- most Jackson projects are similar, although there are some differences (esp. for Kotlin, Scala modules).
there is a jackson-databind issue filed that asks writing down Jackson Coding Style, something I need to get done. |
java.time.Month
from an int causes an off-by-one error (0
->Jan
,11
->Dec
), because it's an enum.java.time.Month
from an int causes an off-by-one error (0
->Jan
,11
->Dec
), because it's an enum
New feature merged in 2.17 for inclusion in 2.17.0. |
I found an issue with deserializing
java.time.Month
from an integer, or from a string containing an integer.Since it's an enum,
0
deserializes asMonth.JANUARY
,1
/"01"
asMonth.FEBRUARY
,11
/"11"
asMonth.DECEMBER
, and so on.I have a PR with a failing test that proves this: kreiger#1
The text was updated successfully, but these errors were encountered: