Skip to content
Peter Svetlichny edited this page Aug 3, 2015 · 3 revisions

Validation for array types.


additionalItems and items


additionalItems as schema

Schema

"schema": {
	"items": [{}],
	"additionalItems": {"type": "integer"}
}

API

var schema = json
            .items([json.schema()])
            .additionalItems(json.integer());

maxItems


maxItems validation

Schema

"schema": {"maxItems": 2}

API

var schema = json.maxItems(2);

minItems


minItems validation

Schema

"schema": {"minItems": 1}

API

var schema = json.minItems(1);

uniqueItems


uniqueItems validation

Schema

"schema": {"uniqueItems": true}

API

var schema = json.uniqueItems(true);