xref: /aosp_15_r20/external/json-schema-validator/src/test/suite/test-schema.json (revision 78c4dd6aa35290980cdcd1623a7e337e8d021c7c)
1{
2    "$schema": "https://json-schema.org/draft/2020-12/schema",
3    "$id": "https://json-schema.org/tests/test-schema",
4    "description": "A schema for files contained within this suite",
5
6    "type": "array",
7    "minItems": 1,
8    "items": {
9        "description": "An individual test case, containing multiple tests of a single schema's behavior",
10
11        "type": "object",
12        "required": [ "description", "schema", "tests" ],
13        "properties": {
14            "description": {
15                "description": "The test case description",
16                "type": "string"
17            },
18            "comment": {
19                "description": "Any additional comments about the test case",
20                "type": "string"
21            },
22            "schema": {
23                "description": "A valid JSON Schema (one written for the corresponding version directory that the file sits within)."
24            },
25            "tests": {
26                "description": "A set of related tests all using the same schema",
27                "type": "array",
28                "items": { "$ref": "#/$defs/test" },
29                "minItems": 1
30            }
31        },
32        "additionalProperties": false
33    },
34
35    "$defs": {
36        "test": {
37            "description": "A single test",
38
39            "type": "object",
40            "required": [ "description", "data", "valid" ],
41            "properties": {
42                "description": {
43                    "description": "The test description, briefly explaining which behavior it exercises",
44                    "type": "string"
45                },
46                "comment": {
47                    "description": "Any additional comments about the test",
48                    "type": "string"
49                },
50                "data": {
51                    "description": "The instance which should be validated against the schema in \"schema\"."
52                },
53                "valid": {
54                    "description": "Whether the validation process of this instance should consider the instance valid or not",
55                    "type": "boolean"
56                }
57            },
58            "additionalProperties": false
59        }
60    }
61}
62