[Java] Fix okhttp-gson datetime converter compilation#6230
[Java] Fix okhttp-gson datetime converter compilation#6230wing328 merged 1 commit intoswagger-api:masterfrom
Conversation
|
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. |
|
Thanks @cbornet that's the context I needed. I'll update with a proper fix tomorrow. |
|
PTAL @cbornet |
|
Removing the other PR is not the good way to solve this either ! new DateTimeFormatterBuilder().append(ISODateTimeFormat.dateTime(), ISODateTimeFormat.dateOptionalTimeParser()).toFormatter();@lwander can you test this ? |
|
Ah I misunderstood, I thought you wanted the formatter not to be configurable at runtime. Will give that a shot |
ef41f69 to
f0d3879
Compare
|
PTAL @cbornet |
|
LGTM. Can you also update the samples ? |
|
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. |
|
And if you could also do it for retrofit (https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache#L94) that'd be awesome ! |
|
Sure thing |
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif 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\.3.0.0branch 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.