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

Upsert on re-syncing w/ cli #920

Open
TheHumanJenkins opened this issue Oct 12, 2023 · 1 comment
Open

Upsert on re-syncing w/ cli #920

TheHumanJenkins opened this issue Oct 12, 2023 · 1 comment
Labels
API Underlying issue is with the ReadMe API and not necessarily the `rdme` client itself bug Something isn't working command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands

Comments

@TheHumanJenkins
Copy link

There is some unintentional behavior with the CLI allowing the creation/update on an oas re-sync. I would think if you pass an incorrect OAS ID on an update or re-sync it would result in an error.

I am able to pass a categoryID to this cli and it will create a new OAS definition; hence duplicating the spec within a project.

Unless the method is designed to be an upsert; but the documentation isn’t clear that if you pass an id that doesn’t exists it will create the oas using that id. Probably this is an unintentional design or docs are incorrect.

Docs:
This will edit (re-sync) an existing API definition (identified by --id) within your ReadMe project. This is the recommended approach for usage in CI environments.

rdme openapi [url-or-local-path-to-file] --id={existing-id}

@kanadgupta kanadgupta added bug Something isn't working API Underlying issue is with the ReadMe API and not necessarily the `rdme` client itself command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands labels Oct 16, 2023
@kanadgupta
Copy link
Member

Thanks for flagging this @TheHumanJenkins! You've discovered some legacy behavior that was added in support of our previous GitHub Action (that has been sunset for well over a year now and hasn't been usable in the GitHub Actions runners since a few months ago). This upsert behavior is undocumented and we don't recommend utilizing it since it's in our backlog to remove this logic entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Underlying issue is with the ReadMe API and not necessarily the `rdme` client itself bug Something isn't working command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands
Development

No branches or pull requests

2 participants