-
Notifications
You must be signed in to change notification settings - Fork 87
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
File unexpectedly passes validation - should complain about arrays in response or undefined type #98
Comments
Hmm yeah that's an interesting one. Neither would be tough to add and I agree that this should probably be flagged somehow. I'm inclined to lean towards treating the schema as an array due to the presence of the @mkistler what do you think? |
I won't advocate this as a general rule, but in this particular case, I think we should treat a schema with |
@jamescooke If you agree with that, I can implement that fix this week |
🎉 This issue has been resolved in version 0.13.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks 👍 - can confirm this is working great in v0.13.5 https://github.com/IBM/openapi-validator/releases/tag/v0.13.5 |
Am running v0.13.3 installed inside a Node 12.4 Docker container.
Given the following openapi v3 spec:
This example file is very closely related to the example in #71 - but I've removed the
type: array
specification fromThingsArray
. This is a little bit of a grey area I guess since the openapi file is not explicit about the type ofThingsArray
, however, the Swagger Editor renders this as an Array and gives an example JSON of:Current behaviour
The file above passes the validator.
Expected behaviour
The file above should fail with something - I can see one of two options, but would be generally happy as long as some kind of error or warning is returned for this case.
Treat it as an array
Assume that
ThingsArray
which has unspecified'type'
is an array and give the error:Complain about missing type
Add a warning that indicates that
'type'
has not been provided:The text was updated successfully, but these errors were encountered: