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
  • #9030
Closed
Open
Issue created Mar 21, 2021 by Administrator@rootContributor

[REQ] [Swift5] Hashable struct models

Created by: maoyama

Is your feature request related to a problem? Please describe.

I'm always frustrated because the generated struct models aren't Hashable. That happens often because DiffableDatasource and SwiftUI.List require a Hashable model. Originally, we just had to define Hashable in the original type declaration of the struct models, but now we have to make the following choices:

  • Customize the Template
  • Manually add a lot of x-swift-hashable to swagger.yml
  • Write a lot of boilerplate code with Extension (because it will be a separate file from the definition)

Describe the solution you'd like

Always make all struct models Hashable like Codable. This doesn't cause any problems and it's a very simple solution. In addition, x-swift-hashable is no longer needed, reducing code. The work of the Swift compiler and the code generated by the Swift compiler will be a lot, but it will be negligible.

Describe alternatives you've considered

Add a flag to additional-properties. If we need a Hashable compliant model, specify it.

Additional context

Assignee
Assign to
Time tracking