swagger-api / swagger-api/swagger-codegen

Warnings in Swift 4.2

Open
#8,336 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Generated swift code creates the following warnings when using Xcode 10 beta 1 or beta 2 with Swift 4.2"

Static declarations are implicitly 'final'; use 'public' instead of 'open'

These occur at lines such as:

open class SwaggerClientAPI {
    open static var basePath = "http://localhost:5987"
    open static var credential: URLCredential?
    open static var customHeaders: [String:String] = [:]
    open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
}

Swagger-codegen version

Latest release

Command line used for generation
Steps to reproduce

Open Swift 4 generated files in Xcode 10 and ensure Swift 4.2 is selected

Suggest a fix/enhancement

Adjust swift4 generator template, or create a swift4.2 template?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no specific file or test; locate the Swift 4 generator template that emits the SwaggerClientAPI static declarations and reproduce generation with Swift 4.2 in Xcode 10. Done means generated Swift files no longer produce the reported implicit-final/open warnings.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.