-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Swift5 models improvements #9205
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
Swift5 models improvements #9205
Conversation
|
I'm a bit tired today, so tomorrow I will review this more carefully, but some initial thoughts, is that I thinks we shouldn't create the equals and hash functions on structs, because they are given automatically for free. |
97f065c to
eb37cc7
Compare
You're correct, |
|
I think that maybe you forgot to update the sample projects, because the structs are still implementing equals and hash functions |
eb37cc7 to
da87772
Compare
|
Please resolve the merge conflicts when you've time. |
I think you will need to do it in the OpenAPI 3.0 spec instead as nullable is only officially support in 3.0 but not 2.0 |
da87772 to
d0ed8aa
Compare
I think this is fine since OAS 2.0 |
d0ed8aa to
9da9ce9
Compare
We are actually move away from 2.0 spec and use mainly 3.0 for samples. Don't worry about it now. I'll do the migration later. Please resolve the merge conflicts when you've time |
9da9ce9 to
86a6047
Compare
Fixes: 0f5e7d1 ("Swift5 models improvements (OpenAPITools#9205)")
* [swift5] Rename the API class to {{projectName}}
Instead of {{projectName}}API. This removes some unnecessary naming
complexity.
* [swift5] Define models and Configuration classes under namespace
When swiftUseApiNamespace is set, API classes get defined under the
projectName namespace. This does the same for models and the
Configuration class. Plus adding a deprecation warning when using the
un-namespaced variants.
* [swift5] Use CodingKeys in model decoder
Fixes: 0f5e7d1 ("Swift5 models improvements (#9205)")
* [swift5] Add swiftUseApiNamespace to urlsessionLibrary config
* Update samples
* Try to reduce model changes
Co-authored-by: Bruno Coelho <[email protected]>

final classinstead ofstructCodingKeyshashfuncsnullvaluesuseClassesto urlsessionLibrary configPR checklist
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*.For Windows users, please run the script in Git BASH.
master,5.1.x,6.0.x