swagger-parser
swagger-parser copied to clipboard
Validate that the example value matches to the schema
Currently the example value can have a different data structure that is defined in the schema and the swagger-cli validate doesn't rise an error.
example:
foo:
bar: a
baz: b
type: object
properties:
foo:
type: integer
format: int32
default: 0
I think it would be very useful if the example value would be validated against the corresponding schema.
Actually there's already a tool in NPM that does that https://www.npmjs.com/package/openapi-examples-validator?activeTab=readme - so I think can close the request
That tool or even Spectral could do the job, and lots of other fancy validation on top, so I'll close this.