Description
I am trying to generate a Swift 4 client from a declaration that has a response attribute named throw. I believe since that is a reserved word in Swift and it has not been escaped - the generated client does not compile.
Swagger-codegen version
I have tried with the current stable version for mac: 2.2.3, 2.3.0 (SNAPSHOT) and 3.0.0 (SNAPSHOT)
Swagger declaration file content or url
OpenDotaApi Swagger file https://api.opendota.com/api
Command line used for generation
swagger-codegen generate -l swift4 -i https://api.opendota.com/api
Steps to reproduce
- Run the generation command above.
- Inspect SwaggerClient/Swaggers/Models/InlineResponse200.swift (line 94)
Related issues/PRs
I did not find any.
Suggest a fix/enhancement
It seems like there's no escape/prefix for reserved words in Swift generation. A simple fix would be prefixing it by an underscore symbol.