We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I get ApiException when Swagger tries to retrieve the following JSON: {"apiVersion":1,"providerID":9999999999,"timeStamp":"2016-08-15T14:38:36.172Z"}
The root cause is that JsonUtil.java calls
gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
instead of calling it with single quotes around the "Z"
gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
Specify the format of a yaml field to "date-time"
Add single quotes around the "Z" character in the String argument to gsonBuilder.setDateFormat()
The text was updated successfully, but these errors were encountered:
@martinkbrown thanks for reporting the issue with a suggested fix.
May I know if you've cycle to contribute a PR with the fix?
Sorry, something went wrong.
Yes I will fix this and push my changes.
Thanks.
On Tue, Aug 16, 2016 at 10:19 AM, wing328 notifications@github.com wrote:
@martinkbrown https://github.com/martinkbrown thanks for reporting the issue with a suggested fix. May I know if you've cycle to contribute a PR with the fix? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub #3590 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAmgXfdi1tGcCJM5Fu1J6nXStyCEmFWoks5qgccBgaJpZM4JkgmE .
@martinkbrown https://github.com/martinkbrown thanks for reporting the issue with a suggested fix.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub #3590 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAmgXfdi1tGcCJM5Fu1J6nXStyCEmFWoks5qgccBgaJpZM4JkgmE .
Martin K. Brown
A more complete solution would be to use https://github.com/google/gson/blob/master/extras/src/main/java/com/google/gson/typeadapters/UtcDateTypeAdapter.java or joda. If you only set 'Z', you can't parse time offset as specified in rfc3339.
Single quoted 'Z' stands for the date is in GMT. So, 'XXX' would be nice for various environment.
gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
https://developer.android.com/reference/java/text/SimpleDateFormat.html
If I'm not mistaken, XXX is not available for older versions of the android API.
No branches or pull requests
Description
I get ApiException when Swagger tries to retrieve the following JSON:
{"apiVersion":1,"providerID":9999999999,"timeStamp":"2016-08-15T14:38:36.172Z"}
The root cause is that JsonUtil.java calls
gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
instead of calling it with single quotes around the "Z"
gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
2.0
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Specify the format of a yaml field to "date-time"
Related issues
Suggest a Fix
Add single quotes around the "Z" character in the String argument to gsonBuilder.setDateFormat()
The text was updated successfully, but these errors were encountered: