Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1406
Closed
Open
Issue created Nov 09, 2018 by Administrator@rootContributor

[SWIFT4] Generated Code has warnings when using Swift 4.2 Compiler

Created by: james-rantmedia

Description

When using Xcode 10 with swift 4.2, the generated code from the swift4 openapi-generator contains a few warnings. They're not necessarily causing any problems, but I like a clean codebase.

The warnings:

APIs.swift:10:21: Static declarations are implicitly 'final'; use 'public' instead of 'open'
APIs.swift:13:21: Static declarations are implicitly 'final'; use 'public' instead of 'open'
APIs.swift:11:21: Static declarations are implicitly 'final'; use 'public' instead of 'open'
APIs.swift:12:21: Static declarations are implicitly 'final'; use 'public' instead of 'open'
Models.swift:18:14: 'let' properties are implicitly 'final'; use 'public' instead of 'open'
Models.swift:19:14: 'let' properties are implicitly 'final'; use 'public' instead of 'open'
Models.swift:20:14: 'let' properties are implicitly 'final'; use 'public' instead of 'open'
CodableHelper.swift:14:21: Static declarations are implicitly 'final'; use 'public' instead of 'open'
AlamofireImplementations.swift:157:141: Using '!' here is deprecated and will be removed in a future release
AlamofireImplementations.swift:359:141: Using '!' here is deprecated and will be removed in a future release
openapi-generator version

3.3.2

Command line used for generation

openapi-generator generate -i swagger.json -l swift4 -o ~/Desktop/APIClient

Steps to reproduce
  • Generate a swift4 client from an open api spec document.
  • Add the generated code to a Swift 4.2 project and build
  • See warnings
Related issues/PRs

Swagger-Codegen has a related issue (which I also submitted a PR for before knowing about the OpenAPI-Generator fork) https://github.com/swagger-api/swagger-codegen/issues/8336

Suggest a fix/enhancement

I will be submitting a PR to fix these warnings, and will update this issue when it's submitted.

Assignee
Assign to
Time tracking