From b35944d794f38e8510b9da9aceceb69054fb3475 Mon Sep 17 00:00:00 2001 From: Shawn Silverman Date: Wed, 29 Apr 2020 03:56:45 -0700 Subject: [PATCH] [244] Add a bunch of meta-schema tests This adds tests for applicator, validation, format, and content meta-schemas. --- tests/draft2019-09/meta/applicator.json | 1054 +++++++++++++++++++++++ tests/draft2019-09/meta/content.json | 136 +++ tests/draft2019-09/meta/format.json | 52 ++ tests/draft2019-09/meta/validation.json | 926 ++++++++++++++++++++ 4 files changed, 2168 insertions(+) create mode 100644 tests/draft2019-09/meta/applicator.json create mode 100644 tests/draft2019-09/meta/content.json create mode 100644 tests/draft2019-09/meta/format.json create mode 100644 tests/draft2019-09/meta/validation.json diff --git a/tests/draft2019-09/meta/applicator.json b/tests/draft2019-09/meta/applicator.json new file mode 100644 index 00000000..49bb95f3 --- /dev/null +++ b/tests/draft2019-09/meta/applicator.json @@ -0,0 +1,1054 @@ +[ + { + "description": "Meta-schema applicator tests", + "schema": { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + "tests": [ + { + "description": "Non-array allOf: number", + "data": { + "allOf": 1 + }, + "valid": false + }, + { + "description": "Non-array allOf: string", + "data": { + "allOf": "hello" + }, + "valid": false + }, + { + "description": "Non-array allOf: Boolean", + "data": { + "allOf": true + }, + "valid": false + }, + { + "description": "Non-array allOf: object", + "data": { + "allOf": {} + }, + "valid": false + }, + { + "description": "Non-array allOf: null", + "data": { + "allOf": null + }, + "valid": false + }, + { + "description": "Empty allOf", + "data": { + "allOf": [] + }, + "valid": false + }, + { + "description": "Not-a-schema allOf: string", + "data": { + "allOf": [ "integer" ] + }, + "valid": false + }, + { + "description": "Not-a-schema allOf: number", + "data": { + "allOf": [ 1 ] + }, + "valid": false + }, + { + "description": "Not-a-schema allOf: null", + "data": { + "allOf": [ null ] + }, + "valid": false + }, + { + "description": "Not-a-schema allOf: array", + "data": { + "allOf": [ [] ] + }, + "valid": false + }, + { + "description": "Valid allOf: boolean schema", + "data": { + "allOf": [ true ] + }, + "valid": true + }, + { + "description": "Valid allOf: empty schema", + "data": { + "allOf": [ {} ] + }, + "valid": true + }, + { + "description": "Valid allOf: schema", + "data": { + "allOf": [ { "type": "integer" } ] + }, + "valid": true + }, + { + "description": "Non-array anyOf: number", + "data": { + "anyOf": 1 + }, + "valid": false + }, + { + "description": "Non-array anyOf: string", + "data": { + "anyOf": "hello" + }, + "valid": false + }, + { + "description": "Non-array anyOf: Boolean", + "data": { + "anyOf": true + }, + "valid": false + }, + { + "description": "Non-array anyOf: object", + "data": { + "anyOf": {} + }, + "valid": false + }, + { + "description": "Non-array anyOf: null", + "data": { + "anyOf": null + }, + "valid": false + }, + { + "description": "Empty anyOf", + "data": { + "anyOf": [] + }, + "valid": false + }, + { + "description": "Not-a-schema anyOf: string", + "data": { + "anyOf": [ "integer" ] + }, + "valid": false + }, + { + "description": "Not-a-schema anyOf: number", + "data": { + "anyOf": [ 1 ] + }, + "valid": false + }, + { + "description": "Not-a-schema anyOf: null", + "data": { + "anyOf": [ null ] + }, + "valid": false + }, + { + "description": "Not-a-schema anyOf: array", + "data": { + "anyOf": [ [] ] + }, + "valid": false + }, + { + "description": "Valid anyOf: boolean schema", + "data": { + "anyOf": [ true ] + }, + "valid": true + }, + { + "description": "Valid anyOf: empty schema", + "data": { + "anyOf": [ {} ] + }, + "valid": true + }, + { + "description": "Valid anyOf: schema", + "data": { + "anyOf": [ { "type": "integer" } ] + }, + "valid": true + }, + { + "description": "Non-array oneOf: number", + "data": { + "oneOf": 1 + }, + "valid": false + }, + { + "description": "Non-array oneOf: string", + "data": { + "oneOf": "hello" + }, + "valid": false + }, + { + "description": "Non-array oneOf: Boolean", + "data": { + "oneOf": true + }, + "valid": false + }, + { + "description": "Non-array oneOf: object", + "data": { + "oneOf": {} + }, + "valid": false + }, + { + "description": "Non-array oneOf: null", + "data": { + "oneOf": null + }, + "valid": false + }, + { + "description": "Empty oneOf", + "data": { + "oneOf": [] + }, + "valid": false + }, + { + "description": "Not-a-schema oneOf: string", + "data": { + "oneOf": [ "integer" ] + }, + "valid": false + }, + { + "description": "Not-a-schema oneOf: number", + "data": { + "oneOf": [ 1 ] + }, + "valid": false + }, + { + "description": "Not-a-schema oneOf: null", + "data": { + "oneOf": [ null ] + }, + "valid": false + }, + { + "description": "Not-a-schema oneOf: array", + "data": { + "oneOf": [ [] ] + }, + "valid": false + }, + { + "description": "Valid oneOf: boolean schema", + "data": { + "oneOf": [ true ] + }, + "valid": true + }, + { + "description": "Valid oneOf: empty schema", + "data": { + "oneOf": [ {} ] + }, + "valid": true + }, + { + "description": "Valid oneOf: schema", + "data": { + "oneOf": [ { "type": "integer" } ] + }, + "valid": true + }, + { + "description": "Non-schema not: number", + "data": { + "not": 1 + }, + "valid": false + }, + { + "description": "Non-schema not: string", + "data": { + "not": "hello" + }, + "valid": false + }, + { + "description": "Non-schema not: array", + "data": { + "not": [] + }, + "valid": false + }, + { + "description": "Non-schema not: null", + "data": { + "not": null + }, + "valid": false + }, + { + "description": "Boolean not", + "data": { + "not": true + }, + "valid": true + }, + { + "description": "Object not", + "data": { + "not": {} + }, + "valid": true + }, + { + "description": "Non-schema additionalItems: number", + "data": { + "additionalItems": 1 + }, + "valid": false + }, + { + "description": "Non-schema additionalItems: string", + "data": { + "additionalItems": "hello" + }, + "valid": false + }, + { + "description": "Non-schema additionalItems: array", + "data": { + "additionalItems": [] + }, + "valid": false + }, + { + "description": "Non-schema additionalItems: null", + "data": { + "additionalItems": null + }, + "valid": false + }, + { + "description": "Boolean additionalItems", + "data": { + "additionalItems": true + }, + "valid": true + }, + { + "description": "Object additionalItems", + "data": { + "additionalItems": {} + }, + "valid": true + }, + { + "description": "Non-schema unevaluatedItems: number", + "data": { + "unevaluatedItems": 1 + }, + "valid": false + }, + { + "description": "Non-schema unevaluatedItems: string", + "data": { + "unevaluatedItems": "hello" + }, + "valid": false + }, + { + "description": "Non-schema unevaluatedItems: array", + "data": { + "unevaluatedItems": [] + }, + "valid": false + }, + { + "description": "Non-schema unevaluatedItems: null", + "data": { + "unevaluatedItems": null + }, + "valid": false + }, + { + "description": "Boolean unevaluatedItems", + "data": { + "unevaluatedItems": true + }, + "valid": true + }, + { + "description": "Object unevaluatedItems", + "data": { + "unevaluatedItems": {} + }, + "valid": true + }, + { + "description": "Non-schema items: number", + "data": { + "items": 1 + }, + "valid": false + }, + { + "description": "Non-schema items: string", + "data": { + "items": "hello" + }, + "valid": false + }, + { + "description": "Non-schema items: null", + "data": { + "items": null + }, + "valid": false + }, + { + "description": "Boolean items", + "data": { + "items": true + }, + "valid": true + }, + { + "description": "Object items", + "data": { + "items": {} + }, + "valid": true + }, + { + "description": "Empty array items", + "data": { + "items": [] + }, + "valid": false + }, + { + "description": "Not-a-schema array items: string", + "data": { + "allOf": [ "integer" ] + }, + "valid": false + }, + { + "description": "Valid array items: schema", + "data": { + "items": [ { "type": "integer" } ] + }, + "valid": true + }, + { + "description": "Valid array items: empty schema", + "data": { + "items": [ {} ] + }, + "valid": true + }, + { + "description": "Non-schema contains: number", + "data": { + "contains": 1 + }, + "valid": false + }, + { + "description": "Non-schema contains: string", + "data": { + "contains": "hello" + }, + "valid": false + }, + { + "description": "Non-schema contains: array", + "data": { + "contains": [] + }, + "valid": false + }, + { + "description": "Non-schema contains: null", + "data": { + "contains": null + }, + "valid": false + }, + { + "description": "Boolean contains", + "data": { + "contains": true + }, + "valid": true + }, + { + "description": "Object contains", + "data": { + "contains": {} + }, + "valid": true + }, + { + "description": "Non-schema additionalProperties: number", + "data": { + "additionalProperties": 1 + }, + "valid": false + }, + { + "description": "Non-schema additionalProperties: string", + "data": { + "additionalProperties": "hello" + }, + "valid": false + }, + { + "description": "Non-schema additionalProperties: array", + "data": { + "additionalProperties": [] + }, + "valid": false + }, + { + "description": "Non-schema additionalProperties: null", + "data": { + "additionalProperties": null + }, + "valid": false + }, + { + "description": "Boolean additionalProperties", + "data": { + "additionalProperties": true + }, + "valid": true + }, + { + "description": "Object additionalProperties", + "data": { + "additionalProperties": {} + }, + "valid": true + }, + { + "description": "Non-schema unevaluatedProperties: number", + "data": { + "unevaluatedProperties": 1 + }, + "valid": false + }, + { + "description": "Non-schema unevaluatedProperties: string", + "data": { + "unevaluatedProperties": "hello" + }, + "valid": false + }, + { + "description": "Non-schema unevaluatedProperties: array", + "data": { + "unevaluatedProperties": [] + }, + "valid": false + }, + { + "description": "Non-schema unevaluatedProperties: null", + "data": { + "unevaluatedProperties": null + }, + "valid": false + }, + { + "description": "Boolean unevaluatedProperties", + "data": { + "unevaluatedProperties": true + }, + "valid": true + }, + { + "description": "Object unevaluatedProperties", + "data": { + "unevaluatedProperties": {} + }, + "valid": true + }, + { + "description": "Non-schema propertyNames: number", + "data": { + "propertyNames": 1 + }, + "valid": false + }, + { + "description": "Non-schema propertyNames: string", + "data": { + "propertyNames": "hello" + }, + "valid": false + }, + { + "description": "Non-schema propertyNames: array", + "data": { + "propertyNames": [] + }, + "valid": false + }, + { + "description": "Non-schema propertyNames: null", + "data": { + "propertyNames": null + }, + "valid": false + }, + { + "description": "Boolean propertyNames", + "data": { + "propertyNames": true + }, + "valid": true + }, + { + "description": "Object propertyNames", + "data": { + "propertyNames": {} + }, + "valid": true + }, + { + "description": "Non-schema if: number", + "data": { + "if": 1 + }, + "valid": false + }, + { + "description": "Non-schema if: string", + "data": { + "if": "hello" + }, + "valid": false + }, + { + "description": "Non-schema if: array", + "data": { + "if": [] + }, + "valid": false + }, + { + "description": "Non-schema if: null", + "data": { + "if": null + }, + "valid": false + }, + { + "description": "Boolean if", + "data": { + "if": true + }, + "valid": true + }, + { + "description": "Object if", + "data": { + "if": {} + }, + "valid": true + }, + { + "description": "Non-schema then: number", + "data": { + "then": 1 + }, + "valid": false + }, + { + "description": "Non-schema then: string", + "data": { + "then": "hello" + }, + "valid": false + }, + { + "description": "Non-schema then: array", + "data": { + "then": [] + }, + "valid": false + }, + { + "description": "Non-schema then: null", + "data": { + "then": null + }, + "valid": false + }, + { + "description": "Boolean then", + "data": { + "then": true + }, + "valid": true + }, + { + "description": "Object then", + "data": { + "then": {} + }, + "valid": true + }, + { + "description": "Non-schema else: number", + "data": { + "else": 1 + }, + "valid": false + }, + { + "description": "Non-schema else: string", + "data": { + "else": "hello" + }, + "valid": false + }, + { + "description": "Non-schema else: array", + "data": { + "else": [] + }, + "valid": false + }, + { + "description": "Non-schema else: null", + "data": { + "else": null + }, + "valid": false + }, + { + "description": "Boolean else", + "data": { + "else": true + }, + "valid": true + }, + { + "description": "Object else", + "data": { + "else": {} + }, + "valid": true + }, + { + "description": "Non-object properties: string", + "data": { + "properties": "hello" + }, + "valid": false + }, + { + "description": "Non-object properties: Boolean", + "data": { + "properties": true + }, + "valid": false + }, + { + "description": "Non-object properties: null", + "data": { + "properties": null + }, + "valid": false + }, + { + "description": "Non-object properties: number", + "data": { + "properties": 1 + }, + "valid": false + }, + { + "description": "Non-object properties: array", + "data": { + "properties": [] + }, + "valid": false + }, + { + "description": "Non-schema property in properties: string", + "data": { + "properties": { + "hello": "there" + } + }, + "valid": false + }, + { + "description": "Non-schema property in properties: null", + "data": { + "properties": { + "hello": null + } + }, + "valid": false + }, + { + "description": "Non-schema property in properties: number", + "data": { + "properties": { + "hello": 1 + } + }, + "valid": false + }, + { + "description": "Non-schema property in properties: array", + "data": { + "properties": { + "hello": [] + } + }, + "valid": false + }, + { + "description": "Boolean property in properties", + "data": { + "properties": { + "hello": true + } + }, + "valid": true + }, + { + "description": "Object property in properties", + "data": { + "properties": { + "hello": {} + } + }, + "valid": true + }, + { + "description": "Empty properties", + "data": { + "properties": {} + }, + "valid": true + }, + { + "description": "Non-object patternProperties: string", + "data": { + "patternProperties": "hello" + }, + "valid": false + }, + { + "description": "Non-object patternProperties: Boolean", + "data": { + "patternProperties": true + }, + "valid": false + }, + { + "description": "Non-object patternProperties: null", + "data": { + "patternProperties": null + }, + "valid": false + }, + { + "description": "Non-object patternProperties: number", + "data": { + "patternProperties": 1 + }, + "valid": false + }, + { + "description": "Non-object patternProperties: array", + "data": { + "patternProperties": [] + }, + "valid": false + }, + { + "description": "Non-schema property in patternProperties: string", + "data": { + "patternProperties": { + "hello": "there" + } + }, + "valid": false + }, + { + "description": "Non-schema property in patternProperties: null", + "data": { + "patternProperties": { + "hello": null + } + }, + "valid": false + }, + { + "description": "Non-schema property in patternProperties: number", + "data": { + "patternProperties": { + "hello": 1 + } + }, + "valid": false + }, + { + "description": "Non-schema property in patternProperties: array", + "data": { + "patternProperties": { + "hello": [] + } + }, + "valid": false + }, + { + "description": "Boolean property in patternProperties", + "data": { + "patternProperties": { + "hello": true + } + }, + "valid": true + }, + { + "description": "Object property in patternProperties", + "data": { + "patternProperties": { + "hello": {} + } + }, + "valid": true + }, + { + "description": "Empty patternProperties", + "data": { + "patternProperties": {} + }, + "valid": true + }, + { + "description": "Non-object dependentSchemas: string", + "data": { + "dependentSchemas": "hello" + }, + "valid": false + }, + { + "description": "Non-object dependentSchemas: Boolean", + "data": { + "dependentSchemas": true + }, + "valid": false + }, + { + "description": "Non-object dependentSchemas: null", + "data": { + "dependentSchemas": null + }, + "valid": false + }, + { + "description": "Non-object dependentSchemas: number", + "data": { + "dependentSchemas": 1 + }, + "valid": false + }, + { + "description": "Non-object dependentSchemas: array", + "data": { + "dependentSchemas": [] + }, + "valid": false + }, + { + "description": "Non-schema property in dependentSchemas: string", + "data": { + "dependentSchemas": { + "hello": "there" + } + }, + "valid": false + }, + { + "description": "Non-schema property in dependentSchemas: null", + "data": { + "dependentSchemas": { + "hello": null + } + }, + "valid": false + }, + { + "description": "Non-schema property in dependentSchemas: number", + "data": { + "dependentSchemas": { + "hello": 1 + } + }, + "valid": false + }, + { + "description": "Non-schema property in dependentSchemas: array", + "data": { + "dependentSchemas": { + "hello": [] + } + }, + "valid": false + }, + { + "description": "Boolean property in dependentSchemas", + "data": { + "dependentSchemas": { + "hello": true + } + }, + "valid": true + }, + { + "description": "Object property in dependentSchemas", + "data": { + "dependentSchemas": { + "hello": {} + } + }, + "valid": true + }, + { + "description": "Empty dependentSchemas", + "data": { + "dependentSchemas": {} + }, + "valid": true + } + ] + } +] diff --git a/tests/draft2019-09/meta/content.json b/tests/draft2019-09/meta/content.json new file mode 100644 index 00000000..2d69acf3 --- /dev/null +++ b/tests/draft2019-09/meta/content.json @@ -0,0 +1,136 @@ +[ + { + "description": "Meta-schema applicator tests", + "schema": { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + "tests": [ + { + "description": "Non-string contentMediaType: number", + "data": { + "contentMediaType": 1 + }, + "valid": false + }, + { + "description": "Non-string contentMediaType: Boolean", + "data": { + "contentMediaType": true + }, + "valid": false + }, + { + "description": "Non-string contentMediaType: null", + "data": { + "contentMediaType": null + }, + "valid": false + }, + { + "description": "Non-string contentMediaType: array", + "data": { + "contentMediaType": [] + }, + "valid": false + }, + { + "description": "Non-string contentMediaType: object", + "data": { + "contentMediaType": {} + }, + "valid": false + }, + { + "description": "Valid contentMediaType", + "data": { + "contentMediaType": "text/plain" + }, + "valid": true + }, + { + "description": "Non-string contentEncoding: number", + "data": { + "contentEncoding": 1 + }, + "valid": false + }, + { + "description": "Non-string contentEncoding: Boolean", + "data": { + "contentEncoding": true + }, + "valid": false + }, + { + "description": "Non-string contentEncoding: null", + "data": { + "contentEncoding": null + }, + "valid": false + }, + { + "description": "Non-string contentEncoding: array", + "data": { + "contentEncoding": [] + }, + "valid": false + }, + { + "description": "Non-string contentEncoding: object", + "data": { + "contentEncoding": {} + }, + "valid": false + }, + { + "description": "Valid contentEncoding", + "data": { + "contentEncoding": "base64" + }, + "valid": true + }, + { + "description": "Non-schema contentSchema: number", + "data": { + "contentSchema": 1 + }, + "valid": false + }, + { + "description": "Non-schema contentSchema: string", + "data": { + "contentSchema": "hello" + }, + "valid": false + }, + { + "description": "Non-schema contentSchema: array", + "data": { + "contentSchema": [] + }, + "valid": false + }, + { + "description": "Non-schema contentSchema: null", + "data": { + "contentSchema": null + }, + "valid": false + }, + { + "description": "Boolean contentSchema", + "data": { + "contentSchema": true + }, + "valid": true + }, + { + "description": "Object contentSchema", + "data": { + "contentSchema": {} + }, + "valid": true + } + ] + } +] diff --git a/tests/draft2019-09/meta/format.json b/tests/draft2019-09/meta/format.json new file mode 100644 index 00000000..a989dca0 --- /dev/null +++ b/tests/draft2019-09/meta/format.json @@ -0,0 +1,52 @@ +[ + { + "description": "Meta-schema applicator tests", + "schema": { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + "tests": [ + { + "description": "Non-string format: number", + "data": { + "format": 1 + }, + "valid": false + }, + { + "description": "Non-string format: Boolean", + "data": { + "format": true + }, + "valid": false + }, + { + "description": "Non-string format: null", + "data": { + "format": null + }, + "valid": false + }, + { + "description": "Non-string format: array", + "data": { + "format": [] + }, + "valid": false + }, + { + "description": "Non-string format: object", + "data": { + "format": {} + }, + "valid": false + }, + { + "description": "Valid format", + "data": { + "format": "uri-reference" + }, + "valid": true + } + ] + } +] diff --git a/tests/draft2019-09/meta/validation.json b/tests/draft2019-09/meta/validation.json new file mode 100644 index 00000000..79ba2896 --- /dev/null +++ b/tests/draft2019-09/meta/validation.json @@ -0,0 +1,926 @@ +[ + { + "description": "Meta-schema validation tests", + "schema": { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + "tests": [ + { + "description": "Unknown type", + "data": { + "type": "float" + }, + "valid": false + }, + { + "description": "Duplicate types", + "data": { + "type": [ "null", "null" ] + }, + "valid": false + }, + { + "description": "Empty types", + "data": { + "type": [] + }, + "valid": false + }, + { + "description": "Anything goes for const", + "data": { + "const": 1 + }, + "valid": true + }, + { + "description": "Non-array enum: number", + "data": { + "enum": 1 + }, + "valid": false + }, + { + "description": "Non-array enum: string", + "data": { + "enum": "hello" + }, + "valid": false + }, + { + "description": "Non-array enum: Boolean", + "data": { + "enum": true + }, + "valid": false + }, + { + "description": "Non-array enum: object", + "data": { + "enum": {} + }, + "valid": false + }, + { + "description": "Non-array enum: null", + "data": { + "enum": null + }, + "valid": false + }, + { + "description": "Empty enum is valid", + "data": { + "enum": [] + }, + "valid": true + }, + { + "description": "Non-unique enums are valid", + "data": { + "enum": [ "hello", "hello" ] + }, + "valid": true + }, + { + "description": "Non-unique enums are valid", + "data": { + "enum": [ "hello", "hello" ] + }, + "valid": true + }, + { + "description": "Non-number multipleOf: string", + "data": { + "multipleOf": "hello" + }, + "valid": false + }, + { + "description": "Non-number multipleOf: Boolean", + "data": { + "multipleOf": true + }, + "valid": false + }, + { + "description": "Non-number multipleOf: array", + "data": { + "multipleOf": [] + }, + "valid": false + }, + { + "description": "Non-number multipleOf: object", + "data": { + "multipleOf": {} + }, + "valid": false + }, + { + "description": "Non-number multipleOf: null", + "data": { + "multipleOf": null + }, + "valid": false + }, + { + "description": "multipleOf is zero", + "data": { + "multipleOf": 0 + }, + "valid": false + }, + { + "description": "Number multipleOf", + "data": { + "multipleOf": 1.1 + }, + "valid": true + }, + { + "description": "Non-number maximum: string", + "data": { + "maximum": "hello" + }, + "valid": false + }, + { + "description": "Non-number maximum: Boolean", + "data": { + "maximum": true + }, + "valid": false + }, + { + "description": "Non-number maximum: array", + "data": { + "maximum": [] + }, + "valid": false + }, + { + "description": "Non-number maximum: object", + "data": { + "maximum": {} + }, + "valid": false + }, + { + "description": "Non-number maximum: null", + "data": { + "maximum": null + }, + "valid": false + }, + { + "description": "Number maximum", + "data": { + "maximum": 1.1 + }, + "valid": true + }, + { + "description": "Non-number minimum: string", + "data": { + "minimum": "hello" + }, + "valid": false + }, + { + "description": "Non-number minimum: Boolean", + "data": { + "minimum": true + }, + "valid": false + }, + { + "description": "Non-number minimum: array", + "data": { + "minimum": [] + }, + "valid": false + }, + { + "description": "Non-number minimum: object", + "data": { + "minimum": {} + }, + "valid": false + }, + { + "description": "Non-number minimum: null", + "data": { + "minimum": null + }, + "valid": false + }, + { + "description": "Number minimum", + "data": { + "minimum": 1.1 + }, + "valid": true + }, + { + "description": "Non-number exclusiveMaximum: string", + "data": { + "exclusiveMaximum": "hello" + }, + "valid": false + }, + { + "description": "Non-number exclusiveMaximum: Boolean", + "data": { + "exclusiveMaximum": true + }, + "valid": false + }, + { + "description": "Non-number exclusiveMaximum: array", + "data": { + "exclusiveMaximum": [] + }, + "valid": false + }, + { + "description": "Non-number exclusiveMaximum: object", + "data": { + "exclusiveMaximum": {} + }, + "valid": false + }, + { + "description": "Non-number exclusiveMaximum: null", + "data": { + "exclusiveMaximum": null + }, + "valid": false + }, + { + "description": "Number exclusiveMaximum", + "data": { + "exclusiveMaximum": 1.1 + }, + "valid": true + }, + { + "description": "Non-number exclusiveMinimum: string", + "data": { + "exclusiveMinimum": "hello" + }, + "valid": false + }, + { + "description": "Non-number exclusiveMinimum: Boolean", + "data": { + "exclusiveMinimum": true + }, + "valid": false + }, + { + "description": "Non-number exclusiveMinimum: array", + "data": { + "exclusiveMinimum": [] + }, + "valid": false + }, + { + "description": "Non-number exclusiveMinimum: object", + "data": { + "exclusiveMinimum": {} + }, + "valid": false + }, + { + "description": "Non-number exclusiveMinimum: null", + "data": { + "exclusiveMinimum": null + }, + "valid": false + }, + { + "description": "Number exclusiveMinimum", + "data": { + "exclusiveMinimum": 1.1 + }, + "valid": true + }, + { + "description": "Non-number maxLength: string", + "data": { + "maxLength": "hello" + }, + "valid": false + }, + { + "description": "Non-number maxLength: Boolean", + "data": { + "maxLength": true + }, + "valid": false + }, + { + "description": "Non-number maxLength: array", + "data": { + "maxLength": [] + }, + "valid": false + }, + { + "description": "Non-number maxLength: object", + "data": { + "maxLength": {} + }, + "valid": false + }, + { + "description": "Non-number maxLength: null", + "data": { + "maxLength": null + }, + "valid": false + }, + { + "description": "maxLength is negative", + "data": { + "maxLength": -1 + }, + "valid": false + }, + { + "description": "maxLength is floating-point", + "data": { + "maxLength": 1.5 + }, + "valid": false + }, + { + "description": "Integer maxLength", + "data": { + "maxLength": 0 + }, + "valid": true + }, + { + "description": "Non-number minLength: string", + "data": { + "minLength": "hello" + }, + "valid": false + }, + { + "description": "Non-number minLength: Boolean", + "data": { + "minLength": true + }, + "valid": false + }, + { + "description": "Non-number minLength: array", + "data": { + "minLength": [] + }, + "valid": false + }, + { + "description": "Non-number minLength: object", + "data": { + "minLength": {} + }, + "valid": false + }, + { + "description": "Non-number minLength: null", + "data": { + "minLength": null + }, + "valid": false + }, + { + "description": "minLength is negative", + "data": { + "minLength": -1 + }, + "valid": false + }, + { + "description": "minLength is floating-point", + "data": { + "minLength": 1.5 + }, + "valid": false + }, + { + "description": "Integer minLength", + "data": { + "minLength": 0 + }, + "valid": true + }, + { + "description": "Non-number maxItems: string", + "data": { + "maxItems": "hello" + }, + "valid": false + }, + { + "description": "Non-number maxItems: Boolean", + "data": { + "maxItems": true + }, + "valid": false + }, + { + "description": "Non-number maxItems: array", + "data": { + "maxItems": [] + }, + "valid": false + }, + { + "description": "Non-number maxItems: object", + "data": { + "maxItems": {} + }, + "valid": false + }, + { + "description": "Non-number maxItems: null", + "data": { + "maxItems": null + }, + "valid": false + }, + { + "description": "maxItems is negative", + "data": { + "maxItems": -1 + }, + "valid": false + }, + { + "description": "maxItems is floating-point", + "data": { + "maxItems": 1.5 + }, + "valid": false + }, + { + "description": "Integer maxItems", + "data": { + "maxItems": 0 + }, + "valid": true + }, + { + "description": "Non-number minItems: string", + "data": { + "minItems": "hello" + }, + "valid": false + }, + { + "description": "Non-number minItems: Boolean", + "data": { + "minItems": true + }, + "valid": false + }, + { + "description": "Non-number minItems: array", + "data": { + "minItems": [] + }, + "valid": false + }, + { + "description": "Non-number minItems: object", + "data": { + "minItems": {} + }, + "valid": false + }, + { + "description": "Non-number minItems: null", + "data": { + "minItems": null + }, + "valid": false + }, + { + "description": "minItems is negative", + "data": { + "minItems": -1 + }, + "valid": false + }, + { + "description": "minItems is floating-point", + "data": { + "minItems": 1.5 + }, + "valid": false + }, + { + "description": "Integer minItems", + "data": { + "minItems": 0 + }, + "valid": true + }, + { + "description": "Non-number maxContains: string", + "data": { + "maxContains": "hello" + }, + "valid": false + }, + { + "description": "Non-number maxContains: Boolean", + "data": { + "maxContains": true + }, + "valid": false + }, + { + "description": "Non-number maxContains: array", + "data": { + "maxContains": [] + }, + "valid": false + }, + { + "description": "Non-number maxContains: object", + "data": { + "maxContains": {} + }, + "valid": false + }, + { + "description": "Non-number maxContains: null", + "data": { + "maxContains": null + }, + "valid": false + }, + { + "description": "maxContains is negative", + "data": { + "maxContains": -1 + }, + "valid": false + }, + { + "description": "maxContains is floating-point", + "data": { + "maxContains": 1.5 + }, + "valid": false + }, + { + "description": "Integer maxContains", + "data": { + "maxContains": 0 + }, + "valid": true + }, + { + "description": "Non-number minContains: string", + "data": { + "minContains": "hello" + }, + "valid": false + }, + { + "description": "Non-number minContains: Boolean", + "data": { + "minContains": true + }, + "valid": false + }, + { + "description": "Non-number minContains: array", + "data": { + "minContains": [] + }, + "valid": false + }, + { + "description": "Non-number minContains: object", + "data": { + "minContains": {} + }, + "valid": false + }, + { + "description": "Non-number minContains: null", + "data": { + "minContains": null + }, + "valid": false + }, + { + "description": "minContains is negative", + "data": { + "minContains": -1 + }, + "valid": false + }, + { + "description": "minContains is floating-point", + "data": { + "minContains": 1.5 + }, + "valid": false + }, + { + "description": "Integer minContains", + "data": { + "minContains": 0 + }, + "valid": true + }, + { + "description": "Non-number maxProperties: string", + "data": { + "maxProperties": "hello" + }, + "valid": false + }, + { + "description": "Non-number maxProperties: Boolean", + "data": { + "maxProperties": true + }, + "valid": false + }, + { + "description": "Non-number maxProperties: array", + "data": { + "maxProperties": [] + }, + "valid": false + }, + { + "description": "Non-number maxProperties: object", + "data": { + "maxProperties": {} + }, + "valid": false + }, + { + "description": "Non-number maxProperties: null", + "data": { + "maxProperties": null + }, + "valid": false + }, + { + "description": "maxProperties is negative", + "data": { + "maxProperties": -1 + }, + "valid": false + }, + { + "description": "maxProperties is floating-point", + "data": { + "maxProperties": 1.5 + }, + "valid": false + }, + { + "description": "Integer maxProperties", + "data": { + "maxProperties": 0 + }, + "valid": true + }, + { + "description": "Non-number minProperties: string", + "data": { + "minProperties": "hello" + }, + "valid": false + }, + { + "description": "Non-number minProperties: Boolean", + "data": { + "minProperties": true + }, + "valid": false + }, + { + "description": "Non-number minProperties: array", + "data": { + "minProperties": [] + }, + "valid": false + }, + { + "description": "Non-number minProperties: object", + "data": { + "minProperties": {} + }, + "valid": false + }, + { + "description": "Non-number minProperties: null", + "data": { + "minProperties": null + }, + "valid": false + }, + { + "description": "minProperties is negative", + "data": { + "minProperties": -1 + }, + "valid": false + }, + { + "description": "minProperties is floating-point", + "data": { + "minProperties": 1.5 + }, + "valid": false + }, + { + "description": "Integer minProperties", + "data": { + "minProperties": 0 + }, + "valid": true + }, + { + "description": "Non-Boolean uniqueItems: string", + "data": { + "uniqueItems": "hello" + }, + "valid": false + }, + { + "description": "Non-Boolean uniqueItems: number", + "data": { + "uniqueItems": 1 + }, + "valid": false + }, + { + "description": "Non-Boolean uniqueItems: array", + "data": { + "uniqueItems": [] + }, + "valid": false + }, + { + "description": "Non-Boolean uniqueItems: object", + "data": { + "uniqueItems": {} + }, + "valid": false + }, + { + "description": "Non-Boolean uniqueItems: null", + "data": { + "uniqueItems": null + }, + "valid": false + }, + { + "description": "Boolean uniqueItems", + "data": { + "uniqueItems": true + }, + "valid": true + }, + { + "description": "Non-array required: string", + "data": { + "required": "hello" + }, + "valid": false + }, + { + "description": "Non-array required: Boolean", + "data": { + "required": true + }, + "valid": false + }, + { + "description": "Non-array required: null", + "data": { + "required": null + }, + "valid": false + }, + { + "description": "Non-array required: object", + "data": { + "required": {} + }, + "valid": false + }, + { + "description": "Non-array required: number", + "data": { + "required": 1 + }, + "valid": false + }, + { + "description": "required with duplicates", + "data": { + "required": [ "hello", "hello" ] + }, + "valid": false + }, + { + "description": "Non-string array required", + "data": { + "required": [ "hello", 1 ] + }, + "valid": false + }, + { + "description": "Empty array required", + "data": { + "required": [] + }, + "valid": true + }, + { + "description": "One-element array required", + "data": { + "required": [ "hello" ] + }, + "valid": true + }, + { + "description": "Non-object dependentRequired: string", + "data": { + "dependentRequired": "hello" + }, + "valid": false + }, + { + "description": "Non-object dependentRequired: Boolean", + "data": { + "dependentRequired": true + }, + "valid": false + }, + { + "description": "Non-object dependentRequired: null", + "data": { + "dependentRequired": null + }, + "valid": false + }, + { + "description": "Non-object dependentRequired: number", + "data": { + "dependentRequired": 1 + }, + "valid": false + }, + { + "description": "Non-object dependentRequired: array", + "data": { + "dependentRequired": [] + }, + "valid": false + }, + { + "description": "Non-string array dependentRequired", + "data": { + "dependentRequired": { + "hello": [ 1, "there" ] + } + }, + "valid": false + }, + { + "description": "Non-unique string array dependentRequired", + "data": { + "dependentRequired": { + "hello": [ "there", "there" ] + } + }, + "valid": true + }, + { + "description": "String array dependentRequired", + "data": { + "dependentRequired": { + "hello": [ "there" ] + } + }, + "valid": true + } + ] + } +]