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
  • #2588
Closed
Open
Issue created Apr 04, 2019 by Administrator@rootContributor

[Swift] Inheritance issue

Created by: SergeyPetrachkov

Description

Hi guys, I've installed the latest generator via homebrew and now I'm trying to generate a client for my iOS app. I appreciate structs over classes (Apple does too!), but here is one problem with inheritance, as Swift structs being value types do not support inheritance. There's a base class and a few descendants described in API yaml. Descendants do not inherit base's properties and I get invalid API client.

openapi-generator version

3.3.4 (latest available with Homebrew

OpenAPI declaration file content or url

here is a gist

Sorry, I can't provide the full spec

Command line used for generation

openapi-generator generate -l swift4 -i XXX

Suggest a fix/enhancement

I would think of either generating abstract descendants as classes or use a composition pattern and stay with structs. Though I am not sure either is easily possible

Assignee
Assign to
Time tracking