swagger-cli
swagger-cli copied to clipboard
invalid examples should not fail validation
We use our openapi 3.0.1 specs to automatically generate mocks and run contract tests. These contract tests include testing that the implementing server correctly validates requests and returns expected 400 Bad Request responses. This means we have examples in our docs of invalid requests. We cannot use swagger-cli validate, but would like to, because the validation fails on examples that don't adhere to the schema.
Ideal behavior would be to either be able to mark an example somehow to ignore validation for it, or pass an argument or configuration into swagger-cli validate to bypass validation of certain examples.
I will attempt to create a minimal schema to illustrate the issue.