You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
817b724 add perl implementation and test suite to the user list
ca14e01 Merge branch 'pull/382'
3dabf55 move non-format tests out of the format directory, while keeping all ECMA regex tests together
4121aa5 move format tests to their own directory
4bae8aa Add more idn-hostname tests to draft-2019-09 and draft-07
6d91158 [325] Add some more hostname tests
e593057 Merge pull request #389 from ssilverman/readme-drafts
fb3766d README: Improve issue/PR links
79bef22 README: Update language around drafts
ade47e4 README: Add Snow to the list of supporting Java validators
fc0c14e README: Update simple JSON example
1167669 README: Update structure, consistency, spacing, and wrapping
9514122 Merge pull request #388 from json-schema-org/ether/maxProperties=0
7646490 test that maxProperties = 0 means the object is empty
c3f4319 Merge pull request #384 from ChALkeR/chalker/unique
7766f48 Improve uniqueItems validation
7555d41 Add unnormalized $id tests
11f70eb [300] Add tests for valid use of empty fragments in "$id"
b106ff0 [299] Add tests for invalid use of fragments in "$id"
4a74d45 Fix "tilde" spelling
3eca41b Merge pull request #379 from json-schema-org/ether/remove-wrapped-refs
d61bae8 remove wrapped refs
536ec07 [359] Add unevaluatedProperties/unevaluatedItems cousin tests
ac63eb7 Small README update that introduces the concept of directories
697944e Merge pull request #374 from karenetheridge/ether/allOf-anyOf-oneOf
33f8549 test all the *Of keywords together
44b99ed Merge pull request #373 from karenetheridge/ether/items-and-contains
4a2b52f some tests of items + contains
7f00cc8 add test that was present for other drafts but not 2019-09
a3f9e2e Merge pull request #371 from karenetheridge/ether/if-then-else-boolean
aeeaecc some tests with if/then/else and boolean schemas
b8a083c Merge pull request #372 from nomnoms12/unique-false-and-zero
85728f1 Add tests for uniqueness [1] and [true]
fd01a60 Add tests for uniqueness [1] and [true]
0a8823c Merge pull request #370 from karenetheridge/ether/nul-char
fa6f4dd add tests for the NUL character in strings
8bf2f7f Merge pull request #369 from ssilverman/data-desc
2ba7a76 Add data description
4f66078 Merge pull request #367 from karenetheridge/ether/additionalItems
283da7c some more tests for additionalItems
7ba95f3 add tests for keywords maxContains, minContains
2f2e7cf Merge pull request #365 from karenetheridge/ether/move-ecma-regex
8388f27 move ECMA regex tests under format/
git-subtree-dir: json
git-subtree-split: 817b724b7a64d7c18a8232aa32b5f1cc1d6dd153
JSON Schema Test Suite [](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
2
-
======
1
+
# JSON Schema Test Suite [](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
3
2
4
3
This repository contains a set of JSON objects that implementors of JSON Schema
5
4
validation libraries can use to test their validators.
@@ -9,108 +8,118 @@ It is meant to be language agnostic and should require only a JSON parser.
9
8
The conversion of the JSON objects into tests within your test framework of
10
9
choice is still the job of the validator implementor.
11
10
12
-
Structure of a Test
13
-
-------------------
11
+
## Structure of a Test
14
12
15
-
The tests in this suite are contained in the `tests` directory at the
16
-
root of this repository.
13
+
The tests in this suite are contained in the `tests` directory at the root of
14
+
this repository. Inside that directory is a subdirectory for each draft or
15
+
version of the specification.
17
16
18
-
Inside that directory is a subdirectory for each draft or version of the
19
-
specification.
17
+
Inside each draft directory, there are a number of `.json` files and one or more
18
+
special subdirectories. The subdirectories contain `.json` files meant for a
19
+
specific testing purpose, and each `.json` file logically groups a set of test
20
+
cases together. Often the grouping is by property under test, but not always.
20
21
21
-
Inside each draft directory, there are a number of `.json` files, which
22
-
logically group a set of test cases together. Often the grouping is by
23
-
property under test, but not always, especially within optional test
24
-
files (discussed below).
22
+
The subdirectories are described in the next section.
25
23
26
24
Inside each `.json` file is a single array containing objects. It's easiest to
27
25
illustrate the structure of these with an example:
28
26
29
27
```json
30
-
{
31
-
"description": "the description of the test case",
32
-
"schema": {"the schema that should" : "be validated against"},
33
-
"tests": [
34
-
{
35
-
"description": "a specific test of a valid instance",
36
-
"data": "the instance",
37
-
"valid": true
38
-
},
39
-
{
40
-
"description": "another specific test this time, invalid",
41
-
"data": 15,
42
-
"valid": false
43
-
}
44
-
]
45
-
}
28
+
{
29
+
"description": "The description of the test case",
30
+
"schema": {
31
+
"description": "The schema against which the data in each test is validated",
32
+
"type": "string"
33
+
},
34
+
"tests": [
35
+
{
36
+
"description": "Test for a valid instance",
37
+
"data": "the instance to validate",
38
+
"valid": true
39
+
},
40
+
{
41
+
"description": "Test for an invalid instance",
42
+
"data": 15,
43
+
"valid": false
44
+
}
45
+
]
46
+
}
46
47
```
47
48
48
-
In short: a description, a schema under test, and some tests, where each
49
-
test in the `tests` array is an objects with a description of the case
50
-
itself, the instance under test, and a boolean indicating whether it
51
-
should be valid or invalid.
49
+
In short: a description, a schema under test, and some tests, where each test
50
+
in the `tests` array is an objects with a description of the case itself, the
51
+
instance under test, and a boolean indicating whether it should be valid
52
+
or invalid.
52
53
53
-
Coverage
54
-
--------
54
+
## Test Subdirectories
55
55
56
-
Drafts 07, 06, 04 and 03 should have full coverage, with drafts 06 and
57
-
07 being considered current and actively supported.
56
+
There is currently only one subdirectory that may exist within each draft
57
+
directory. This is:
58
58
59
-
Draft 2019-09 support is under development. Contributions are very
60
-
welcome, especially from implementers as they add support to their own
61
-
implementations.
59
+
1.`optional/`: Contains tests that are considered optional.
62
60
63
-
If you see anything missing from the current supported drafts, or incorrect
64
-
on any draft still accepting bug fixes, please file an issue or submit a PR.
61
+
## Coverage
65
62
66
-
Who Uses the Test Suite
67
-
-----------------------
63
+
Drafts 07, 06, 04, and 03 should have full coverage, with tests for drafts 06,
64
+
07, and 2019-09 being considered current and actively supported. Draft 2019-09
65
+
is almost fully covered.
66
+
67
+
Contributions are very welcome, especially from implementers as they add support
68
+
to their own implementations.
69
+
70
+
If you see anything missing from the current supported drafts, or incorrect on
71
+
any draft still accepting bug fixes, please
72
+
[file an issue](https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues)
73
+
or [submit a PR](https://github.com/json-schema-org/JSON-Schema-Test-Suite).
If you use it as well, please fork and send a pull request adding yourself to
175
189
the list :).
176
190
177
-
Contributing
178
-
------------
191
+
## Contributing
179
192
180
193
If you see something missing or incorrect, a pull request is most welcome!
181
194
182
-
There are some sanity checks in place for testing the test suite. You
183
-
can run them with `bin/jsonschema_suite check` or `tox`. They will be
184
-
run automatically by [GitHub Actions](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
195
+
There are some sanity checks in place for testing the test suite. You can run
196
+
them with `bin/jsonschema_suite check` or `tox`. They will be run automatically
197
+
by [GitHub Actions](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
0 commit comments