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

[Java] Fix okhttp-gson datetime converter compilation #6230

Merged
merged 1 commit into from
Aug 14, 2017

Conversation

lwander
Copy link
Contributor

@lwander lwander commented Aug 3, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

Description of the PR

This commit f1e237f seemed to have introduce unprompted new properties to the DateTimeTypeAdaptor. While this technically changes the intended behavior of having two separate date time formatters for parsing and printing, I can't see reverting this breaking anything since the generated code in its current state cannot compile.

@cbornet
Copy link
Contributor

cbornet commented Aug 3, 2017

This is not the right way to fix. The 2 formatters are needed as per #4473. It conflicted with another PR that enabled configuring the formatter at runtime.

@lwander
Copy link
Contributor Author

lwander commented Aug 3, 2017

Thanks @cbornet that's the context I needed. I'll update with a proper fix tomorrow.

@lwander
Copy link
Contributor Author

lwander commented Aug 4, 2017

PTAL @cbornet

@cbornet
Copy link
Contributor

cbornet commented Aug 4, 2017

Removing the other PR is not the good way to solve this either !
After thinking of it, I think there's a better way to solve #4473 using a single formatter which would be by default:

new DateTimeFormatterBuilder().append(ISODateTimeFormat.dateTime(), ISODateTimeFormat.dateOptionalTimeParser()).toFormatter();

@lwander can you test this ?

@lwander
Copy link
Contributor Author

lwander commented Aug 4, 2017

Ah I misunderstood, I thought you wanted the formatter not to be configurable at runtime. Will give that a shot

@lwander lwander force-pushed the fix-formatter branch 2 times, most recently from ef41f69 to f0d3879 Compare August 7, 2017 14:05
@lwander
Copy link
Contributor Author

lwander commented Aug 7, 2017

PTAL @cbornet

@cbornet
Copy link
Contributor

cbornet commented Aug 7, 2017

LGTM. Can you also update the samples ?

@lwander
Copy link
Contributor Author

lwander commented Aug 7, 2017

I was thinking of updating the samples in a separate PR because it seems they haven't been updated in some time. I'll file a separate PR to update the java petstore samples (minus this change), then once that's merged update the samples to just include this change.

@lwander
Copy link
Contributor Author

lwander commented Aug 7, 2017

#6256

@cbornet
Copy link
Contributor

cbornet commented Aug 7, 2017

@lwander
Copy link
Contributor Author

lwander commented Aug 7, 2017

Sure thing

@wing328 wing328 merged commit 23d0fed into swagger-api:master Aug 14, 2017
@lwander lwander deleted the fix-formatter branch August 14, 2017 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants