Skip to content

Commit 74e91ee

Browse files
committed
Squashed 'json/' changes from 597b1fb0d..b3c8672a3
b3c8672a3 Merge pull request #587 from json-schema-org/cross-draft-tests e2a681ac6 $comment -> comment 52eb27902 add draft 2020-12 -> draft 2019-09 test c4ed16dfe add draft 2019-09 -> draft 7 test 3df4712a9 add draft 2019-09 -> draft 2020-12 test dab94face add draft 7 -> draft 2019-09 test dfcea626f Merge pull request #584 from json-schema-org/doi e4a59d962 Add a badge for a Zenodo DOI. git-subtree-dir: json git-subtree-split: b3c8672a3fa0a0691124e455680b34d5512cae94
1 parent 297cb8c commit 74e91ee

File tree

8 files changed

+113
-0
lines changed

8 files changed

+113
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
55
[![Financial Contributors on Open Collective](https://opencollective.com/json-schema/all/badge.svg?label=financial+contributors)](https://opencollective.com/json-schema)
66

7+
[![DOI](https://zenodo.org/badge/5952934.svg)](https://zenodo.org/badge/latestdoi/5952934)
78
[![Build Status](https://github.com/json-schema-org/JSON-Schema-Test-Suite/workflows/Test%20Suite%20Sanity%20Checking/badge.svg)](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
89

910
This repository contains a set of JSON objects that implementers of JSON Schema validation libraries can use to test their validators.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$id": "http://localhost:1234/draft2019-09/dependentRequired.json",
3+
"$schema": "https://json-schema.org/draft/2019-09/schema",
4+
"dependentRequired": {
5+
"foo": ["bar"]
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$id": "http://localhost:1234/draft2019-09/ignore-prefixItems.json",
3+
"$schema": "https://json-schema.org/draft/2019-09/schema",
4+
"prefixItems": [
5+
{"type": "string"}
6+
]
7+
}

remotes/draft2020-12/prefixItems.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$id": "http://localhost:1234/draft2020-12/prefixItems.json",
3+
"$schema": "https://json-schema.org/draft/2020-12/schema",
4+
"prefixItems": [
5+
{"type": "string"}
6+
]
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$id": "http://localhost:1234/draft7/integer.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"dependentRequired": {
5+
"foo": ["bar"]
6+
}
7+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[
2+
{
3+
"description": "refs to future drafts are processed as future drafts",
4+
"schema": {
5+
"$schema": "https://json-schema.org/draft/2019-09/schema",
6+
"type": "array",
7+
"$ref": "http://localhost:1234/draft2020-12/prefixItems.json"
8+
},
9+
"tests": [
10+
{
11+
"description": "first item not a string is invalid",
12+
"comment": "if the implementation is not processing the $ref as a 2020-12 schema, this test will fail",
13+
"data": [1, 2, 3],
14+
"valid": false
15+
},
16+
{
17+
"description": "first item is a string is valid",
18+
"data": ["a string", 1, 2, 3],
19+
"valid": true
20+
}
21+
]
22+
},
23+
{
24+
"description": "refs to historic drafts are processed as historic drafts",
25+
"schema": {
26+
"type": "object",
27+
"allOf": [
28+
{ "properties": { "foo": true } },
29+
{ "$ref": "http://localhost:1234/draft7/ignore-dependentRequired.json" }
30+
]
31+
},
32+
"tests": [
33+
{
34+
"description": "missing bar is valid",
35+
"comment": "if the implementation is not processing the $ref as a draft 7 schema, this test will fail",
36+
"data": {"foo": "any value"},
37+
"valid": true
38+
}
39+
]
40+
}
41+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"description": "refs to historic drafts are processed as historic drafts",
4+
"schema": {
5+
"$schema": "https://json-schema.org/draft/2020-12/schema",
6+
"type": "array",
7+
"$ref": "http://localhost:1234/draft2019-09/ignore-prefixItems.json"
8+
},
9+
"tests": [
10+
{
11+
"description": "first item not a string is valid",
12+
"comment": "if the implementation is not processing the $ref as a 2019-09 schema, this test will fail",
13+
"data": [1, 2, 3],
14+
"valid": true
15+
}
16+
]
17+
}
18+
]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"description": "refs to future drafts are processed as future drafts",
4+
"schema": {
5+
"type": "object",
6+
"allOf": [
7+
{ "properties": { "foo": true } },
8+
{ "$ref": "http://localhost:1234/draft2019-09/dependentRequired.json" }
9+
]
10+
},
11+
"tests": [
12+
{
13+
"description": "missing bar is invalid",
14+
"comment": "if the implementation is not processing the $ref as a 2019-09 schema, this test will fail",
15+
"data": {"foo": "any value"},
16+
"valid": false
17+
},
18+
{
19+
"description": "present bar is valid",
20+
"data": {"foo": "any value", "bar": "also any value"},
21+
"valid": true
22+
}
23+
]
24+
}
25+
]

0 commit comments

Comments
 (0)