Skip to content

Commit a810028

Browse files
committed
Merge commit '0a93c5da6f8db71ded773af1d5609c5f2e6ba241'
2 parents adc4216 + 0a93c5d commit a810028

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

json/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ they should be valid or invalid.
5252
Coverage
5353
--------
5454

55-
Currently, draft 3 should have essentially full coverage for the core schema.
56-
57-
The beginnings of draft 4 are underway.
55+
Draft 3 and 4 should have full coverage. If you see anything missing or think
56+
there is a useful test missing, please send a pull request or open an issue.
5857

5958
Who Uses the Test Suite
6059
-----------------------
@@ -68,6 +67,7 @@ This suite is being used by:
6867
* [jsonschema (javascript)](https://github.com/tdegrunt/jsonschema)
6968
* [JaySchema (javascript)](https://github.com/natesilva/jayschema)
7069
* [jesse (Erlang)](https://github.com/klarna/jesse)
70+
* [json-schema (PHP)](https://github.com/justinrainbow/json-schema)
7171

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

json/bin/jsonschema_suite

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ try:
3232
import jsonschema
3333
except ImportError:
3434
jsonschema = None
35+
else:
36+
validators = getattr(
37+
jsonschema.validators, "validators", jsonschema.validators
38+
)
3539

3640

3741
ROOT_DIR = os.path.join(
@@ -138,8 +142,8 @@ class SanityTests(unittest.TestCase):
138142
@unittest.skipIf(jsonschema is None, "Validation library not present!")
139143
def test_all_schemas_are_valid(self):
140144
for schema in os.listdir(SUITE_ROOT_DIR):
141-
schema_validator = jsonschema.validators.get(schema)
142-
if schema_validator:
145+
schema_validator = validators.get(schema)
146+
if schema_validator is not None:
143147
test_files = collect(os.path.join(SUITE_ROOT_DIR, schema))
144148
for case in cases(test_files):
145149
try:

json/tests/draft3/optional/format.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
"description": "an invalid date-time string",
2929
"data": "06/19/1963 08:30:06 PST",
3030
"valid": false
31+
},
32+
{
33+
"description": "only RFC3339 not all of ISO 8601 are valid",
34+
"data": "2013-350T01:01:01",
35+
"valid": false
3136
}
3237
]
3338
},

json/tests/draft4/optional/format.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
"description": "an invalid date-time string",
1313
"data": "06/19/1963 08:30:06 PST",
1414
"valid": false
15+
},
16+
{
17+
"description": "only RFC3339 not all of ISO 8601 are valid",
18+
"data": "2013-350T01:01:01",
19+
"valid": false
1520
}
1621
]
1722
},

0 commit comments

Comments
 (0)