Forum Discussion

ghenrard's avatar
ghenrard
New Contributor
2 years ago

schema validation for examples in swagger

Hello, 

With OAS 3.0 it's now possible to add several examples to requests and responses, to clarify the main use cases and how they would look like.

However, I noticed in the Swagger Editor (old or new), those examples are not validated against their schema or sub-schema.

May I suggest to add this as an improvement ?

 

This could avoid some typo errors while creating the examples based on the generic one.

3 Replies

    • ghenrard's avatar
      ghenrard
      New Contributor

      Indeed, warning when an example is not valid is good enough. Even better if it says where (line number, etc.) it's not valid, like it's usually done in the editor 😉

  • Mason234's avatar
    Mason234
    Occasional Visitor

    Yes, your good idea for improving those examples are not validated against their schema or sub-schema some type errors remove.

    itunes for pc