-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path$data.json
More file actions
81 lines (81 loc) · 2.3 KB
/
$data.json
File metadata and controls
81 lines (81 loc) · 2.3 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
[
{
"description": "$data - reference to the data object",
"schemas": [
{ "$ref": "http://www.jsonscript.org/schema/schema.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema.json#$data" },
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#$data" }
],
"tests": [
{
"description": "value should be a valid JSON-pointer",
"data": { "$data": "/foo/bar" },
"valid": true
},
{
"description": "value can be any valid script",
"data": { "$data": { "$exec": "func" } },
"valid": true
},
{
"description": "value can be another $data instruction",
"data": { "$data": { "$data": "/foo/bar" } },
"valid": true
},
{
"description": "if value is invalid script then invalid",
"data": { "$data": { "$exec": "func", "extra": {} } },
"valid": false
}
]
},
{
"description": "$data syntax errors",
"schemas": [
{ "$ref": "http://www.jsonscript.org/schema/schema.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema.json#$data" }
],
"tests": [
{
"description": "relative JSON-pointer is invalid",
"data": { "$data": "1/foo/bar" },
"valid": true
},
{
"description": "invalid JSON-pointer is invalid",
"data": { "$data": "foo" },
"valid": true
},
{
"description": "$data is scalar but not a string is invalid",
"data": { "$data": 1 },
"valid": true
}
]
},
{
"description": "$data syntax errors with strict schema",
"schemas": [
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#" },
{ "$ref": "http://www.jsonscript.org/schema/schema_strict.json#$data" }
],
"tests": [
{
"description": "relative JSON-pointer is invalid",
"data": { "$data": "1/foo/bar" },
"valid": false
},
{
"description": "invalid JSON-pointer is invalid",
"data": { "$data": "foo" },
"valid": false
},
{
"description": "$data is scalar but not a string is invalid",
"data": { "$data": 1 },
"valid": false
}
]
}
]