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

[Issue 9178] Handle multiple formats when decoding dates #9730

Merged
merged 4 commits into from
Oct 3, 2019

Conversation

plam4u
Copy link
Contributor

@plam4u plam4u commented Sep 24, 2019

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: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This PR adds multiple date formats discussed and suggested in #9178

When parsing dates, the CodableHelper was handling only one specific date format. This means that responses with a different format failed to decode.

Changes done:

  • Migrated the samples in swift4 folder to actually use Swift 4.2
  • Fixed the issue with the date formatting
  • Added tests to confirm that the formatting is working
  • Executed the mvn-integration script and updated the script to say Swift 4 instead of 3

The last version was Swift 3.0 which is very old. The project had some
compile errors and was not working at all with Xcode 10.
Some changes are generated by Cocoapods using the latest version.
Manual fixes are done only for the .swift files
@plam4u plam4u changed the title Issue 9178 [Issue 9178] Handle multiple formats when decoding dates Sep 24, 2019
@plam4u
Copy link
Contributor Author

plam4u commented Sep 25, 2019

@HugoMario could you check this PR?

@HugoMario
Copy link
Contributor

hi @plam4u, sorry for delay, sure, looking now

@HugoMario
Copy link
Contributor

@plam4u, unfortunately i'm not so familiar with swift, however i tested locally generating codew with differents inputs and worked fine for me. If you are confident with your changes i can merge them now.

@plam4u
Copy link
Contributor Author

plam4u commented Oct 3, 2019

hi @HugoMario
ideally, someone else should test this as well but since this is a simpler change, I'm pretty confident with it. If you know somebody with Swift knowledge, you could ping him to at least run it and see that it works fine for him as well.

If nobody responds soon, if it is okay with you, you can merge it. Thank you :)

@HugoMario
Copy link
Contributor

@plam4u, sure, let's do as you suggest.

@saltwat5r
Copy link

Hi, why the latest version of generator (3.0.22) doesn't use this version of the template?

This was referenced Mar 11, 2021
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants