@@ -6,8 +6,8 @@ validation libraries can use to test their validators.
6
6
7
7
It is meant to be language agnostic and should require only a JSON parser.
8
8
9
- The conversion of the JSON objects into your test framework of choice (say,
10
- an ` xUnit ` ) is still the job of the validator implementor.
9
+ The conversion of the JSON objects into tests within your test framework of choice
10
+ is still the job of the validator implementor.
11
11
12
12
Structure of a Test
13
13
-------------------
@@ -19,15 +19,17 @@ Inside that directory is a subdirectory for each draft or version of the
19
19
schema. We'll use ` draft3 ` as an example.
20
20
21
21
If you look inside the draft directory, there are a number of ` .json ` files,
22
- which logically group a set of test cases together.
22
+ which logically group a set of test cases together. Often the grouping is by
23
+ property under test, but not always, especially within optional test files
24
+ (discussed below).
23
25
24
26
Inside each ` .json ` file is a single array containing objects. It's easiest to
25
27
illustrate the structure of these with an example:
26
28
27
29
``` json
28
30
{
29
31
"description" : " the description of the test case" ,
30
- "schema" : " the schema that should be validated against" ,
32
+ "schema" : { "the schema that should" : " be validated against" } ,
31
33
"tests" : [
32
34
{
33
35
"description" : " a specific test of a valid instance" ,
@@ -50,11 +52,9 @@ they should be valid or invalid.
50
52
Coverage
51
53
--------
52
54
53
- The coverage of this suite is actively growing. The first order of business is
54
- to have a full-coverage draft 3 test suite.
55
+ Currently, draft 3 should have essentially full coverage for the core schema.
55
56
56
- Ultimately, when it's done, the idea is to attempt to have it included on [ the
57
- JSON Schema website] ( http://www.json-schema.org ) .
57
+ The beginnings of draft 4 are underway.
58
58
59
59
Who Uses the Test Suite
60
60
-----------------------
@@ -71,18 +71,4 @@ the list :).
71
71
Contributing
72
72
------------
73
73
74
- I need help! If you'd like to contribute, please fork this repository. I'd love
75
- to have your pull requests sent over.
76
-
77
- Right now, the way I'm compiling the tests is by porting over a test suite
78
- that I'd written for a Python validator. The tests (in a messy format) can be
79
- found [ here] ( https://github.com/Julian/jsonschema/blob/master/tests.py#L100 ) .
80
-
81
- There are also other JSON Schema test suites for various other validators, and
82
- it would certainly be nice to merge all of them as well. In particular, [ this
83
- validator] ( https://github.com/fge/json-schema-validator/tree/master/src/test/resources/keyword )
84
- contains a set of tests already written in JSON which will be useful.
85
-
86
- I'm perfectly fine with contributions either porting from one of those, or
87
- being written from scratch, so feel free to do what you're comfortable with as
88
- long as the tests are easy to understand and correct :).
74
+ If you see something missing or incorrect, a pull request is most welcome!
0 commit comments