swagger-api / swagger-api/swagger-codegen
[Swift4] Static declarations are implicitly 'final'; use 'public' instead of 'open'
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
classes and nonstatic variables (AKA properties) are declared "open" in swift ..
static vars and lets must be declared public not OPEN
This is because static vars cannot be overriden.. So if the intention is that they are public outside the module they should be a public class
Earlier swift compilers didn't error but static can't be overridden so public is the appropriate access modifier.
Swagger-codegen version
3.0.5 and 3.0.8 snapshot
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
replace the templates with public static var for properties
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 locating the Swift templates that emit static properties and inspect their access modifiers. Update the relevant generated declarations to use public rather than open, then verify that the generated Swift code compiles with the affected Swagger definition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100