swagger-api / swagger-api/swagger-codegen-generators
[swift 5] Default value for optional in init parameters, like done for Swift 4 generator
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
Hi.
Like done for Swift 4 generator it would be helpful if Swift model objects had a default nil value for optional parameters.
This fix has already be done for issue #467 for Swift 4 generator and merged into master, but the Swift 5 generator works differently.
Could I send a pull request for this change in the template?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the Swift 5 generator template with the Swift 4 change from issue #467. Trace how Swift 5 model initializer parameters are rendered, then verify that optional parameters receive a default nil value without changing required parameters. Done means the generated Swift model code matches the requested optional-parameter behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100