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
  • #7618
Closed
Open
Issue created Oct 07, 2020 by Administrator@rootContributor3 of 5 checklist items completed3/5 checklist items

[BUG] [swift5] 5.0.0-beta2 generates AnyType

Created by: hyounoo

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • [] Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Our api doesn't provide enum types on query params. Version 5.0.0-beta2 cast these enums as AnyType which is not usable in Swift project.

Same issue has reported and resolved for typescript-axos https://github.com/OpenAPITools/openapi-generator/issues/6273

openapi-generator version

@openapitools/openapi-generator-cli@cli-5.0.0-beta2

and master branch

OpenAPI declaration file content or url

https://api-int.icloudhospital.com/swagger/v1/swagger.json

Generation Details

With master branch

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g swift5 -i https://api-int.icloudhospital.com/swagger/v1/swagger.json -o src --skip-validate-spec

With 5.0.0-beta2

openapi-generator generate -g swift5 -i https://api-int.icloudhospital.com/swagger/v1/swagger.json -o src --skip-validate-spec

Steps to reproduce

Since our api doesn't provide enum type on it's query params, I had to add skip-validate-spec

Version 5.0.0-beta2 cast these enums as AnyType which is default for all generator and my Swift project can't find this type.

When I build the master branch and generated client, my project throws below error.

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions image

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/6273

Suggest a fix
Assignee
Assign to
Time tracking