Skip to content

Commit b6c9d38

Browse files
committed
Merge commit '16c234b52fedd290e6ee81951d59fd53b4b84142' into update-json-schema-test-suite-ii
2 parents ab5ea07 + 16c234b commit b6c9d38

File tree

374 files changed

+42175
-2558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+42175
-2558
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test Suite Sanity Checking
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [published]
8+
schedule:
9+
# Daily at 6:42
10+
- cron: '42 6 * * *'
11+
12+
jobs:
13+
ci:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.7
22+
- name: Install tox
23+
run: python -m pip install tox
24+
- name: Run the sanity checks
25+
run: python -m tox

JSON-Schema-Test-Suite/.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

JSON-Schema-Test-Suite/README.md

Lines changed: 93 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema-org/JSON-Schema-Test-Suite.svg?branch=master)](https://travis-ci.org/json-schema-org/JSON-Schema-Test-Suite)
2-
======================
1+
# JSON Schema Test Suite [![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)
32

43
This repository contains a set of JSON objects that implementors of JSON Schema
54
validation libraries can use to test their validators.
@@ -9,105 +8,123 @@ It is meant to be language agnostic and should require only a JSON parser.
98
The conversion of the JSON objects into tests within your test framework of
109
choice is still the job of the validator implementor.
1110

12-
Structure of a Test
13-
-------------------
11+
## Structure of a Test
1412

15-
If you're going to use this suite, you need to know how tests are laid out. The
16-
tests are contained in the `tests` directory at the 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.
1716

18-
Inside that directory is a subdirectory for each draft or version of the
19-
schema.
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.
2021

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. Often the grouping is by
23-
property under test, but not always, especially within optional test files
24-
(discussed below).
22+
The subdirectories are described in the next section.
2523

2624
Inside each `.json` file is a single array containing objects. It's easiest to
2725
illustrate the structure of these with an example:
2826

2927
```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+
}
4647
```
4748

48-
So a description, a schema, and some tests, where tests is an array containing
49-
one or more objects with descriptions, data, and a boolean indicating whether
50-
they 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.
5153

52-
Coverage
53-
--------
54+
## Test Subdirectories
5455

55-
Drafts 03, 04, 06, and 07 should have full coverage, with drafts 06 and 07
56-
being considered current and actively supported. Bug fixes will be made as
57-
needed for draft-04 as it is still the most widely used, while draft-03
58-
is long since deprecated.
56+
There is currently only one subdirectory that may exist within each draft
57+
directory. This is:
5958

60-
If you see anything missing from the current supported drafts, or incorrect
61-
on any draft still accepting bug fixes, please file an issue or submit a PR.
59+
1. `optional/`: Contains tests that are considered optional.
6260

63-
Who Uses the Test Suite
64-
-----------------------
61+
## Coverage
62+
63+
Drafts 07, 06, 04, and 03 should have full coverage, with tests for drafts 06,
64+
07, 2019-09 and 2020-12 being considered current and actively supported.
65+
Drafts 2019-09 and 2020-12 are 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).
74+
75+
## Who Uses the Test Suite
6576

6677
This suite is being used by:
6778

68-
### Clojure ###
79+
### Clojure
6980

7081
* [jinx](https://github.com/juxt/jinx)
7182
* [json-schema](https://github.com/tatut/json-schema)
7283

73-
### Coffeescript ###
84+
### Coffeescript
7485

7586
* [jsck](https://github.com/pandastrike/jsck)
7687

77-
### C++ ###
88+
### Common Lisp
89+
90+
* [json-schema](https://github.com/fisxoj/json-schema)
91+
92+
### C++
7893

7994
* [Modern C++ JSON schema validator](https://github.com/pboettch/json-schema-validator)
8095

81-
### Dart ###
96+
### Dart
8297

83-
* [json_schema](https://github.com/patefacio/json_schema)
98+
* [json\_schema](https://github.com/patefacio/json_schema)
8499

85-
### Elixir ###
100+
### Elixir
86101

87-
* [ex_json_schema](https://github.com/jonasschmidt/ex_json_schema)
102+
* [ex\_json\_schema](https://github.com/jonasschmidt/ex_json_schema)
88103

89-
### Erlang ###
104+
### Erlang
90105

91106
* [jesse](https://github.com/for-GET/jesse)
92107

93-
### Go ###
108+
### Go
94109

95110
* [gojsonschema](https://github.com/sigu-399/gojsonschema)
96111
* [validate-json](https://github.com/cesanta/validate-json)
97112

98-
### Haskell ###
113+
### Haskell
99114

100115
* [aeson-schema](https://github.com/timjb/aeson-schema)
101116
* [hjsonschema](https://github.com/seagreen/hjsonschema)
102117

103-
### Java ###
118+
### Java
104119

105120
* [json-schema-validator](https://github.com/daveclayton/json-schema-validator)
106121
* [everit-org/json-schema](https://github.com/everit-org/json-schema)
107122
* [networknt/json-schema-validator](https://github.com/networknt/json-schema-validator)
108123
* [Justify](https://github.com/leadpony/justify)
124+
* [Snow](https://github.com/ssilverman/snowy-json)
125+
* [jsonschemafriend](https://github.com/jimblackler/jsonschemafriend)
109126

110-
### JavaScript ###
127+
### JavaScript
111128

112129
* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)
113130
* [direct-schema](https://github.com/IreneKnapp/direct-schema)
@@ -125,7 +142,7 @@ This suite is being used by:
125142
* [ajv](https://github.com/epoberezkin/ajv)
126143
* [djv](https://github.com/korzio/djv)
127144

128-
### Node.js ###
145+
### Node.js
129146

130147
For node.js developers, the suite is also available as an
131148
[npm](https://www.npmjs.com/package/@json-schema-org/tests) package.
@@ -134,48 +151,57 @@ Node-specific support is maintained in a [separate
134151
repository](https://github.com/json-schema-org/json-schema-test-suite-npm)
135152
which also welcomes your contributions!
136153

137-
### .NET ###
154+
### .NET
138155

139156
* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema)
140157
* [Manatee.Json](https://github.com/gregsdennis/Manatee.Json)
141158

142-
### PHP ###
159+
### Perl
160+
161+
* [JSON::Schema::Draft201909](https://github.com/karenetheridge/JSON-Schema-Draft201909)
162+
* [JSON::Schema::Tiny](https://github.com/karenetheridge/JSON-Schema-Tiny)
163+
* [Test::JSON::Schema::Acceptance](https://github.com/karenetheridge/Test-JSON-Schema-Acceptance)
164+
165+
### PHP
143166

167+
* [opis/json-schema](https://github.com/opis/json-schema)
144168
* [json-schema](https://github.com/justinrainbow/json-schema)
145169
* [json-guard](https://github.com/thephpleague/json-guard)
146170

147-
### PostgreSQL ###
171+
### PostgreSQL
148172

149173
* [postgres-json-schema](https://github.com/gavinwahl/postgres-json-schema)
150-
* [is_jsonb_valid](https://github.com/furstenheim/is_jsonb_valid)
174+
* [is\_jsonb\_valid](https://github.com/furstenheim/is_jsonb_valid)
151175

152-
### Python ###
176+
### Python
153177

154178
* [jsonschema](https://github.com/Julian/jsonschema)
155179
* [fastjsonschema](https://github.com/seznam/python-fastjsonschema)
156180
* [hypothesis-jsonschema](https://github.com/Zac-HD/hypothesis-jsonschema)
181+
* [jschon](https://github.com/marksparkza/jschon)
157182

158-
### Ruby ###
183+
### Ruby
159184

160185
* [json-schema](https://github.com/hoxworth/json-schema)
161-
* [json_schemer](https://github.com/davishmcclurg/json_schemer)
186+
* [json\_schemer](https://github.com/davishmcclurg/json_schemer)
162187

163-
### Rust ###
188+
### Rust
164189

190+
* [jsonschema](https://github.com/Stranger6667/jsonschema-rs)
165191
* [valico](https://github.com/rustless/valico)
166192

167-
### Swift ###
193+
### Swift
168194

169195
* [JSONSchema](https://github.com/kylef/JSONSchema.swift)
170196

171197
If you use it as well, please fork and send a pull request adding yourself to
172198
the list :).
173199

174-
Contributing
175-
------------
200+
## Contributing
176201

177202
If you see something missing or incorrect, a pull request is most welcome!
178203

179204
There are some sanity checks in place for testing the test suite. You can run
180-
them with `bin/jsonschema_suite check && npm test` or `tox && npm test`. They will be run automatically by
181-
[Travis CI](https://travis-ci.org/) as well.
205+
them with `bin/jsonschema_suite check` or `tox`. They will be run automatically
206+
by [GitHub Actions](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22)
207+
as well.

0 commit comments

Comments
 (0)