[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
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/6273