Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant