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

Feature request: Add --create flag to api:update #218

Open
rchanapai opened this issue Nov 15, 2021 · 0 comments
Open

Feature request: Add --create flag to api:update #218

rchanapai opened this issue Nov 15, 2021 · 0 comments

Comments

@rchanapai
Copy link

rchanapai commented Nov 15, 2021

I'm currently trying to set up a workflow where I create my OAS3 specification as a yaml file locally, and generate server code with Gradle. The reason for this is to make sure all changes to my API specification is done through pull requests, and all changes are tracked in git.

My idea is to use the swaggerhub CLI to keep my API documentation up to date as a task in my CI pipeline. The problem I'm facing is that I feel like the CLI is lacking some functionality. What I want is for the CLI to look at the version in my OAS3 spec and update the version in swaggerhub if a matching version already exists, or create a new version in swaggerhub if the version in the spec is incremented with no matching version in Swaggerhub. Today when I try to perform api:update with a version in my OAS spec that does'nt exist in Swaggerhub I receive an error message stating Error: Unknown API <Owner>/<API>/<Version from API spec>

As it is now, I have to try and create a "smart" pipeline that alternate between api:create and api:upgrade depending on what changed in my specification.

My suggestion would is to add a --create flag to the api:upgrade command, that tells the CLI to first attempt to upgrade the version of the API listed in the specification. If such a version does not exist in swaggerhub, it creates said version instead.

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