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

Dredd doesn't make consistency check between OpenAPI schema and example #2047

Open
armen-ch opened this issue Apr 15, 2022 · 0 comments
Open

Comments

@armen-ch
Copy link

Is your feature request related to a problem? Please describe.
According to Dredd documentation: "If body parameter has schema.example (spec), it is used as a raw JSON sample for the request body. If it’s not present, Dredd’s OpenAPI 2 adapter generates sample values from the JSON Schema provided in the schema (spec) property."

.. which is fine. But if there is an inconsistency between the schema and the example, the example will be taken as truth without notifying the user of the inconsistency with the schema. This is not good for cases where the developer updates the schema and forgets to update the example as well, or vice versa.

Describe the solution you'd like
Dredd to throw error of example-to-schema inconsistency

Describe alternatives you've considered
probably having a configuration parameter for turning the error into a warning

Additional context
Tried:
OpenAPI: 3.0.1
dredd v14.1.0

2022-04-15 at 14-14-00

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