-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtestsuite-schema.json
More file actions
124 lines (117 loc) · 3.42 KB
/
testsuite-schema.json
File metadata and controls
124 lines (117 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/planetarium/bencodex/tree/1.2/testsuite",
"title": "Bencodex test suite semantics representation",
"description": "This forms .json files in the Bencodex test suite.",
"definitions": {
"value": {
"oneOf": [
{"$ref": "#/definitions/null"},
{"$ref": "#/definitions/boolean"},
{"$ref": "#/definitions/integer"},
{"$ref": "#/definitions/binary"},
{"$ref": "#/definitions/text"},
{"$ref": "#/definitions/list"},
{"$ref": "#/definitions/dictionary"}
]
},
"null": {
"description": "Represents a Bencodex null value.",
"type": "object",
"properties": {
"type": {"const": "null"}
},
"required": ["type"]
},
"boolean": {
"description": "Represents a Bencodex boolean value.",
"type": "object",
"properties": {
"type": {"const": "boolean"},
"value": {"type": "boolean"}
},
"required": ["type", "value"]
},
"integer": {
"description": "Represents a Bencodex integer, in a decimal string.",
"type": "object",
"properties": {
"type": {"const": "integer"},
"decimal": {
"type": "string",
"pattern": "^-?[1-9][0-9]*$|^0$"
}
},
"required": ["type", "decimal"]
},
"binary": {
"description": "Represents a Bencodex byte string (i.e., binary data).",
"type": "object",
"properties": {
"type": {"const": "binary"},
"base64": {
"description": "Binary data encoded in Base64.",
"type": "string",
"pattern":
"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
}
},
"required": ["type", "base64"]
},
"text": {
"description": "Represents a Bencodex Unicode text.",
"type": "object",
"properties": {
"type": {"const": "text"},
"value": {"type": "string"}
},
"required": ["type", "value"]
},
"list": {
"description": "Represents a Bencodex list.",
"type": "object",
"properties": {
"type": {"const": "list"},
"values": {
"description":
"Values a list contains. Each value is an also Bencodex value.",
"type": "array",
"items": {"$ref": "#/definitions/value"}
}
},
"required": ["type", "values"]
},
"dictionary": {
"description": "Represents a Bencodex dictionary.",
"type": "object",
"properties": {
"type": {"const": "dictionary"},
"pairs": {
"description":
"Key-value pairs that a dictionary contains.",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"description":
"A dictionary key is a binary or a Unicode text.",
"oneOf": [
{"$ref": "#/definitions/binary"},
{"$ref": "#/definitions/text"}
]
},
"value": {
"description": "A dictionary value is an any Bencodex value.",
"$ref": "#/definitions/value"
}
},
"required": ["key", "value"]
}
}
},
"required": ["type", "pairs"]
}
},
"$ref": "#/definitions/value"
}