Skip to content

Commit 265103e

Browse files
committed
Update content tests to only apply to string instances
1 parent 35ccff6 commit 265103e

File tree

1 file changed

+55
-4
lines changed

1 file changed

+55
-4
lines changed

annotations/tests/content.json

+55-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "The content vocabulary",
44
"suite": [
55
{
6-
"description": "`contentMediaType` is an annotation",
6+
"description": "`contentMediaType` is an annotation for string instances",
77
"compatibility": "7",
88
"schema": {
99
"contentMediaType": "application/json"
@@ -18,11 +18,21 @@
1818
"expected": ["application/json"]
1919
}
2020
]
21+
},
22+
{
23+
"instance": 42,
24+
"assertions": [
25+
{
26+
"location": "",
27+
"keyword": "contentMediaType",
28+
"expected": []
29+
}
30+
]
2131
}
2232
]
2333
},
2434
{
25-
"description": "`contentEncoding` is an annotation",
35+
"description": "`contentEncoding` is an annotation for string instances",
2636
"compatibility": "7",
2737
"schema": {
2838
"contentEncoding": "base64"
@@ -37,11 +47,52 @@
3747
"expected": ["base64"]
3848
}
3949
]
50+
},
51+
{
52+
"instance": 42,
53+
"assertions": [
54+
{
55+
"location": "",
56+
"keyword": "contentEncoding",
57+
"expected": []
58+
}
59+
]
60+
}
61+
]
62+
},
63+
{
64+
"description": "`contentSchema` is an annotation for string instances",
65+
"compatibility": "2019",
66+
"schema": {
67+
"$id": "https://annotations.json-schema.org/test/contentSchema-is-an-annotation",
68+
"contentMediaType": "application/json",
69+
"contentSchema": { "type": "number" }
70+
},
71+
"tests": [
72+
{
73+
"instance": "42",
74+
"assertions": [
75+
{
76+
"location": "",
77+
"keyword": "contentSchema",
78+
"expected": [{ "type": "number" }]
79+
}
80+
]
81+
},
82+
{
83+
"instance": 42,
84+
"assertions": [
85+
{
86+
"location": "",
87+
"keyword": "contentSchema",
88+
"expected": []
89+
}
90+
]
4091
}
4192
]
4293
},
4394
{
44-
"description": "`contentSchema` is an annotation",
95+
"description": "`contentSchema` requires `contentMediaType`",
4596
"compatibility": "2019",
4697
"schema": {
4798
"$id": "https://annotations.json-schema.org/test/contentSchema-is-an-annotation",
@@ -54,7 +105,7 @@
54105
{
55106
"location": "",
56107
"keyword": "contentSchema",
57-
"expected": ["https://annotations.json-schema.org/test/contentSchema-is-an-annotation#/contentSchema"]
108+
"expected": []
58109
}
59110
]
60111
}

0 commit comments

Comments
 (0)