diff --git a/test-schema.json b/test-schema.json index 670d2804..8393720d 100644 --- a/test-schema.json +++ b/test-schema.json @@ -1,59 +1,73 @@ { "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Schema for tests", + "type": "array", + "items": { + "type": "object", + "required": [ "description", "schema", "tests" ], + "properties": { + "id": { + "description": "Uniquely identifies a set of tests", + "type": "string", + "format": "uri" + }, + "description": { "type": "string" }, + "schema": {}, + "tests": { + "description": "A set of related tests all using the same schema", + "type": "array", + "items": { "$ref": "#/definitions/test" }, + "minItems": 1 + } + }, + "additionalProperties": false, + "minItems": 1 + }, "definitions": { "outputItem": { "type": "object", "properties": { - "valid": {"type": "boolean"}, - "keywordLocation": {"type": "string"}, + "valid": { "type": "boolean" }, + "keywordLocation": { "type": "string" }, "absoluteKeywordLocation": { "type": "string", "format": "uri" }, - "instanceLocation": {"type": "string"}, + "instanceLocation": { "type": "string" }, "annotations": { "type": "array", - "items": {"$ref": "#/definitions/outputItem"} + "items": { "$ref": "#/definitions/outputItem" } }, "errors": { "type": "array", - "items": {"$ref": "#/definitions/outputItem"} + "items": { "$ref": "#/definitions/outputItem" } } } - } - }, - "type": "array", - "items": { - "type": "object", - "required": ["description", "schema", "tests"], - "properties": { - "description": {"type": "string"}, - "schema": {}, - "tests": { - "type": "array", - "items": { + }, + "test": { + "description": "A single test", + "type": "object", + "required": [ "description", "data", "valid" ], + "properties": { + "id": { + "description": "Uniquely identifies a single test", + "type": "string", + "format": "uri" + }, + "description": { "type": "string" }, + "data": {}, + "valid": { "type": "boolean" }, + "output": { "type": "object", - "required": ["description", "data", "valid"], + "required": [ "basic", "detailed", "verbose" ], "properties": { - "description": {"type": "string"}, - "data": {}, - "valid": {"type": "boolean"}, - "output": { - "type": "object", - "properties": { - "basic": {"$ref": "#/definitions/outputItem"}, - "detailed": {"$ref": "#/definitions/outputItem"}, - "verbose": {"$ref": "#/definitions/outputItem"} - }, - "required": ["basic", "detailed", "verbose"] - } - }, - "additionalProperties": false - }, - "minItems": 1 - } - }, - "additionalProperties": false, - "minItems": 1 + "basic": { "$ref": "#/definitions/outputItem" }, + "detailed": { "$ref": "#/definitions/outputItem" }, + "verbose": { "$ref": "#/definitions/outputItem" } + } + } + }, + "additionalProperties": false + } } }