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

No --raw flag recognized for openapi:validate command #1033

Open
Try431 opened this issue Aug 28, 2024 · 1 comment
Open

No --raw flag recognized for openapi:validate command #1033

Try431 opened this issue Aug 28, 2024 · 1 comment
Labels
command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands question Further information is requested

Comments

@Try431
Copy link

Try431 commented Aug 28, 2024

The docs specify that passing in a --raw flag to any of the openapi commands should yield the result in a JSON object, so that the commands can be used in a script. However, at least as of v8.6.6 (which is what I'm on), I only get an error:

$ npx rdme@v8 openapi:validate swagger.yaml --raw

Unknown option: --raw

Is this a bug, or should the documentation be updated to clarify that openapi:validate can't be used programmatically? It'd be really helpful to be able to check the output before syncing a newly-generated swagger doc in our CI.

Thanks!

@kanadgupta
Copy link
Member

Hi @Try431! The --raw flag is only available on openapi, not on openapi:validate. Apologies for the confusion there.

Our validation errors may change without warning so we don't recommend relying on the validation output itself, which is why I'm a little hesitant to ship a --raw flag for openapi:validate.

As a safer alternative, I'd recommend using the exit code instead. For all rdme commands, a zero exit code indicates a successful state and a non-zero exit code indicates an error. Would that work for your use case?

@kanadgupta kanadgupta added question Further information is requested command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants