diff --git a/tests/draft2020-12/unevaluatedProperties.json b/tests/draft2020-12/unevaluatedProperties.json index ae29c9eb..0da38f67 100644 --- a/tests/draft2020-12/unevaluatedProperties.json +++ b/tests/draft2020-12/unevaluatedProperties.json @@ -3,7 +3,6 @@ "description": "unevaluatedProperties true", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "unevaluatedProperties": true }, "tests": [ @@ -25,7 +24,6 @@ "description": "unevaluatedProperties schema", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "unevaluatedProperties": { "type": "string", "minLength": 3 @@ -57,7 +55,6 @@ "description": "unevaluatedProperties false", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "unevaluatedProperties": false }, "tests": [ @@ -79,7 +76,6 @@ "description": "unevaluatedProperties with adjacent properties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -107,7 +103,6 @@ "description": "unevaluatedProperties with adjacent patternProperties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "patternProperties": { "^foo": { "type": "string" } }, @@ -132,13 +127,9 @@ ] }, { - "description": "unevaluatedProperties with adjacent additionalProperties", + "description": "unevaluatedProperties with adjacent bool additionalProperties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "properties": { - "foo": { "type": "string" } - }, "additionalProperties": true, "unevaluatedProperties": false }, @@ -160,11 +151,35 @@ } ] }, + { + "description": "unevaluatedProperties with adjacent non-bool additionalProperties", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": { "type": "string" }, + "unevaluatedProperties": false + }, + "tests": [ + { + "description": "with only valid additional properties", + "data": { + "foo": "foo" + }, + "valid": true + }, + { + "description": "with invalid additional properties", + "data": { + "foo": "foo", + "bar": 1 + }, + "valid": false + } + ] + }, { "description": "unevaluatedProperties with nested properties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -201,7 +216,6 @@ "description": "unevaluatedProperties with nested patternProperties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -238,7 +252,6 @@ "description": "unevaluatedProperties with nested additionalProperties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -271,7 +284,6 @@ "description": "unevaluatedProperties with nested unevaluatedProperties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -307,7 +319,6 @@ "description": "unevaluatedProperties with anyOf", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -376,7 +387,6 @@ "description": "unevaluatedProperties with oneOf", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -420,7 +430,6 @@ "description": "unevaluatedProperties with not", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -449,7 +458,6 @@ "description": "unevaluatedProperties with if/then/else", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "if": { "properties": { "foo": { "const": "then" } @@ -509,7 +517,6 @@ "description": "unevaluatedProperties with if/then/else, then not defined", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "if": { "properties": { "foo": { "const": "then" } @@ -563,7 +570,6 @@ "description": "unevaluatedProperties with if/then/else, else not defined", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "if": { "properties": { "foo": { "const": "then" } @@ -617,7 +623,6 @@ "description": "unevaluatedProperties with dependentSchemas", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -653,7 +658,6 @@ "description": "unevaluatedProperties with boolean schemas", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -681,7 +685,6 @@ "description": "unevaluatedProperties with $ref", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "$ref": "#/$defs/bar", "properties": { "foo": { "type": "string" } @@ -719,7 +722,6 @@ "description": "unevaluatedProperties before $ref", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "unevaluatedProperties": false, "properties": { "foo": { "type": "string" } @@ -773,7 +775,6 @@ "$comment": "unevaluatedProperties comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", "unevaluatedProperties": false, - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -862,7 +863,6 @@ "description": "nested unevaluatedProperties, outer false, inner true, properties outside", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -895,7 +895,6 @@ "description": "nested unevaluatedProperties, outer false, inner true, properties inside", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "allOf": [ { "properties": { @@ -928,7 +927,6 @@ "description": "nested unevaluatedProperties, outer true, inner false, properties outside", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { "type": "string" } }, @@ -961,7 +959,6 @@ "description": "nested unevaluatedProperties, outer true, inner false, properties inside", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "allOf": [ { "properties": { @@ -994,7 +991,6 @@ "description": "cousin unevaluatedProperties, true and false, true with properties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "allOf": [ { "properties": { @@ -1029,7 +1025,6 @@ "description": "cousin unevaluatedProperties, true and false, false with properties", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "allOf": [ { "unevaluatedProperties": true @@ -1065,10 +1060,8 @@ "comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "foo": { - "type": "object", "properties": { "bar": { "type": "string" @@ -1117,7 +1110,6 @@ "description": "in-place applicator siblings, allOf has unevaluated", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "allOf": [ { "properties": { @@ -1163,7 +1155,6 @@ "description": "in-place applicator siblings, anyOf has unevaluated", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "allOf": [ { "properties": { @@ -1209,7 +1200,6 @@ "description": "unevaluatedProperties + single cyclic ref", "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", "properties": { "x": { "$ref": "#" } },