From dd6b84e2e3db9fba95dbc2ff3ba41190564eb582 Mon Sep 17 00:00:00 2001 From: James Kavanaugh Date: Wed, 21 Dec 2022 06:48:58 +0800 Subject: [PATCH] Add test case for undefined first optionalProperty --- tests/validation.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/validation.json b/tests/validation.json index a0abb6a..42342eb 100644 --- a/tests/validation.json +++ b/tests/validation.json @@ -3760,6 +3760,30 @@ }, "errors": [] }, + "strict optionalProperties - ok missing first optionalProperty": { + "schema": { + "optionalProperties": { + "foo": {"type": "string"}, + "bar": {"type": "string"} + } + }, + "instance": { + "bar": "bar" + }, + "errors": [] + }, + "non-strict optionalProperties - ok no optionalProperty":{ + "schema": { + "optionalProperties": { + "foo": {"type": "string"} + }, + "additionalProperties": true + }, + "instance": { + "bar": "bar" + }, + "errors": [] + }, "strict optionalProperties - bad wrong type": { "schema": { "optionalProperties": {