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

Default string formats that will deserialise successfully to an Instant? #108

Closed
anthonyleonard opened this issue Mar 28, 2019 · 4 comments
Labels
documentation Issue that documentation improvements could solve or alleviate good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project

Comments

@anthonyleonard
Copy link

What string formats will deserialise successfully to an Instant type, using a vanilla object mapper?

I would like to follow Postels law and be as wide as possible in accepting serialised time formats, but my testers would like to know the range of possible date formats so they can test around it.

Thanks :)

@cowtowncoder
Copy link
Member

Seems like this is something that could be documented on README.md either at main level, or for Date/Time module.

Marking as easy for new contributors.

@cowtowncoder cowtowncoder added good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project documentation Issue that documentation improvements could solve or alleviate labels Aug 13, 2019
@alevskyi
Copy link

alevskyi commented Feb 5, 2020

It appears that only format for string values for property with type java.time.Instant is java.time.format.DateTimeFormatter.ISO_INSTANT
Investigated on jackson-datatype-jsr310 version 2.9.0. In this line

addDeserializer(Instant.class, InstantDeserializer.INSTANT);
used InstantDeserializer which supports only DateTimeFormatter.ISO_INSTANT.
Is this worth documenting?

@kupci
Copy link
Member

kupci commented Feb 6, 2020

Yes, I think it's worth documenting, and answer's the OP's question:

What string formats will deserialise successfully to an Instant type, using a vanilla object mapper?
[snip] my testers would like to know the range of possible date formats so they can test around it.

Now, as where to put the documentation, to answer Cowtowncoder's question,

Seems like this is something that could be documented on README.md either at main level, or for Date/Time module.

my suggestion would be the readme.md for the Date/Time because it seems to have that level of detail:

https://github.com/FasterXML/jackson-modules-java8/tree/master/datetime

alevskyi added a commit to alevskyi/jackson-modules-java8 that referenced this issue Feb 9, 2020
@cowtowncoder cowtowncoder added the hacktoberfest Issue related to Hactoberfest2020 activities, eligible for additional rewards label Sep 30, 2020
@cowtowncoder cowtowncoder removed the hacktoberfest Issue related to Hactoberfest2020 activities, eligible for additional rewards label Feb 4, 2024
@cowtowncoder
Copy link
Member

Looks like README was modified, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue that documentation improvements could solve or alleviate good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project
Projects
None yet
Development

No branches or pull requests

4 participants