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
support schemas for empty arrays #980
Comments
What's wrong with |
|
hmmm, I suppose nothing is really wrong with |
|
That's strange... Looks like The instance would be valid if the array was empty, because the subschema value of |
|
this might be a bug in Ajv thanks |
OK. Weird. My site uses a version of ajv, but probably not the latest... =/ |
@Relequestual it only seems to be an issue when Ajv is configured with |
I need to validate that an array is present and empty under certain scenarios. I tried
"items": []
but that produces and "invalid" schema:data.items should NOT have fewer than 1 items
(AJV errorsText)i.e. I'd like to do the following:
or maybe:
But I had to do this instead (maybe there is a better way?):
The text was updated successfully, but these errors were encountered: