-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[#19921] Add RFC 3339 compatible Jackson module for java.time types #19925
base: master
Are you sure you want to change the base?
[#19921] Add RFC 3339 compatible Jackson module for java.time types #19925
Conversation
a4f83f8
to
c0703e3
Compare
I'm pretty sure Java implementations can already deserialize RFC3339 datetimes... |
@@ -187,6 +187,7 @@ public class ApiClient { | |||
{{/joda}} | |||
objectMapper.registerModule(new JavaTimeModule()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JavaTimeModule can already deserialize RFC3339 datetimes
I can tell you, it does not. The If you don't believe me, try it out for yourself: https://onecompiler.com/jshell/42vrgfpy8 |
As per its ABNF, RFC3339 doesn't support space as a separator. |
I integrated an application which uses this format, so clearly, there is precedent for this need. I doubt that application will change the representation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @beikov, thanks for the PR! Apart from the small topics I commented on separately, this PR looks good to me. I tested the changes locally and can confirm that the changes enable the parsing of additional timestamp formats.
modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/Java/RFC3339InstantDeserializer.mustache
Show resolved
Hide resolved
...es/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see #19925 (comment) and #19925 (comment)
c0703e3
to
462e7d4
Compare
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)