Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to generate all schemas with one call to the CLI #195

Open
daviseford opened this issue Aug 23, 2023 · 0 comments
Open

Add ability to generate all schemas with one call to the CLI #195

daviseford opened this issue Aug 23, 2023 · 0 comments

Comments

@daviseford
Copy link

daviseford commented Aug 23, 2023

Hi, as a developer, I'd love to be able to use the CLI tool like so:

# Generates all schemas listed in the `openapi-codegen.config.ts` file
npx openapi-codegen gen *

# or, alternatively, maybe an empty argument for `gen` would mean "generate all"
npx openapi-codegen gen

# or, maybe
npx openapi-codegen gen --all

My project has a half dozen APIs added, each with their own generate command in my package.json. I'd love the ability to quickly update all of the APIs listed in the config file.

Currently, I manually accomplish this by doing something like this in my package.json, but you can see how it gets pretty verbose, pretty quickly

"gen:Api1": "npx openapi-codegen gen Api1",
"gen:Api2": "npx openapi-codegen gen Api2",
"gen:Api3": "npx openapi-codegen gen Api3",
"gen:Api4": "npx openapi-codegen gen Api4",
"gen:Api5": "npx openapi-codegen gen Api5",
"gen:Api6": "npx openapi-codegen gen Api6",
"generateAllApis": "npm run gen:Api1 && npm run gen:Api2 && npm run gen:Api3 &&  npm run gen:Api4 && npm run gen:Api5 && npm run gen:Api6" 
@daviseford daviseford changed the title Add ability to generate all schemas Add ability to generate all schemas with one call to the CLI Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant