From bc536c2e9144f2b8915154bda694b350c93cd715 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Mon, 12 Dec 2016 11:22:19 -0800 Subject: [PATCH] String arrays default to empty. Also, be clear about the defaulting in the description for "required". --- jsonschema-validation.xml | 6 +++++- schema.json | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 1c3aa1c0..e4c2c572 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -461,6 +461,10 @@ An object instance is valid against this keyword if its property set contains all elements in this keyword's array value. + + If this keyword is not present, it may be considered present + as an empty array. +
@@ -604,7 +608,7 @@
- + This keyword's value MUST be an array. This array MUST have at least one element. diff --git a/schema.json b/schema.json index 3b9019c8..4260825b 100644 --- a/schema.json +++ b/schema.json @@ -32,7 +32,8 @@ "stringArray": { "type": "array", "items": { "type": "string" }, - "uniqueItems": true + "uniqueItems": true, + "defaultItems": [] } }, "type": "object",