Open anilj1 opened 5 years ago
It is important to know how to generate the python package with API specification specific name. Without it, when I install the package into my virtual python variable (and even in default system level paths), it overwrites the previous 'openapi_client' package.
Can someone please provide the way to generate unique/API specific python package?
I have tried to generate the model and api packages with specific names by using following command line options, but the main package is still the same.
--model-package mymodel --api-package myapi
Hi, for now, I programmatically, modified the setup.py file (after it is generated) and changed the value of NAME variable. This workaround has helped solve this problem and I am able to 'install' the individual python module.
Hope this helps others to follow the step and solve this problem in interim. This however should happen more formally from the code generator.
Programmatic modification of the NAME variable in setup.py is not helping as it is not really changing the module name "openapi_client" when it installs the package. Can someone please provide a correct method to address this issue? Thank you.
Try adding -DpackageName=new_name
running:
swagger-codegen generate -i lookerapi.json -l python -o looker_sdk -c config.json
didn't work but running:
swagger-codegen generate -i lookerapi.json -l python -o looker_sdk -DpackageName=looker
did. Thanks!
Does anyone have idea how to change the class-name in the generated python client code ? It is always "DefaultApi" and I cannot find a suitable param to set using the "-D" option.
-DpackageName
Thanks, swagger-codegen generate --help
manual doesn't list this argument tho.
Here are the two options I use when running the CLI :
--model-name-prefix simulator_server -D packageName=simulator_server
I'm still confused what they both mean. I put the same value for both.
Description
I have two API specs, but the generator for python produces the same module name (openapi_client) for each one. I need to import both into a project. How can I configure the generator to produce to unique package names under the lib directory?
Swagger-codegen version
3.0.0
Swagger declaration file content or url
N/A
Command line used for generation
java -jar ../../Nemo-thirdparty/openapi-generator-3.2.0/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ../test_spec_01.yaml -g python -o ./pyclient
Steps to reproduce
Run above command
Related issues/PRs
N/A
Suggest a fix/enhancement
N/A