-
Notifications
You must be signed in to change notification settings - Fork 45
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
Error if examples in JSON schema are present #89
Comments
Errors aren't great, see #74. However, each of the ValidationError you're seeing comes from the validation backend, not from prance itself. In this case likely the openapi-spec-validator. What I can tell you offhand is that in the example you posted, the referenced path I also do not understand how that second document you posted plays into it. At best, it contains a In the end, without further information, I cannot really provide any other pointers. I'm sorry! |
Ah, I see I pasted the wrong code in my original post, I editted it to actually use the reference. That's what I get for playing around, moving the definitions into the file. But as I understand by now, it is because openapi spec is not actually conform JSON schema. In fact they say in their documentation that I fixed the issue by stripping all examples from the schema before passing it to prance. |
Great to hear you solved it! Yes, OpenAPI specs are a bit dodgy that way - they say they're JSON Schema, but they're not JSON Schema in a number of places. This is one of them. It doesn't help that they bring YAML thinking to JSON as well and/or mix the two. |
Expected Behaviour
Since the JSON schema allows for a (set of) examples to be included in the schema definition, I would expect prance to find the definitions valid.
Minimal Example Spec
api.yaml:
And the corresponding JSON schema
Actual Behaviour
I get a very long and (imho) hard to interpret error:
Steps to Reproduce
I try to validate the api using
prance validate api.yaml
Environment
@jfinkhaeuser
The text was updated successfully, but these errors were encountered: