Closed gap777 closed 3 years ago
I'm confused about the validation provided for external examples.
Our end point snippet:
... responses: '200': content: application/json: schema: $ref: '#/components/schemas/Schema1' examples: ex1: $ref: "examples/example1.json"
If the example has, for example, and incorrect value type for a property, openapi-examples-validator properly detects it:
openapi-examples-validator
Validating examples Schemas with examples found: 5 Examples without schema found: 28 Total examples found: 73 Errors found. [ { "type": "Validation", "message": "should be string", "keyword": "type", "dataPath": ".data[0].foo.bar", "schemaPath": "#/allOf/1/properties/data/items/allOf/0/properties/thing/allOf/0/properties/thang/type", "params": { "type": "string" }, "examplePath": "/paths/~1a~1b~1jc~1{id}~1d/get/responses/200/content/application~1json/examples/ex1/value" }
However, when my example is missing required properties (which are listed in the schema's required list), no errors are flagged.
required
Please provide a Minimal, Reproducible Example and the command you used, with all arguments.
Closing this, as there was no response after a month.
I'm confused about the validation provided for external examples.
Our end point snippet:
If the example has, for example, and incorrect value type for a property,
openapi-examples-validator
properly detects it:However, when my example is missing required properties (which are listed in the schema's
required
list), no errors are flagged.