Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was 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

@armen-ch

Description

@armen-ch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions