Skip to content
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

Add no-arg constructor for DateTimeDeserializer #124

Closed
abbychau opened this issue Mar 16, 2022 · 3 comments
Closed

Add no-arg constructor for DateTimeDeserializer #124

abbychau opened this issue Mar 16, 2022 · 3 comments
Labels
Milestone

Comments

@abbychau
Copy link

ref: cf2f4c2#r68702429

I have no clue if is was regarded as public API 7 years ago, but I believe so. And I would prefer to have no-arg constructor in the next version of jackson-datatype-joda too, because we have the usage like
@JsonDeserialize(using = DateTimeDeserializer::class)

here is the problem met by people: https://stackoverflow.com/questions/38433432/class-com-fasterxml-jackson-datatype-joda-deser-datetimedeserializer-has-no-defa

@cowtowncoder
Copy link
Member

What puzzles me is that I do not actually see a no-arguments constructor in Jackson 2.6 sources either.
As far as I know, code would never have worked: that class has never had 0-args constructor as far I can see from version tags (not even in 2.0).

I will also add a note in SO question: the obvious usual answer should be "register JodaModule!".

@cowtowncoder
Copy link
Member

Ok based on reading the question I think that this issue is actually not about fixing anything (there never was such constructor) but making it possible. That would require a different approach; if you look at JodaModule you can see the reasoning why this class has no 0-arguments constructor -- it is used as handler for 2 subtypes (ReadableDateTime, ReadableInstant). It would technically be possible to add concrete sub-classes if that was desired but not sure it's worth the effort. I am still not sure why registering JodaModule (or custom module registering the same) would not be possible.

@cowtowncoder cowtowncoder added this to the 2.14.0 milestone Mar 29, 2022
cowtowncoder added a commit that referenced this issue Mar 29, 2022
@cowtowncoder
Copy link
Member

Thank you @abbychau for contributing this! Will be included in 2.14.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants