You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I compile for -l python-flask and use spaces in my Swagger tags, e.g.:
tags:
- name: General components
The generated Python server code, when executed as advised in the generated README fails. i.e. if you run this:
python3 -m swagger_server
You get the following error:
Failed to add operation for POST [...]
[...]
connexion.exceptions.ResolverError: <ResolverError: Cannot resolve operationId "swagger_server.controllers.general components_controller.component_accumulator_post"! Import error was "No module named 'swagger_server.controllers.general components_controller'">
The module swagger_server.controllers.general components_controller does not exist because it is compiled as swagger_server.controllers.general_components_controller ... the space replaced by an underbar.
Swagger-codegen version
latest at time of writing (master/HEAD).
Swagger declaration file content or url
Except posted above. Code is proprietary and I cannot share ATM.
I suspect you can just try using tags with spaces.
Related issues/PRs
None
Suggest a fix/enhancement
The generated code has to know what the generator created. If the generator inserts an underbar the generated code has to know this or .. the generator has to generate an error, i.e. "Spaces in tags not supported".
For now I have removed the space and everything works.
The text was updated successfully, but these errors were encountered:
Description
When I compile for
-l python-flask
and use spaces in my Swagger tags, e.g.:The generated Python server code, when executed as advised in the generated README fails. i.e. if you run this:
You get the following error:
The module
swagger_server.controllers.general components_controller
does not exist because it is compiled asswagger_server.controllers.general_components_controller
... the space replaced by an underbar.Swagger-codegen version
latest at time of writing (master/HEAD).
Swagger declaration file content or url
Except posted above. Code is proprietary and I cannot share ATM.
Command line used for generation
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i //swagger/swagger.yml -l python-flask -o ../runner
Steps to reproduce
I suspect you can just try using tags with spaces.
Related issues/PRs
None
Suggest a fix/enhancement
The generated code has to know what the generator created. If the generator inserts an underbar the generated code has to know this or .. the generator has to generate an error, i.e. "Spaces in tags not supported".
For now I have removed the space and everything works.
The text was updated successfully, but these errors were encountered: