openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

feat: CLI option to define output directory

Open JasperS2307 opened this issue 2 years ago • 5 comments

Not sure if I'm the only one, but I like to put (all) the generated clients together in a folder for the same project. Maybe it needs some clarification that you change the folder where the generated client is saved, not the name of the generated folder, but not sure if that is needed. If people think this is a bad idea, let me know so maybe I change my mind ;-)

  • [ ] Tests
  • [ ] Codestyle
  • [ ] ..?

JasperS2307 avatar May 26 '22 13:05 JasperS2307

Just for your perusal, this may be related to https://github.com/openapi-generators/openapi-python-client/discussions/237 .

dbanty avatar Jun 03 '22 02:06 dbanty

hey guys, I would like to have this too! do you need any help with this PR? this feature looks pretty straightforward

danielgafni avatar Sep 01 '22 18:09 danielgafni

To be clear, the intended behavior is the same as if the user had switched into the passed output directory themselves (e.g., with cd) before running the command?

dbanty avatar Sep 18 '22 18:09 dbanty

I want this option too because it's more comfortable to use output option instead switching of folder. Also it would be better to not create another folder in output folder during build

aletor123 avatar Mar 17 '23 07:03 aletor123

It would be nice to add the ability to generate the SDK directly into an existing folder

Example:

I have `sdk_folder`
Then run
$ openapi-python-client generate --path path/to/spec --output sdk_folder

Then I got `sdk_folder` with generated sdk instead of `sdk_folder/project_name`

It may also make sense to add the --overwrite-if-exists flag for this

NikAzanov avatar Mar 17 '23 07:03 NikAzanov