swagger-api / swagger-api/swagger-codegen
Swift4: Need initializer with default value '=nil'
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I am filing this issue to track the discussion which took place in another issue for swift4: #6641
The request was to have a default value '=nil' in the additional initializer for swift4-generated models.
Example:
public init(foo: String?=nil, bar: String?=nil) {
self.foo = foo
self.bar = bar
}
Swagger-codegen version
All
Swagger declaration file content or url
This is a feature request. See the discussion at the end of the issue listed above for context.
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
Read the discussion in issue #6641, then locate the Swift4 model-generation templates and their additional initializer. Confirm the requested default nil values in generated initializers and verify the generated Swift model output matches the example.
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
- 38/100