From 1b79d43cbf81397032d0181025b61fd2c243fd87 Mon Sep 17 00:00:00 2001 From: Alvaro Cabrera <pateketrueke@gmail.com> Date: Fri, 2 Jun 2017 12:44:33 -0500 Subject: [PATCH] Add spec from pending #255 PR; fix #238 --- spec/schema/core/issues/issue-238.json | 64 ++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 spec/schema/core/issues/issue-238.json diff --git a/spec/schema/core/issues/issue-238.json b/spec/schema/core/issues/issue-238.json new file mode 100644 index 00000000..5a314e47 --- /dev/null +++ b/spec/schema/core/issues/issue-238.json @@ -0,0 +1,64 @@ +[ + { + "description": "allow empty arrays and null values as result", + "tests": [ + { + "description": "should not filter out null elements from array", + "schema": { + "properties": { + "myArrayWithNullValue": { + "type": [ + "array" + ], + "items": { + "type": [ + "null" + ] + }, + "minimum": 1, + "minItems": 1, + "maxItems": 1 + } + }, + "required": [ + "myArrayWithNullValue" + ] + }, + "valid": true + }, + { + "description": "should create array without elements", + "schema": { + "type": "array", + "items": { + "type": [ + "null" + ] + }, + "minimum": 1, + "maximum": 1, + "minItems": 0, + "maxItems": 0 + }, + "valid": true + }, + { + "description": "should create null value", + "schema": { + "id": "fooNull", + "properties": { + "fooNull": { + "type": [ + "null" + ] + } + }, + "required": [ + "fooNull" + ] + }, + "valid": true + } + ] + } +] -- GitLab