summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2013-06-17 21:00:55 -0400
committerJulian Berman <Julian@GrayVines.com>2013-06-17 21:00:55 -0400
commita810028210ea6d70cf926c8aa33f54a34d2562f6 (patch)
tree3f6bfa0b6d6a7674e9755586901e805dd66456ba /json
parentadc4216c7e437eb018eab3e18745748ee4a9dce5 (diff)
parent0a93c5da6f8db71ded773af1d5609c5f2e6ba241 (diff)
downloadjsonschema-a810028210ea6d70cf926c8aa33f54a34d2562f6.tar.gz
Merge commit '0a93c5da6f8db71ded773af1d5609c5f2e6ba241'
Diffstat (limited to 'json')
-rw-r--r--json/README.md6
-rwxr-xr-xjson/bin/jsonschema_suite8
-rw-r--r--json/tests/draft3/optional/format.json5
-rw-r--r--json/tests/draft4/optional/format.json5
4 files changed, 19 insertions, 5 deletions
diff --git a/json/README.md b/json/README.md
index b375623..03a2c56 100644
--- a/json/README.md
+++ b/json/README.md
@@ -52,9 +52,8 @@ they should be valid or invalid.
Coverage
--------
-Currently, draft 3 should have essentially full coverage for the core schema.
-
-The beginnings of draft 4 are underway.
+Draft 3 and 4 should have full coverage. If you see anything missing or think
+there is a useful test missing, please send a pull request or open an issue.
Who Uses the Test Suite
-----------------------
@@ -68,6 +67,7 @@ This suite is being used by:
* [jsonschema (javascript)](https://github.com/tdegrunt/jsonschema)
* [JaySchema (javascript)](https://github.com/natesilva/jayschema)
* [jesse (Erlang)](https://github.com/klarna/jesse)
+ * [json-schema (PHP)](https://github.com/justinrainbow/json-schema)
If you use it as well, please fork and send a pull request adding yourself to
the list :).
diff --git a/json/bin/jsonschema_suite b/json/bin/jsonschema_suite
index 9729fc0..96108c8 100755
--- a/json/bin/jsonschema_suite
+++ b/json/bin/jsonschema_suite
@@ -32,6 +32,10 @@ try:
import jsonschema
except ImportError:
jsonschema = None
+else:
+ validators = getattr(
+ jsonschema.validators, "validators", jsonschema.validators
+ )
ROOT_DIR = os.path.join(
@@ -138,8 +142,8 @@ class SanityTests(unittest.TestCase):
@unittest.skipIf(jsonschema is None, "Validation library not present!")
def test_all_schemas_are_valid(self):
for schema in os.listdir(SUITE_ROOT_DIR):
- schema_validator = jsonschema.validators.get(schema)
- if schema_validator:
+ schema_validator = validators.get(schema)
+ if schema_validator is not None:
test_files = collect(os.path.join(SUITE_ROOT_DIR, schema))
for case in cases(test_files):
try:
diff --git a/json/tests/draft3/optional/format.json b/json/tests/draft3/optional/format.json
index 82f7f13..1ff461a 100644
--- a/json/tests/draft3/optional/format.json
+++ b/json/tests/draft3/optional/format.json
@@ -28,6 +28,11 @@
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
}
]
},
diff --git a/json/tests/draft4/optional/format.json b/json/tests/draft4/optional/format.json
index 2a2f271..cba8fc3 100644
--- a/json/tests/draft4/optional/format.json
+++ b/json/tests/draft4/optional/format.json
@@ -12,6 +12,11 @@
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
}
]
},