Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate that the example value matches to the schema #134

Closed
Sweetchuck opened this issue Nov 25, 2019 · 2 comments
Closed

Validate that the example value matches to the schema #134

Sweetchuck opened this issue Nov 25, 2019 · 2 comments

Comments

@Sweetchuck
Copy link

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.

@JamesMessinger JamesMessinger transferred this issue from APIDevTools/swagger-cli Nov 25, 2019
@stueynz
Copy link

stueynz commented Jul 22, 2021

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

@philsturgeon
Copy link
Member

That tool or even Spectral could do the job, and lots of other fancy validation on top, so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants