Skip to content

Deserialization of Month in ONE_BASED_MONTHS mode fails for value "12" #364

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

Closed
bbobcik opened this issue Mar 26, 2025 · 0 comments
Closed

Comments

@bbobcik
Copy link
Contributor

bbobcik commented Mar 26, 2025

When JavaTimeFeature.ONE_BASED_MONTHS is in effect, I expect to convert strings "1" to Month.JANUARY ... "12" to Month.DECEMBER. For values 1-11 it works, but "12" raises error.

The cause is that com.fasterxml.jackson.datatype.jsr310.deser.OneBasedMonthDeserializer first invokes the original, 0-based deserializer and then it tweaks its output with zeroBaseMonth.minus(1). The original deserializer can handle values "0" to "11", but "12" is obviously out of range.

bbobcik pushed a commit to bbobcik/jackson-modules-java8 that referenced this issue Mar 26, 2025
bbobcik pushed a commit to bbobcik/jackson-modules-java8 that referenced this issue Mar 27, 2025
cowtowncoder added a commit that referenced this issue Mar 30, 2025
cowtowncoder added a commit to pjfanning/jackson-databind that referenced this issue Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant