Skip to content

Add annotation tests from @hyperjump/json-schema #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 7, 2025
Prev Previous commit
Next Next commit
Update content tests to only apply to string instances
  • Loading branch information
jdesrosiers committed Apr 18, 2025
commit 265103e8a2dd485634aa39099286c71450dde4f1
59 changes: 55 additions & 4 deletions annotations/tests/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The content vocabulary",
"suite": [
{
"description": "`contentMediaType` is an annotation",
"description": "`contentMediaType` is an annotation for string instances",
"compatibility": "7",
"schema": {
"contentMediaType": "application/json"
Expand All @@ -18,11 +18,21 @@
"expected": ["application/json"]
}
]
},
{
"instance": 42,
"assertions": [
{
"location": "",
"keyword": "contentMediaType",
"expected": []
}
]
}
]
},
{
"description": "`contentEncoding` is an annotation",
"description": "`contentEncoding` is an annotation for string instances",
"compatibility": "7",
"schema": {
"contentEncoding": "base64"
Expand All @@ -37,11 +47,52 @@
"expected": ["base64"]
}
]
},
{
"instance": 42,
"assertions": [
{
"location": "",
"keyword": "contentEncoding",
"expected": []
}
]
}
]
},
{
"description": "`contentSchema` is an annotation for string instances",
"compatibility": "2019",
"schema": {
"$id": "https://annotations.json-schema.org/test/contentSchema-is-an-annotation",
"contentMediaType": "application/json",
"contentSchema": { "type": "number" }
},
"tests": [
{
"instance": "42",
"assertions": [
{
"location": "",
"keyword": "contentSchema",
"expected": [{ "type": "number" }]
}
]
},
{
"instance": 42,
"assertions": [
{
"location": "",
"keyword": "contentSchema",
"expected": []
}
]
}
]
},
{
"description": "`contentSchema` is an annotation",
"description": "`contentSchema` requires `contentMediaType`",
"compatibility": "2019",
"schema": {
"$id": "https://annotations.json-schema.org/test/contentSchema-is-an-annotation",
Expand All @@ -54,7 +105,7 @@
{
"location": "",
"keyword": "contentSchema",
"expected": ["https://annotations.json-schema.org/test/contentSchema-is-an-annotation#/contentSchema"]
"expected": []
}
]
}
Expand Down