justinrainbow/json-schema — pull request #79 by schmeiserd (2013-11-05 09:03:36+00:00)
Title: fixed "empty array"-bug

This fixes a bug with valid empty JSON arrays.

Example:

This JSON
{"cars":[]}

violates this schema
{
"description": "cars",
"type": "object",
"properties": {
"cars": {
"type": "array",
"required": true,
"minItems": 0,
"items": [
{
"type": "object",
"required": true,
"properties": {
"carBrand": {
"type": "string",
"required": true
},
"carModel": {
"type": "string",
"required": true
}}}]}}}

with this error
cars[0] - is missing and it is required