cancel
Showing results for 
Search instead for 
Did you mean: 

Validate examples against the schema

ewoud
Regular Visitor

Validate examples against the schema

I've created my specs and added some examples to the different endpoints.
The specification is valid against the OAS3 validator but this doesn't validate if the provided examples are valid against my schema(s).

I've been looking into a middleware to test my examples, which is ok, but I was looking for a tool where I can just input the yaml-api-specs (incl examples) and where the output would be a validation list of all the examples.

Does anyone know such a tool? Or does have a better way to quickly validate the examples provided in the yaml?

2 REPLIES 2
kishanbora
New Contributor

Re: Validate examples against the schema

openapi4j tool would be useful in your case where you are using OAS 3.0

gpassero
New Member

Re: Validate examples against the schema

We found https://github.com/codekie/openapi-examples-validator from https://openapi.tools/#data-validators. It's a separate step in our dev env, but it does the job wonderfully.

HTH,

gap

 

New Here?
Join us and watch the welcome video:
Announcements