swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
I generate a python client from an open-api v2 spec that comes from a Golang project.
The generated python module names are prefixed with the source Golang package, for example take model_ + build_version_info.py from the screenshot below.
I believe this is expected because the related definition in the swagger file is "model.BuildVersionInfo". However, this is non-ideal because it makes the python client cluttered! I tried tinkering with --model-name-prefix but it'd just prepend a string and not overrides the existing prefix.
Similar but not quite the same question. The generated API modules are suffixed with _api. I argue that's not needed because they're already within the api folder. Is there an option to disable this?
Description
I generate a python client from an open-api v2 spec that comes from a Golang project.
The generated python module names are prefixed with the source Golang package, for example take
model_
+build_version_info.py
from the screenshot below.I believe this is expected because the related definition in the swagger file is
"model.BuildVersionInfo"
. However, this is non-ideal because it makes the python client cluttered! I tried tinkering with--model-name-prefix
but it'd just prepend a string and not overrides the existing prefix.Swagger-codegen version
Swagger declaration file content or URL
https://raw.githubusercontent.com/filecoin-project/bacalhau/main/docs/swagger.json
Command line used for generation
Related issues/PRs
https://github.com/swagger-api/swagger-codegen/issues/1255
Suggest a fix/enhancement
Instead, I'd like to either remove the
model_
prefix, or have sub-packages within themodels
package. Is this even possible?