From 5ad3639dd5004fd39660fb452e299380ab22d3b6 Mon Sep 17 00:00:00 2001 From: miloyip Date: Wed, 6 May 2015 18:11:57 +0800 Subject: [PATCH] Add Json Schema Test Suite [ci skip] --- .gitignore | 4 - bin/jsonschema/.gitignore | 1 + bin/jsonschema/.travis.yml | 4 + bin/jsonschema/LICENSE | 19 ++ bin/jsonschema/README.md | 89 ++++++ bin/jsonschema/bin/jsonschema_suite | 283 ++++++++++++++++++ .../remotes/folder/folderInteger.json | Bin 0 -> 25 bytes bin/jsonschema/remotes/integer.json | Bin 0 -> 25 bytes bin/jsonschema/remotes/subSchemas.json | Bin 0 -> 110 bytes .../tests/draft3/additionalItems.json | Bin 0 -> 2257 bytes .../tests/draft3/additionalProperties.json | Bin 0 -> 2194 bytes bin/jsonschema/tests/draft3/dependencies.json | Bin 0 -> 2989 bytes bin/jsonschema/tests/draft3/disallow.json | Bin 0 -> 1936 bytes bin/jsonschema/tests/draft3/divisibleBy.json | Bin 0 -> 1544 bytes bin/jsonschema/tests/draft3/enum.json | Bin 0 -> 1964 bytes bin/jsonschema/tests/draft3/extends.json | Bin 0 -> 2591 bytes bin/jsonschema/tests/draft3/items.json | Bin 0 -> 1136 bytes bin/jsonschema/tests/draft3/maxItems.json | Bin 0 -> 706 bytes bin/jsonschema/tests/draft3/maxLength.json | Bin 0 -> 895 bytes bin/jsonschema/tests/draft3/maximum.json | Bin 0 -> 1063 bytes bin/jsonschema/tests/draft3/minItems.json | Bin 0 -> 693 bytes bin/jsonschema/tests/draft3/minLength.json | Bin 0 -> 886 bytes bin/jsonschema/tests/draft3/minimum.json | Bin 0 -> 1063 bytes .../tests/draft3/optional/bignum.json | Bin 0 -> 1663 bytes .../tests/draft3/optional/format.json | Bin 0 -> 6577 bytes .../tests/draft3/optional/jsregex.json | Bin 0 -> 463 bytes .../draft3/optional/zeroTerminatedFloats.json | Bin 0 -> 384 bytes bin/jsonschema/tests/draft3/pattern.json | Bin 0 -> 582 bytes .../tests/draft3/patternProperties.json | Bin 0 -> 3365 bytes bin/jsonschema/tests/draft3/properties.json | Bin 0 -> 2881 bytes bin/jsonschema/tests/draft3/ref.json | Bin 0 -> 3922 bytes bin/jsonschema/tests/draft3/refRemote.json | Bin 0 -> 1961 bytes bin/jsonschema/tests/draft3/required.json | Bin 0 -> 1282 bytes bin/jsonschema/tests/draft3/type.json | Bin 0 -> 13225 bytes bin/jsonschema/tests/draft3/uniqueItems.json | Bin 0 -> 2613 bytes .../tests/draft4/additionalItems.json | Bin 0 -> 2282 bytes .../tests/draft4/additionalProperties.json | Bin 0 -> 2194 bytes bin/jsonschema/tests/draft4/allOf.json | Bin 0 -> 3025 bytes bin/jsonschema/tests/draft4/anyOf.json | Bin 0 -> 1608 bytes bin/jsonschema/tests/draft4/definitions.json | Bin 0 -> 854 bytes bin/jsonschema/tests/draft4/dependencies.json | Bin 0 -> 3139 bytes bin/jsonschema/tests/draft4/enum.json | Bin 0 -> 1975 bytes bin/jsonschema/tests/draft4/items.json | Bin 0 -> 1136 bytes bin/jsonschema/tests/draft4/maxItems.json | Bin 0 -> 706 bytes bin/jsonschema/tests/draft4/maxLength.json | Bin 0 -> 895 bytes .../tests/draft4/maxProperties.json | Bin 0 -> 759 bytes bin/jsonschema/tests/draft4/maximum.json | Bin 0 -> 1063 bytes bin/jsonschema/tests/draft4/minItems.json | Bin 0 -> 693 bytes bin/jsonschema/tests/draft4/minLength.json | Bin 0 -> 886 bytes .../tests/draft4/minProperties.json | Bin 0 -> 725 bytes bin/jsonschema/tests/draft4/minimum.json | Bin 0 -> 1063 bytes bin/jsonschema/tests/draft4/multipleOf.json | Bin 0 -> 1525 bytes bin/jsonschema/tests/draft4/not.json | Bin 0 -> 2266 bytes bin/jsonschema/tests/draft4/oneOf.json | Bin 0 -> 1607 bytes .../tests/draft4/optional/bignum.json | Bin 0 -> 1663 bytes .../tests/draft4/optional/format.json | Bin 0 -> 4434 bytes .../draft4/optional/zeroTerminatedFloats.json | Bin 0 -> 384 bytes bin/jsonschema/tests/draft4/pattern.json | Bin 0 -> 582 bytes .../tests/draft4/patternProperties.json | Bin 0 -> 3365 bytes bin/jsonschema/tests/draft4/properties.json | Bin 0 -> 2881 bytes bin/jsonschema/tests/draft4/ref.json | Bin 0 -> 3903 bytes bin/jsonschema/tests/draft4/refRemote.json | Bin 0 -> 1961 bytes bin/jsonschema/tests/draft4/required.json | Bin 0 -> 923 bytes bin/jsonschema/tests/draft4/type.json | Bin 0 -> 9306 bytes bin/jsonschema/tests/draft4/uniqueItems.json | Bin 0 -> 2613 bytes include/rapidjson/schema.h | 55 +++- test/unittest/schematest.cpp | 118 +++++++- 67 files changed, 557 insertions(+), 16 deletions(-) create mode 100644 bin/jsonschema/.gitignore create mode 100644 bin/jsonschema/.travis.yml create mode 100644 bin/jsonschema/LICENSE create mode 100644 bin/jsonschema/README.md create mode 100644 bin/jsonschema/bin/jsonschema_suite create mode 100644 bin/jsonschema/remotes/folder/folderInteger.json create mode 100644 bin/jsonschema/remotes/integer.json create mode 100644 bin/jsonschema/remotes/subSchemas.json create mode 100644 bin/jsonschema/tests/draft3/additionalItems.json create mode 100644 bin/jsonschema/tests/draft3/additionalProperties.json create mode 100644 bin/jsonschema/tests/draft3/dependencies.json create mode 100644 bin/jsonschema/tests/draft3/disallow.json create mode 100644 bin/jsonschema/tests/draft3/divisibleBy.json create mode 100644 bin/jsonschema/tests/draft3/enum.json create mode 100644 bin/jsonschema/tests/draft3/extends.json create mode 100644 bin/jsonschema/tests/draft3/items.json create mode 100644 bin/jsonschema/tests/draft3/maxItems.json create mode 100644 bin/jsonschema/tests/draft3/maxLength.json create mode 100644 bin/jsonschema/tests/draft3/maximum.json create mode 100644 bin/jsonschema/tests/draft3/minItems.json create mode 100644 bin/jsonschema/tests/draft3/minLength.json create mode 100644 bin/jsonschema/tests/draft3/minimum.json create mode 100644 bin/jsonschema/tests/draft3/optional/bignum.json create mode 100644 bin/jsonschema/tests/draft3/optional/format.json create mode 100644 bin/jsonschema/tests/draft3/optional/jsregex.json create mode 100644 bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json create mode 100644 bin/jsonschema/tests/draft3/pattern.json create mode 100644 bin/jsonschema/tests/draft3/patternProperties.json create mode 100644 bin/jsonschema/tests/draft3/properties.json create mode 100644 bin/jsonschema/tests/draft3/ref.json create mode 100644 bin/jsonschema/tests/draft3/refRemote.json create mode 100644 bin/jsonschema/tests/draft3/required.json create mode 100644 bin/jsonschema/tests/draft3/type.json create mode 100644 bin/jsonschema/tests/draft3/uniqueItems.json create mode 100644 bin/jsonschema/tests/draft4/additionalItems.json create mode 100644 bin/jsonschema/tests/draft4/additionalProperties.json create mode 100644 bin/jsonschema/tests/draft4/allOf.json create mode 100644 bin/jsonschema/tests/draft4/anyOf.json create mode 100644 bin/jsonschema/tests/draft4/definitions.json create mode 100644 bin/jsonschema/tests/draft4/dependencies.json create mode 100644 bin/jsonschema/tests/draft4/enum.json create mode 100644 bin/jsonschema/tests/draft4/items.json create mode 100644 bin/jsonschema/tests/draft4/maxItems.json create mode 100644 bin/jsonschema/tests/draft4/maxLength.json create mode 100644 bin/jsonschema/tests/draft4/maxProperties.json create mode 100644 bin/jsonschema/tests/draft4/maximum.json create mode 100644 bin/jsonschema/tests/draft4/minItems.json create mode 100644 bin/jsonschema/tests/draft4/minLength.json create mode 100644 bin/jsonschema/tests/draft4/minProperties.json create mode 100644 bin/jsonschema/tests/draft4/minimum.json create mode 100644 bin/jsonschema/tests/draft4/multipleOf.json create mode 100644 bin/jsonschema/tests/draft4/not.json create mode 100644 bin/jsonschema/tests/draft4/oneOf.json create mode 100644 bin/jsonschema/tests/draft4/optional/bignum.json create mode 100644 bin/jsonschema/tests/draft4/optional/format.json create mode 100644 bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json create mode 100644 bin/jsonschema/tests/draft4/pattern.json create mode 100644 bin/jsonschema/tests/draft4/patternProperties.json create mode 100644 bin/jsonschema/tests/draft4/properties.json create mode 100644 bin/jsonschema/tests/draft4/ref.json create mode 100644 bin/jsonschema/tests/draft4/refRemote.json create mode 100644 bin/jsonschema/tests/draft4/required.json create mode 100644 bin/jsonschema/tests/draft4/type.json create mode 100644 bin/jsonschema/tests/draft4/uniqueItems.json diff --git a/.gitignore b/.gitignore index 95acb0c..c23c7f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ -/bin/* -!/bin/data -!/bin/encodings -!/bin/jsonchecker /build /doc/html /doc/doxygen_*.db diff --git a/bin/jsonschema/.gitignore b/bin/jsonschema/.gitignore new file mode 100644 index 0000000..1333ed7 --- /dev/null +++ b/bin/jsonschema/.gitignore @@ -0,0 +1 @@ +TODO diff --git a/bin/jsonschema/.travis.yml b/bin/jsonschema/.travis.yml new file mode 100644 index 0000000..deecd61 --- /dev/null +++ b/bin/jsonschema/.travis.yml @@ -0,0 +1,4 @@ +language: python +python: "2.7" +install: pip install jsonschema +script: bin/jsonschema_suite check diff --git a/bin/jsonschema/LICENSE b/bin/jsonschema/LICENSE new file mode 100644 index 0000000..c28adba --- /dev/null +++ b/bin/jsonschema/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Julian Berman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bin/jsonschema/README.md b/bin/jsonschema/README.md new file mode 100644 index 0000000..12c49c0 --- /dev/null +++ b/bin/jsonschema/README.md @@ -0,0 +1,89 @@ +JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite.png?branch=develop)](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite) +====================== + +This repository contains a set of JSON objects that implementors of JSON Schema +validation libraries can use to test their validators. + +It is meant to be language agnostic and should require only a JSON parser. + +The conversion of the JSON objects into tests within your test framework of +choice is still the job of the validator implementor. + +Structure of a Test +------------------- + +If you're going to use this suite, you need to know how tests are laid out. The +tests are contained in the `tests` directory at the root of this repository. + +Inside that directory is a subdirectory for each draft or version of the +schema. We'll use `draft3` as an example. + +If you look inside the draft directory, there are a number of `.json` files, +which logically group a set of test cases together. Often the grouping is by +property under test, but not always, especially within optional test files +(discussed below). + +Inside each `.json` file is a single array containing objects. It's easiest to +illustrate the structure of these with an example: + +```json + { + "description": "the description of the test case", + "schema": {"the schema that should" : "be validated against"}, + "tests": [ + { + "description": "a specific test of a valid instance", + "data": "the instance", + "valid": true + }, + { + "description": "another specific test this time, invalid", + "data": 15, + "valid": false + } + ] + } +``` + +So a description, a schema, and some tests, where tests is an array containing +one or more objects with descriptions, data, and a boolean indicating whether +they should be valid or invalid. + +Coverage +-------- + +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 +----------------------- + +This suite is being used by: + + * [json-schema-validator (Java)](https://github.com/fge/json-schema-validator) + * [jsonschema (python)](https://github.com/Julian/jsonschema) + * [aeson-schema (haskell)](https://github.com/timjb/aeson-schema) + * [direct-schema (javascript)](https://github.com/IreneKnapp/direct-schema) + * [jsonschema (javascript)](https://github.com/tdegrunt/jsonschema) + * [JaySchema (javascript)](https://github.com/natesilva/jayschema) + * [z-schema (javascript)](https://github.com/zaggino/z-schema) + * [jassi (javascript)](https://github.com/iclanzan/jassi) + * [json-schema-valid (javascript)](https://github.com/ericgj/json-schema-valid) + * [jesse (Erlang)](https://github.com/klarna/jesse) + * [json-schema (PHP)](https://github.com/justinrainbow/json-schema) + * [gojsonschema (Go)](https://github.com/sigu-399/gojsonschema) + * [json_schema (Dart)](https://github.com/patefacio/json_schema) + * [tv4 (JavaScript)](https://github.com/geraintluff/tv4) + * [Jsonary (JavaScript)](https://github.com/jsonary-js/jsonary) + +If you use it as well, please fork and send a pull request adding yourself to +the list :). + +Contributing +------------ + +If you see something missing or incorrect, a pull request is most welcome! + +There are some sanity checks in place for testing the test suite. You can run +them with `bin/jsonschema_suite check`. They will be run automatically by +[Travis CI](https://travis-ci.org/) as well. diff --git a/bin/jsonschema/bin/jsonschema_suite b/bin/jsonschema/bin/jsonschema_suite new file mode 100644 index 0000000..96108c8 --- /dev/null +++ b/bin/jsonschema/bin/jsonschema_suite @@ -0,0 +1,283 @@ +#! /usr/bin/env python +from __future__ import print_function +import sys +import textwrap + +try: + import argparse +except ImportError: + print(textwrap.dedent(""" + The argparse library could not be imported. jsonschema_suite requires + either Python 2.7 or for you to install argparse. You can do so by + running `pip install argparse`, `easy_install argparse` or by + downloading argparse and running `python2.6 setup.py install`. + + See https://pypi.python.org/pypi/argparse for details. + """.strip("\n"))) + sys.exit(1) + +import errno +import fnmatch +import json +import os +import random +import shutil +import unittest +import warnings + +if getattr(unittest, "skipIf", None) is None: + unittest.skipIf = lambda cond, msg : lambda fn : fn + +try: + import jsonschema +except ImportError: + jsonschema = None +else: + validators = getattr( + jsonschema.validators, "validators", jsonschema.validators + ) + + +ROOT_DIR = os.path.join( + os.path.dirname(__file__), os.pardir).rstrip("__pycache__") +SUITE_ROOT_DIR = os.path.join(ROOT_DIR, "tests") + +REMOTES = { + "integer.json": {"type": "integer"}, + "subSchemas.json": { + "integer": {"type": "integer"}, + "refToInteger": {"$ref": "#/integer"}, + }, + "folder/folderInteger.json": {"type": "integer"} +} +REMOTES_DIR = os.path.join(ROOT_DIR, "remotes") + +TESTSUITE_SCHEMA = { + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string", "required": True}, + "schema": {"required": True}, + "tests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string", "required": True}, + "data": {"required": True}, + "valid": {"type": "boolean", "required": True} + }, + "additionalProperties": False + }, + "minItems": 1 + } + }, + "additionalProperties": False, + "minItems": 1 + } +} + + +def files(paths): + for path in paths: + with open(path) as test_file: + yield json.load(test_file) + + +def groups(paths): + for test_file in files(paths): + for group in test_file: + yield group + + +def cases(paths): + for test_group in groups(paths): + for test in test_group["tests"]: + test["schema"] = test_group["schema"] + yield test + + +def collect(root_dir): + for root, dirs, files in os.walk(root_dir): + for filename in fnmatch.filter(files, "*.json"): + yield os.path.join(root, filename) + + +class SanityTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + print("Looking for tests in %s" % SUITE_ROOT_DIR) + cls.test_files = list(collect(SUITE_ROOT_DIR)) + print("Found %s test files" % len(cls.test_files)) + assert cls.test_files, "Didn't find the test files!" + + def test_all_files_are_valid_json(self): + for path in self.test_files: + with open(path) as test_file: + try: + json.load(test_file) + except ValueError as error: + self.fail("%s contains invalid JSON (%s)" % (path, error)) + + def test_all_descriptions_have_reasonable_length(self): + for case in cases(self.test_files): + descript = case["description"] + self.assertLess( + len(descript), + 60, + "%r is too long! (keep it to less than 60 chars)" % (descript,) + ) + + def test_all_descriptions_are_unique(self): + for group in groups(self.test_files): + descriptions = set(test["description"] for test in group["tests"]) + self.assertEqual( + len(descriptions), + len(group["tests"]), + "%r contains a duplicate description" % (group,) + ) + + @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 = 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: + schema_validator.check_schema(case["schema"]) + except jsonschema.SchemaError as error: + self.fail("%s contains an invalid schema (%s)" % + (case, error)) + else: + warnings.warn("No schema validator for %s" % schema) + + @unittest.skipIf(jsonschema is None, "Validation library not present!") + def test_suites_are_valid(self): + validator = jsonschema.Draft3Validator(TESTSUITE_SCHEMA) + for tests in files(self.test_files): + try: + validator.validate(tests) + except jsonschema.ValidationError as error: + self.fail(str(error)) + + def test_remote_schemas_are_updated(self): + for url, schema in REMOTES.items(): + filepath = os.path.join(REMOTES_DIR, url) + with open(filepath) as schema_file: + self.assertEqual(json.load(schema_file), schema) + + +def main(arguments): + if arguments.command == "check": + suite = unittest.TestLoader().loadTestsFromTestCase(SanityTests) + result = unittest.TextTestRunner(verbosity=2).run(suite) + sys.exit(not result.wasSuccessful()) + elif arguments.command == "flatten": + selected_cases = [case for case in cases(collect(arguments.version))] + + if arguments.randomize: + random.shuffle(selected_cases) + + json.dump(selected_cases, sys.stdout, indent=4, sort_keys=True) + elif arguments.command == "remotes": + json.dump(REMOTES, sys.stdout, indent=4, sort_keys=True) + elif arguments.command == "dump_remotes": + if arguments.update: + shutil.rmtree(arguments.out_dir, ignore_errors=True) + + try: + os.makedirs(arguments.out_dir) + except OSError as e: + if e.errno == errno.EEXIST: + print("%s already exists. Aborting." % arguments.out_dir) + sys.exit(1) + raise + + for url, schema in REMOTES.items(): + filepath = os.path.join(arguments.out_dir, url) + + try: + os.makedirs(os.path.dirname(filepath)) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + with open(filepath, "wb") as out_file: + json.dump(schema, out_file, indent=4, sort_keys=True) + elif arguments.command == "serve": + try: + from flask import Flask, jsonify + except ImportError: + print(textwrap.dedent(""" + The Flask library is required to serve the remote schemas. + + You can install it by running `pip install Flask`. + + Alternatively, see the `jsonschema_suite remotes` or + `jsonschema_suite dump_remotes` commands to create static files + that can be served with your own web server. + """.strip("\n"))) + sys.exit(1) + + app = Flask(__name__) + + @app.route("/") + def serve_path(path): + if path in REMOTES: + return jsonify(REMOTES[path]) + return "Document does not exist.", 404 + + app.run(port=1234) + + +parser = argparse.ArgumentParser( + description="JSON Schema Test Suite utilities", +) +subparsers = parser.add_subparsers(help="utility commands", dest="command") + +check = subparsers.add_parser("check", help="Sanity check the test suite.") + +flatten = subparsers.add_parser( + "flatten", + help="Output a flattened file containing a selected version's test cases." +) +flatten.add_argument( + "--randomize", + action="store_true", + help="Randomize the order of the outputted cases.", +) +flatten.add_argument( + "version", help="The directory containing the version to output", +) + +remotes = subparsers.add_parser( + "remotes", + help="Output the expected URLs and their associated schemas for remote " + "ref tests as a JSON object." +) + +dump_remotes = subparsers.add_parser( + "dump_remotes", help="Dump the remote ref schemas into a file tree", +) +dump_remotes.add_argument( + "--update", + action="store_true", + help="Update the remotes in an existing directory.", +) +dump_remotes.add_argument( + "--out-dir", + default=REMOTES_DIR, + type=os.path.abspath, + help="The output directory to create as the root of the file tree", +) + +serve = subparsers.add_parser( + "serve", + help="Start a webserver to serve schemas used by remote ref tests." +) + +if __name__ == "__main__": + main(parser.parse_args()) diff --git a/bin/jsonschema/remotes/folder/folderInteger.json b/bin/jsonschema/remotes/folder/folderInteger.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe5c758ee3c3092bd155a63c3efd4892125ca02 GIT binary patch literal 25 ecmb>CQUC&_lFEWqB`XD`%)FA+^wc6Hu37+8uLmCh literal 0 HcmV?d00001 diff --git a/bin/jsonschema/remotes/integer.json b/bin/jsonschema/remotes/integer.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe5c758ee3c3092bd155a63c3efd4892125ca02 GIT binary patch literal 25 ecmb>CQUC&_lFEWqB`XD`%)FA+^wc6Hu37+8uLmCh literal 0 HcmV?d00001 diff --git a/bin/jsonschema/remotes/subSchemas.json b/bin/jsonschema/remotes/subSchemas.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6d8f842fc0ddc8a114cb6ebc000f2b2080a9c3 GIT binary patch literal 110 zcmb>CQUC&_%)FA+^wc6HD}`#X09df3vLF>G0+$5K)aocev=pVLh2(o;)29NI0_juM LhZzge$yEyg_re>9 literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/additionalItems.json b/bin/jsonschema/tests/draft3/additionalItems.json new file mode 100644 index 0000000000000000000000000000000000000000..6d4bff51cf342398c57b4a4f94da1798d4224e9e GIT binary patch literal 2257 zcmcIl!EWOq5WVLsMx4EeZFevIgZ+jm2O5uKBy230w6dc9dl_&HCYvU4Riq?1hT+Yd zH;?TG{5XYgo{1XW-l~C=>BS2OS=Wl^QvW0D97qRl-(n|4mG(^kykv1gEX7-Vldcp%*@iE8$NV^50qY!d_%K;O9e&TUG4+yBBleBLybBVioza+`f z;dcd36+Bn)2Z}VpId4*{+Akz~#091dH7{HNu{O{fT7gtF#)vP`Hd4C+?hJkxW)u7b zyJR%dsLpz*JXR>{nicMrMotA^rSd$*OVHW+^{UW%y&Nj|`z6Phig=V_X{{W=G!w>m zMeR3P-g=rLes-xiLC9t8euD3XM5e3;iw=9r{Dk4~xah$L>0Tz7lpLeq;Sthe=)eJO zr--n=2jnfISgM$@B&WNx^@>ulDTk=Q3Nc5D%w}Lk>b`4z_5F65)qUode?_#38XI}k z(i^C{}sB?Wvrg_ zJnQrneb?V%uhQRN%d^7fMDj=-@ literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/additionalProperties.json b/bin/jsonschema/tests/draft3/additionalProperties.json new file mode 100644 index 0000000000000000000000000000000000000000..eb334c985cec4c1493c0e5bf3995b73dc46f24d9 GIT binary patch literal 2194 zcmd^A!E(YN5WV{qJA1YV+nZm}yJKgFSq+^CDG;sG@!!irBqU9(Q+q21XAKLyeZ04< zX5hz1_~i&ovKu2CC$++5`W&W2SxWvc>Sv=HGES0(f~4BPR@9cD)c%9g4n$q+BWPEV zfhOhRJne^eQ_)`FGCMk)k!AZi+-l7^=Q&^@ObE~YE^&o$j*RLdaTegqA!NfieX0nb z845`7vPI~~I_oo5X_k-e8RLIEhRgvf4gFae3m`2VL@mpVj<^HwAzUD(D}0dwNjY)x z5}avifN7NcGen^#Af6bYRJTEdB`mtT@!_Kn-`e&aeT;?HdmKRuJYDb)Dd(wC_Rj^# zozf;~PCe-2l{WsShVlp}cC4;ER1fiKJ&|$&bw8=iSdSnKMOP&MWOBHIx062;d@#(W zXLv->fY7hllRVZT>K6CB4mF#y!>+w}duv5wTM!Wa3&%=sDzKGq>oTfZILb=;L!VFK zVT+?XHRJ;pTunmZIn|Mo^?z&}lzb6bF!Q}uW?f}evO0L+-+5-(h`Q!8sNw#Gw7BY> ziDr~!bdz}irvw_jA6`Q$p*TTFThZ2T+97zu^#Id`cJX$CJ|^~B4R WUgXsD>!PCY1?P4>rr{Fmh{ z!_U!t>nl=$ECp>8<%}%!Z3CB_$TA@27T1Y(hj3)qa42*u- zf~heI^X!Z4x#z%;-i~IE(a1u!4pV^Unaj@0ebIJQO3F4<>1@S}GOdeR{xExV!?*yM zG0vX&>J3UP!dR7|TwE!c91bjhpTAIBxw&!?j#brfv|U>(+SCxEbZy7Ix9z9yC(CSe zod4tA8_V0#H{YXbJ#E7@h5e!$fJ01|zSlq1lUlw}!Xn!*yqG*(l?2E6 zYr=b($|}$_!5k>l)WLaW^atNQuw|y%N2ahB%$ERXSvxrkq4tycwuHLTCjjcuR488YPAfJ2bb$&3`Al0SBov4L+j$OT`rWTFpucnKx+1OVt%! zf;NhG=M2r6X&UP?Up>;S%IY0!lXJA!pjWa-WjNBNcqH59A18k4LXvXE`cQ?7He@ZC zzr*j2%PUHKeW%SrU742KO!Xn!4~{p#-ChT?VP4j@d}hT4krU)cIXykQjuohwf+c1$ NpuE^7F%7%p?i(z4ofiNA literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/divisibleBy.json b/bin/jsonschema/tests/draft3/divisibleBy.json new file mode 100644 index 0000000000000000000000000000000000000000..ef7cc14890213e90aa874421e96509bff612f9d1 GIT binary patch literal 1544 zcmcJN(Qd*Z6o&8n6of06Yz>_=CSL9}j2E<}NkrI3y`y{!X5_0PdkxS_#57*hbM5kxFD87Z_XLlrNEqjF1J8RP zF7$9{X{dRM>4KT>Fpp|6V}G#_$`L}vf4Ip0X*u1K6G*Je)jf4vPNJ|Lnyl!%5QfjmQ;dA(lCGeODi=Tkc~a#&;Km! z*I=KEd(()Os0$@JBV@~Vz_e((8UfqBfp1=mlDm~G8t9_JhTFXtM!W1_zsX>m!CQV! zwi(n$(_*lk9!xWO<^ZxqkVi1p2qE;q!J_ZMkW9HDkj=u9W4CKY^*A9&7|BmmB6^)E zA{#W7XitE(MzB1h9lS3bI}*JwEP0|Mw{E6LVV1kmh#1l48dYde$rH9Hd;MgrJ~CiO zDOm>lJah77Hj?zk3c0<$Duxy&s1PFIC3{T}+rF-EKrO^^x;w@%TxeEo^6-g;(ZCf# ziP%9Qo6b(k8_Dit<&K{vGo8b{XbXHn;Ro}K>YLIXIwd<)Mxai}SnLGBF#(u!hiu1& z%h~;_mAgMnoY>~!Ka<6feZHUU-JB9}w4^Nuu55zFEi||J%M^a~f)v|Pl3cyXFi7NK zzwJi{X{zM@E>`!-e~i&sX9K%?CqPaUx|xsH-;=x%T2r5ruAB4PW1p#M-Dh?Z|0AXk o-30S~Z%xI$rRPHaKU<$(P+kWuZ3#T~3%ESV7D{NW&2_&10mSOm0{{R3 literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/extends.json b/bin/jsonschema/tests/draft3/extends.json new file mode 100644 index 0000000000000000000000000000000000000000..909bce575ae30951cc01102776cb1252d5b4fbc1 GIT binary patch literal 2591 zcmcguO>=@U5WV{=m_2)Nbb9GuaXcWbni&!>39W6%|6Vqb#Kcr-#d6>)o9xTmw-45{ ztUJEUneL!ORY=xoRttE|08bi4sbKCSRB=F_cY}VGnc2v?L8%!k8iQ>v%~gLiNGma+ zagP$_8Av>~Ok&x+*0RO(*{^O^vPt6REC=>v*EA zs!^Wv1HgccUH~T2EAP)v)VHZ$$dUrF4;j&VBQkfiOWIq4L9qQ#z8>I@g0HE*lCpKB z9g|8Y1bvNp@PN@EColx(oeGOul%rq{?hsKM5k$LlY)%PuTkFFUoYWP2q*D#wnoKcH zenmYq>Mw&c!FbC%2`(3*e%-$c^&rnrL)dEJd;fytr?t-VC4?0ea>BN_|FK@(LXwbF JT*BFA_6?5ZM{WQB literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/items.json b/bin/jsonschema/tests/draft3/items.json new file mode 100644 index 0000000000000000000000000000000000000000..f5e18a13848f71f7f7056144d302bb178664982d GIT binary patch literal 1136 zcmb`G!EVDK42JJ{3d`s0(CxNYsd8Y6!;o624C_`^efMFg64Fdm>&78M$UOY!1OVi?4tReE&{+1=<|R!sr-GpuNX-K9UttJ=-L!ER3%)oDL*z#s<>F zc$p4g3ZFne_$b>>U&Ur=nv8EU9@Wkat5~9xg@X!8Tw&9~a|x+OQzMtlkoz)-}gB$OsilOieYmr8^^MA}_v~^4#tg}ywS)I!HO+C0a>Wrgv2yt9* zDvs(`&6--*rQP-L+_V*57E&H*RmR9a#@LdXG^sUp>r!SkePCmCL8f@*Dr8r*0UzbG lcg)m>#71oZiPSuV8W;bGYCTTM(!!?t=lp=_Ee%cAd;>}t{kQ-C literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/maxItems.json b/bin/jsonschema/tests/draft3/maxItems.json new file mode 100644 index 0000000000000000000000000000000000000000..3b53a6b371a7b6b45ed28dd8eb352703bd58bd0b GIT binary patch literal 706 zcmcIhOAf+72;KJ-WY%?|?!19#Xu80P?Ii7B1~eMu-JPkXA5$9>Ba6uZ58eZ^1cKe# zH~!3?r118rmYvyvY4EaDY6Q+$+da17v`0%(QG)?^>yW`&-3JgQQ3=7Us~R&#FWNh^ zRP2>J*cZ3ydp-+d32G$Imia`oRUESFPc-5lsEeKY;rqVhCC~*6g_>Nc)pvSQSp8R$ zGDFR-jB>1djykb}Zb3m%3hOyd2dw4CJ=xN+CjrN9f!^a)W{zeK%scc`h|ibn?wGf~ Hdy*#)`!JsH literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/maxLength.json b/bin/jsonschema/tests/draft3/maxLength.json new file mode 100644 index 0000000000000000000000000000000000000000..4de42bcaba047cb146b763a5d3c17d03d333532b GIT binary patch literal 895 zcmcIiO;5ux488YPL^*>5>;l{nJMPM9+aYSbHd1O=u?s`f{yRy7mKK!?3CO{6;*a?x&kh}?Zgu5N2ObH+yK_ns8{1`Wrp{woX%wftqGZ@oEmO-=TVLT3x~(; zrEH2BZ}EJ^=7zk0SC$jF&OK8>EHM(%^|&=pe(pP!0gk2=<&qLV z;zR#SNQjgptfM#<)1XW8&?29Mar{e#Y>niB6%t;vc#Ad9De$?k+nX7(f444qBgK8! zIcNdJ_;>Y!wxkNwU^=oWK{rkk0#aW$3vBhSU*E6R!9G7djQzQq@29wY!TsQ!i+%9{ D=I+>Z6$ZIKVvG59X`6(pV7_G<)3~csbq77E_hkS8 literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/minItems.json b/bin/jsonschema/tests/draft3/minItems.json new file mode 100644 index 0000000000000000000000000000000000000000..ed5118815ee933dabd490e6de54d103e59100f08 GIT binary patch literal 693 zcmcIh!485j488Le&CYnhqkrHx5Dp7eSTZ)VR-+;OyBjD2gT%zx!?L!oeXnhvfVXaV z!%tL5rBi2C)`$a$R+%GXOK_E1RdNWY5lv--t@OZdLV73bXAnkW^1*znS~3PN*gLbf zrbY+qNiAZ_5g#ff2ktyeVPCA|2hAS9?t%;UnZD30jvreu*MK)!GH5h4H{VJ6uO7A* zsIiWN7-hymS2pn4(3YB$)b!(eRBfz70%OfiIw$Y6aW1iz`+TbDaK-TJlOlNlX&{?K literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/minLength.json b/bin/jsonschema/tests/draft3/minLength.json new file mode 100644 index 0000000000000000000000000000000000000000..3f09158deef0a562dab603abda92e2a52806f357 GIT binary patch literal 886 zcmcIiu};J=4Bh(`R%RH01=tWbvN9bvM6EB4l-gD7BGBpnog{_p6;%}ykiklv7r*D{ zY%56XP-5Ph2BnU^SI=bb!E~OUkes&gYJ+cV$zM!xsax!9LLMe)I$a;nFp8p*lH1d> zIcGlQ^_@E~IgH?CEnL%2Pn*H%KcDm-!nw-52@=JrfBaSFQOqZh3lanRJ&w*VnDE+%(F(Js%_W?U3 zwecOE$=BQ6g?0(Oi+c2cQjVFB+m<9Wlr zB7R-tH|%H+rqg(`s3d(ORG>uR1Q{5|p2gdzlx(^q2gIcqW5HPCulI9V zju=j1mB_4B0}y)za^rwzq(M{nu{0Dj8+h#M*Og!-@1s^b$XG0RhE7R_)Hj!-1+LB| zDU>6?3i3qj9{jE z!22)VGXn(Ob1UVd(z10q)x|{VzdFxYoD@n+ Y{EK*OKK~wbn2ghk`Q~X%oO!Xj9ps3fC-L&^S_Fz0JqtnU!6X)C>Tzbvy(8YC<8 zO4rr}#SUeijAWYYgUy>fYDIEB6`WJS1XXF2N%{;z2MA-8zH-9 z_7)SRLms{N^W?eOmfDY4BYW#NXS7vqGV5aR8xV|`>>EKul?=2hfgAV>zkpDe?l>5FKDvvl=IvHR{en7HHsshy)aA zL>b3Rkf9u>91!`WyM>Ko%(Q#xf4^4H+c2*X95^nJ%G?E* z4T$!&=eR!fN6wAohUH`HtUYW&eZD$73A1-ic9LV8Z+gf!b@iQq%m}XyS?{cMN++sw zudE%cZnIhoTSua;kJfXqoSleEB{cB+hc;Nf6ZZMj^myJca?&eLa#5R+nx907EWEs2 zF*dwM`Q`h2^zXZG#rD;=qS)HTJqu??FwSNBGX3k1k6&i<`HE1?6PZ-o&{?SKn%9v@ z0}>t(2`l1cUn!|Ca=gN_=7_8~w0C8l(Gli(i5$ZyV<}GM>8Bp$s%EPWEUx#fgsEPwP%UKE zCp}&g%GA-s$_fG53g#${%WANw#ipq(_a_u@Buj1cXERH?)`It3@oj=m^4kPG3(u@? zGh9nA3|o2ZrKp%*8!S7~btKaD{9i_4XtSe*z$Xc=iL`5Ygl^mGg)N9!DiBHKNf{7I zaf~R4+(@bEBv zxs4W7nB)lx40)!9pZG6q|B;leM9?7|iIm*3NDAS~h$^Fk`e? z(_NR@Mj&Tdsmwcp9g*lqOZ|g3zdUA19y|@FH?-zu%<;tH1Wv&Uuo) z@T{DZJA;!v5kySGf&&To3@Iyk7G;~UjPOf(CrUO8feIxBeav>61Egi5!adwDF60io zi1Z^(X#Bfy6R*gs%1LRU;x@$k238UkySi-Kiv472Y+q3jLd>YZ(lTIzmkiL&{NGu} wyeNc%eNB%MW-R(X_ty}PY!_vr_JDg8)+_aHKLSM;O<$fvOIKG#I zXn|C1Y$X;BgENYZ<7X|aftW=CK&l+R;OpdGdIz#W|#3-xWC<6y(>aCW<@pu??;FC literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/patternProperties.json b/bin/jsonschema/tests/draft3/patternProperties.json new file mode 100644 index 0000000000000000000000000000000000000000..18586e5daba6021b4ad659ee3649a6940ec99ad6 GIT binary patch literal 3365 zcmchZ!EU245Qgu0ijj|1x@yQCcKZ~2tQ1Aj08Zi+*vK~Bv{BxD$A;RFkThv&IUs{= z_~!Tc_betr*WTY!|kwiR*% z2%2yBj!na7n8~)hME2PEX0o#2|;Za!KcB3mm*JL^D%F3?3mlLhzc5#~b7n(tk7x+P=6#QkJ4-ftqBz$h^kFj3sgp zx{>*#*j{Xke|bjRAnuEhl5N_~l7YVS%O8?=>050mF>Q}` zQ%F}MToWZ%HQC3BwV-Y{9NA0W!Tqd-;2ovQfPoAIjo1z@aYwMF%d>~*El#-j)LBFJ z{Z8ZjCi!BcaT~X@WHeSw^>k&Kbv<-R{d!@+QAgcZ+xL?>K4-2Yzglj(s3 z*h46(Ql$!xlEF}lJ+1nKjnz~e(b%BC_^wFD78R12+DP$A5|zA6xo)&;PPXpx5WS%- z!f0Ph^N-SY=GOUVG91@a|d~JK4ZwkpfDz2WcKpfC8EKOU`OqP@X;`}1W literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/properties.json b/bin/jsonschema/tests/draft3/properties.json new file mode 100644 index 0000000000000000000000000000000000000000..cd1644dcd91fe0428ef298776051c1d9284e4278 GIT binary patch literal 2881 zcmcgu!E(YN5WV{q43}Qg&QyEqAN1C{lLMMn=_sUt9j)WPcYzQ>l1bGza&Tf;cHh2T z-ex`_xK8fZKG6d7Qt{GoDd;Pqa`6F6LrNt}P=c*O|q0gN;`N~q8BISV;pD&M^+I&u-GQF}!7dR*zS~J)K+O9aRDAif#2D!M16>3GY0w`5hf_Awi1=6WC-12zCmnKsjEN zL54r~`-5%Ae2Cb;HvwM@i5*LX6p#KU55YnLlb%be+yztH=I*J=Bz9&hCAGEl8f76P zB{K$;c&{ZUBdjR6RT#F7Z;@*>W6QCWhbhI56kBM=4sQl_RxW0J^jrMWjPIn};rnnLPX636YbPRfrT@+pocD9$gIcnW>Rp{#uVwHm*Z_Z=BVv_X-mD9xngEw)9=fpU6haDeB!dXve0t zbA=IYrOX$>^old~u;@V<>+h!9(C|3XYNqvSX82aN3HJJB4KMJZNU6UORlz<>!7I3bCTmW0#q>5ym$w&s&TI4Q zA2je?9VeqJFx1!~c38t6kohR)-U;GaP;#()O77j~;lvb;(cA)4bnEDT~KvO_Z7SpwcAlIth|1EOc=y;-J>Zoov}e;bfiQ`7)qN$a^ zWOaA{5X%ms0)6{x>~Xu`1O$V|=B577F$cZTn&)9}qLD>F-?6>Nf_!4 zjBXCtD0nD{Pn|6clid;u7oTw+U`o-L35{pV`lmhJKs7B(sYTU7hwNQqEjz2%k7P5O zm#1E0(<^s%(D9rSdgP_z{fUmA<^sgD6LqSNzE7x47iRHDRC~{}dUO-Y{Yk+j@b6D) z@C(X+pVSe|1qhtiqN~VMjcPXJw9Mpc4S`4S!C}2Hy~Nh>X3aLpcd-a9dF)^t^ffK+ zjww}BfQ~15F5r;so5}_6+huR)BetD?J4Xw-8WpZG^#8NiMQOUqvS0Q5W2WV1N>gk8 MUviyb|4|lw0E0NqO#lD@ literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/required.json b/bin/jsonschema/tests/draft3/required.json new file mode 100644 index 0000000000000000000000000000000000000000..aaaf0242737fc0e2e0acdb89ebe2a8e3a634f34e GIT binary patch literal 1282 zcmcJO&u+sY494$y3dFfP?3!1pdZ3A;Sz^F|OpB(zdohV(l5R|@77h`A9Q*fum~$i2 z_|9LN$sR)I(M7aIwnBRN7|}y7K9$B^Ri0vRYgO9iRq>0A5F%APZ(_G>IpI#0zvjv@ze{Gr` z1~uwoPD|>j4hhsI*CO{tqY2>#6zQU`%ha6Uru9(QBNY@)G^-j!))g= aY%dApRiXNS%*KIVVS0R7<8ih(m*x)ai7%u8 literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/type.json b/bin/jsonschema/tests/draft3/type.json new file mode 100644 index 0000000000000000000000000000000000000000..8f108899744d753fa88eac5fcab1af18d78f4077 GIT binary patch literal 13225 zcmeI3%Wk7E6o&VG3d`$iq|WT-RiZ3N;xvp1L_nsBs=oX9_-=4~OlzDjCX1>y2L7DO z=i^H^PlSKo#ZUN+9@wz&>&sYoE&WYs-Hz;)^<=zV7&%wt{=^2N8VCAp?;H4)bH#6Y zr_k5Amwq_iMmCHCzqm1X`tOIo;4{@xwfe239*F(Rksxn`TdNU-yx7;8OMk1TKJaT} ze`THmMW7P~_7B!50-M%hTMUPzm`6WZ%}H${_d!^k9itpO&Y9v%4RrLj~cXo&(T2P7vv!X-U~M!2lvEW#y~ zClRixFo$qK>r+TYxK|*_HjF~DR~8Dr7&H_0)XxDZ%K+vVMhSwV6v`q=ISEQfTn~nz z3|ySmL%6E)1VSU}0R%!dl_n4>Xng{y(%K`CY{Lj7du1Vzost<8=^zhHE)t5NEQ#;4 zC`D087^#_~a>IROV?@efDs3BZA9p6IDaxZPh@4K&P)X%^lwhaAKuS=wK9Qv7JRpfC zj7Or=dN`7gzn^BSug*+qgbI29j4(~5S)>?=$%^7A4~aP5WH`+=ccDw~aCqy3mL* zXAM!aG0J`)>9;6#)=-2^IHKHHLy(?B_z?hh(g#)Gt%0leGv4p~nP5U-xH^N**Ji9Q z4HF<5$eu4a?id*^Y+oO1cHmJDYmif42B@^rCzR+jp(;hT&bbkq=fIKlg>QG)g|U^R z3_+!KhhX%;loX(VJ^56(n4Fg=Co_zyW~myCgX@X%D32TwwP|XiFv_7u&%Dy)ARx*h zNY_BPqYwlIv@ETIpazoYQDZET^DDOuafo9cFY+F4o*iQpSEkT{M)=rsk!sNV@SZ5o zJVD3&^unzj<5$4cJ_r*AAO~Q$7z|-q1ev9HTu)hsVML7*EW=o%hTW90CW@~NQvTD+ zrq<-}qsI>Vc4Dn6rObSRA9N8%vPnIX;nZE513B`k-d%~9X$%Yy zCSPPApl6F^ad7OrGa1;W>LFiLdBCS7{9hqh|H=-I*yVX+3W7~&;-bHl(@Rwrgo-@a zmJ9HNA<_aw3pWuH@P^-ePJjvQs6Mo3LfkRDd7nB`gjEk&0@&2}Snh9Lp2^Q=@@wmV QWe{x)G*>i@)~D^$KgNiy^Z)<= literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft3/uniqueItems.json b/bin/jsonschema/tests/draft3/uniqueItems.json new file mode 100644 index 0000000000000000000000000000000000000000..c1f4ab99c9a485d4d8a9d9f97b4945899cbcd4b5 GIT binary patch literal 2613 zcmcJQ&2oY;5XbL6#ZJ!DkskX7eFla@ghkWApb$EvOy0f8f)a#AT7?5c$k%WG`xULg zJPp0=7fZ29N^w-8kn96kEybzEPlbmHzIiTEPBTHjp-T36;AU;(E;eIT)~KC@3M*Ba z|Iuyl@M=4<&olz?vgBtdG7wVX4$BHehs63z+7s*5m>NBn$c0sx*x#WP8^HgaaA+ATyp<_#|b0*jmkaiO|uC3=Ujb=P8l!JU^QWJk>n+ z>bc$o5Uw}&y)g22%d)cK)TTH>R;9)!u^t8UFH*MfheNtJui17@^~CTM3EBvNSASE4?Dw+4z8^+ zUfdT58v>UprHoU{y%js4)yt~5Au2L&CYEU+w0v2vu9)pnVOi`@Vo_J1&PQxJ;loPS pnBEbYMn@6`AnQDT(D+^&k-u@z2+K)w`}41D`&Kz(`qHa-^#cl+aQ^@R literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/additionalItems.json b/bin/jsonschema/tests/draft4/additionalItems.json new file mode 100644 index 0000000000000000000000000000000000000000..521745c8d6ed50c5fe078269f9f93be333b5f805 GIT binary patch literal 2282 zcmcIl%Z}q95WMFrTAV$H-PyU!AM7`bd|={sjD*30&WtQ8|GqpNgNZUp94%53979uG zU0rO(<`x$G{?u{5oXvN-v@um@e&gEai-U7E^_Z{|}RcX)s&wCap#1ejsi}Ep@ z>a;w(D&o3D6QglJf2L4`2Q=)ooN!9J8KI>Rbb0ForVRX(AJ;R1fD3v~`|dKExZCgN z#65UWM=2}#UBPPwf1t=D9QDPeXxv&dM_j?mfcu3TP&OKrrfpzZt2O%(aLc7F5HI-a zFq<<-$V*-$nc}RA%E5)Qx>@;dX=N%XD;4NiUW3loZ`X#DkBZ{gqKFFKe&qO46pvEO zjo~BccEBDAN0|A}z~&N2_w(i5 oTW7d8`>IxQ1nLl4VQiG+Qd@qbk6d{Jk5$xkVN(y%xT|;n0MW22bN~PV literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/additionalProperties.json b/bin/jsonschema/tests/draft4/additionalProperties.json new file mode 100644 index 0000000000000000000000000000000000000000..eb334c985cec4c1493c0e5bf3995b73dc46f24d9 GIT binary patch literal 2194 zcmd^A!E(YN5WV{qJA1YV+nZm}yJKgFSq+^CDG;sG@!!irBqU9(Q+q21XAKLyeZ04< zX5hz1_~i&ovKu2CC$++5`W&W2SxWvc>Sv=HGES0(f~4BPR@9cD)c%9g4n$q+BWPEV zfhOhRJne^eQ_)`FGCMk)k!AZi+-l7^=Q&^@ObE~YE^&o$j*RLdaTegqA!NfieX0nb z845`7vPI~~I_oo5X_k-e8RLIEhRgvf4gFae3m`2VL@mpVj<^HwAzUD(D}0dwNjY)x z5}avifN7NcGen^#Af6bYRJTEdB`mtT@!_Kn-`e&aeT;?HdmKRuJYDb)Dd(wC_Rj^# zozf;~PCe-2l{WsShVlp}cC4;ER1fiKJ&|$&bw8=iSdSnKMOP&MWOBHIx062;d@#(W zXLv->fY7hllRVZT>K6CB4mF#y!>+w}duv5wTM!Wa3&%=sDzKGq>oTfZILb=;L!VFK zVT+?XHRJ;pTunmZIn|Mo^?z&}lzb6bF!Q}uW?f}evO0L+-+5-(h`Q!8sNw#Gw7BY> ziDr~!bdz}irvw_jA6`Q$p*TTFThZ2T+97zu^#Id`cJX$CJ|^~B4R WUgXsD>Fa3xmw4AbQ^t#G$OLoQ-KjY{cR^LiTxyW)R z6lZd09BM_Qomu{l*?_57eMG@wEn%cW3-Tu3zvs%q-dEG+=& zEVA@SG;xNs09S@g0pU~>7kDyZrl?g5)~jtfoxMfQTt(zSB_p-ASgdeQZMx!dUn6<} zIAp*&)9p~n80qr_=WHDK){MzI_Ge=_d>xLv8_SFdOw)P}1B?FdqA?wTP$STtHNe_G*U@|0vOdIYHu2K&YJE1TJY*_*!FgdA^^_hZ48Bj7ySaS_NyPf?TPCE literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/anyOf.json b/bin/jsonschema/tests/draft4/anyOf.json new file mode 100644 index 0000000000000000000000000000000000000000..a58714afd89277abdb180d592a3a38a1465de731 GIT binary patch literal 1608 zcmcIk%Wi`(5WMphmd{nCr0s=osMHULaxk!frPxIFrfpQ^-)m#A!92nt@d4pwcRik+ z;gArs{@SN~qXp<(@iX#9(v(mpuU{p73Ey>IgJ9-UsA=n5VoDA^)rRdFC%Tw92(M?b zCvb^SfufVTTR62ZT4*J>L3fIvQJd;9_UU0UIVD#bNqckh%}%@+ z5YNk{_81<}QV*;j^ qk0;wm*eEhuHciGQW3q_W;LOnD=h_KBIVS(8X--)H literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/definitions.json b/bin/jsonschema/tests/draft4/definitions.json new file mode 100644 index 0000000000000000000000000000000000000000..cf935a321532a6bd7e801437f765bd9ce88a390b GIT binary patch literal 854 zcmd5(%MOAt5WMphqN%+97k*saFx z_KPquxfV4FB}o#J2dxAP8E_$m!w$aGw4030e51k@34^Z^vvM{+1q>1L&!fK*4o_9$949Jj_KQTjeZ*w Lr|dmuj-@XgWcf~HU?B}Ky+YfEBztMTp4g3H+BWrKJtn#(VY?vL>?345db)b zM&CDQY6yk7{49G;92lgxL$kwZWIkW}F@UC-%g@Vwp>3&@lvo$k_X_Z&l~ZBr>)R}i9fE$7~w=F^kT z<@i5yZzykvmVA$@^_Yfn3e%$M0f#VM`dGPa+42)>kU$b+o43;LJTg4ZCFjz>BwM0U2i z4n*y1KubcIf;G1G9tyPkT<7Z9bAnNC38P1QK>Sa5>-Z$sjwZG%g!r~T{b2HFRbo6; z=P-qADy#@~Lg8<4zTw5!J*|ke;q3&+nZTqx-l~12k+OisiFglnVh7*BmKgyWm<(DG cfAQch2k*8BwfKwxn1t{ul%88|sF^G#Uq-RO!2kdN literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/enum.json b/bin/jsonschema/tests/draft4/enum.json new file mode 100644 index 0000000000000000000000000000000000000000..f124436a7d9040e44bb08f930f2e56945acd8027 GIT binary patch literal 1975 zcmc(g$!>!%5QfjmQ;dA(lCGeODi=wAdF|mpZ{61 zUxWQ!+>_o|iMmjtGeWj(2TY5ms}Zp68~En6D7o9oqJu6fY`C?(FtV~Q`%MPh4Bql< zVrEbqO`E}UdN8f%HwTa{f;@t$MhKw?4i;k%j^xS>fovAG9J}2!s>caI!bowV5;5vb z5!s-rM0*0PHG<_4?GSz8*pcXcVapR8xeYT#3ai|`jffF#u2F>sl{{gKve!@M>LUYo zl#*qz&od`aW;01&tdQI5t8!>zf(juMUb5FDvF+>n2Gl|xr`9ol;X<=!lZQ_%j0Ua{ zO2iHd*>rYM-Y9mTD|h^?nCTqmMO)wt3O`t9)ZbL@&?(uWG6Ho%#^NLhfeFBzJ7haH zT+Z6BR_^{R31Wwb|4bf3_4#?ScWWxd(UVLLT-gGRCbZ74-XhvEgk7h2)jR`r7NI%sLT;jw>%%ad%Oo5nU>=j$K5Ow}*| literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/items.json b/bin/jsonschema/tests/draft4/items.json new file mode 100644 index 0000000000000000000000000000000000000000..f5e18a13848f71f7f7056144d302bb178664982d GIT binary patch literal 1136 zcmb`G!EVDK42JJ{3d`s0(CxNYsd8Y6!;o624C_`^efMFg64Fdm>&78M$UOY!1OVi?4tReE&{+1=<|R!sr-GpuNX-K9UttJ=-L!ER3%)oDL*z#s<>F zc$p4g3ZFne_$b>>U&Ur=nv8EU9@Wkat5~9xg@X!8Tw&9~a|x+OQzMtlkoz)-}gB$OsilOieYmr8^^MA}_v~^4#tg}ywS)I!HO+C0a>Wrgv2yt9* zDvs(`&6--*rQP-L+_V*57E&H*RmR9a#@LdXG^sUp>r!SkePCmCL8f@*Dr8r*0UzbG lcg)m>#71oZiPSuV8W;bGYCTTM(!!?t=lp=_Ee%cAd;>}t{kQ-C literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/maxItems.json b/bin/jsonschema/tests/draft4/maxItems.json new file mode 100644 index 0000000000000000000000000000000000000000..3b53a6b371a7b6b45ed28dd8eb352703bd58bd0b GIT binary patch literal 706 zcmcIhOAf+72;KJ-WY%?|?!19#Xu80P?Ii7B1~eMu-JPkXA5$9>Ba6uZ58eZ^1cKe# zH~!3?r118rmYvyvY4EaDY6Q+$+da17v`0%(QG)?^>yW`&-3JgQQ3=7Us~R&#FWNh^ zRP2>J*cZ3ydp-+d32G$Imia`oRUESFPc-5lsEeKY;rqVhCC~*6g_>Nc)pvSQSp8R$ zGDFR-jB>1djykb}Zb3m%3hOyd2dw4CJ=xN+CjrN9f!^a)W{zeK%scc`h|ibn?wGf~ Hdy*#)`!JsH literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/maxLength.json b/bin/jsonschema/tests/draft4/maxLength.json new file mode 100644 index 0000000000000000000000000000000000000000..4de42bcaba047cb146b763a5d3c17d03d333532b GIT binary patch literal 895 zcmcIiO;5ux488YPL^*>5>;l{nJMPM9+aYSbHd1O=u?s`f{yRy7mKK!?3CO{6;*a?x&kh}?Zgu5N2ObH+yK_ns8{1`Wrp{woX%wftqGZ@oEmO-=TVLT3x~(; zrEH2BZ}EJ^=7zk0SC$jF&OK8>EHM(%^|&=pe(pP!0gk2=<&qLV z;zR#SNQjgptfM#<)1XW8&?29Mar{e#Y>niB6%t;vc#Ad9De$?k+nX7(f444qBgK8! zIcNdJ_;>Y!wxkNwU^=oWK{rkk0#aW$3vBhSU*E6R!9G7djQzQq@29wY!TsQ!i+%9{ D=}JE8y8r|7Sl2YMq_MxcL%DpMNKryqM5?~%*!9vnc&rg zudn0|TyFJ|G#a@SvR0Rs#UohK;KW%~dZ)tKq_?=dgj%t>8OwQR-VSsGjvQ~UqjlWd z|M`_NxDqXa75WY!`#U>>wkbdiMPVdVpKuPXOrl)5lz`Dqz6Q`{aP b=O^->RPuOzfG-perswI#S#LtsW}EB=3d^sB literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/maximum.json b/bin/jsonschema/tests/draft4/maximum.json new file mode 100644 index 0000000000000000000000000000000000000000..86c7b89c9a9047347e408cbbaaf194b3995f9db0 GIT binary patch literal 1063 zcmb`GOK!s;5Qg_Y1!CP=QKELyJM;um7TBINNIW7QuB)hb58wxelFCxc!otij^ZB3O z#|pW13s1kp9q3lktD#chH-tGED7PH-gwc+K)2EoM+Y4~w@@{jY+aK!P_bSJLHrgE@ zmuqQ9|K?ZTxdA3Wk+}ex8K@pHaI8LF^_Pk99Q*pU5Df4xYLtb9V#VnzMHynI+>Z6$ZIKVvG59X`6(pV7_G<)3~csbq77E_hkS8 literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/minItems.json b/bin/jsonschema/tests/draft4/minItems.json new file mode 100644 index 0000000000000000000000000000000000000000..ed5118815ee933dabd490e6de54d103e59100f08 GIT binary patch literal 693 zcmcIh!485j488Le&CYnhqkrHx5Dp7eSTZ)VR-+;OyBjD2gT%zx!?L!oeXnhvfVXaV z!%tL5rBi2C)`$a$R+%GXOK_E1RdNWY5lv--t@OZdLV73bXAnkW^1*znS~3PN*gLbf zrbY+qNiAZ_5g#ff2ktyeVPCA|2hAS9?t%;UnZD30jvreu*MK)!GH5h4H{VJ6uO7A* zsIiWN7-hymS2pn4(3YB$)b!(eRBfz70%OfiIw$Y6aW1iz`+TbDaK-TJlOlNlX&{?K literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/minLength.json b/bin/jsonschema/tests/draft4/minLength.json new file mode 100644 index 0000000000000000000000000000000000000000..3f09158deef0a562dab603abda92e2a52806f357 GIT binary patch literal 886 zcmcIiu};J=4Bh(`R%RH01=tWbvN9bvM6EB4l-gD7BGBpnog{_p6;%}ykiklv7r*D{ zY%56XP-5Ph2BnU^SI=bb!E~OUkes&gYJ+cV$zM!xsax!9LLMe)I$a;nFp8p*lH1d> zIcGlQ^_@E~IgH?CEnL%2Pn*H%KcDm-!nw-52@=JrfBaSFQOqZh3lanRJ&w*VnDE+%(F(Js%_W?U3 zwecOE$=BQx)t+i_2^yYYaoDvMGB-Lk~^?gLy<$uwCu4yMw-?Z*#U!t5IS z*G2parqr@0iHe^Y@1(kD>_L+R!yclQSK)K%Tw=-wI$_nrT5fla<3dMZ$k@#+l&)vH zKeu9r7F7+J$@hFdx198@LeKU_2>V?B1C2y)a00?ni}uewntNm*8J#_tQBhed=#n!7B?vEGuWo#pK{yY MgbU1lG$wiS0_nY`NdN!< literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/minimum.json b/bin/jsonschema/tests/draft4/minimum.json new file mode 100644 index 0000000000000000000000000000000000000000..d5bf000bcc66f8d9c90a47ee087f239c1fdcf6a9 GIT binary patch literal 1063 zcmb_bOK!s;6x{n1h;?h#S#;4m^aN2B*nVxE#3$n8q>6g?0(Oi+c2cQjVFB+m<9Wlr zB7R-tH|%H+rqg(`s3d(ORG>uR1Q{5|p2gdzlx(^q2gIcqW5HPCulI9V zju=j1mB_4B0}y)za^rwzq(M{nu{0Dj8+h#M*Og!-@1s^b$XG0RhE7R_)Hj!-1+LB| zDU>6?3i3qj9{jE z!22)VGXn(Ob1UVd(z10q)x|{VzdFxYoD@n+ Y{EK*OKK~wbn2ghk`Q~X%1PS8*0j&H{#$WmjC`#B%- z#xnloS1#wY;7l@v`e0(cFm9sKaQ8(7U%N}IJ310guzYYVbx6%hjtsyE7fJ0gBY?~b z9E=F_D9A=CO$|sTUuD-WsWt@|#FV;peZ4V5n-=}q0 zUPF9St$-W&wHhb}MDFdD%T0ojPv*G}d9SBAlPkA?;}Qy1dEBy-o<}M>>Qk9%QbM}m z-aFi4S|Y?BJk!)o)8PNGjelu&Hl*-=VNN0KsiO)K*!w4+*Nu3%z<0ykszr4IX}(Zw literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/not.json b/bin/jsonschema/tests/draft4/not.json new file mode 100644 index 0000000000000000000000000000000000000000..cbb7f46bf8bc5b4890bcae5e27c27599ef1922d2 GIT binary patch literal 2266 zcmcgtO>=@U5WVv&GC6y(NB@e$A;7BX1i~b-t#$nG%?9!T;>4Bo45PkF580G zb#_mDqYda<@!oLR(G8)UG;|fMx;{Y5tRbFor_jxAQgiA7kMYjH9u&QVqn9L#0d2H( z+XgEJnTB*>XJD8R@)Mc_5PIRF4KoOf?xb8Ye=xxtYd7i$lS>m=7$=XR;W`gv9h1eV zxTuG)V?xg`1Vp8K8!<&J3#5?tC=Blf5G=V)a;A53v<)P!2(6?Pz&cvKmark`g<||0 zT`kuwGxZ@U(7;F3%rD8BW)n$@VW%A=%>fj-0|#nz8vIXmBNdQZwpKb{WRyz0H7A~+ z)R3+3cv-zeoz9Bj(JR@5GTf?kJ~x67w(TvWtAf8q8^yaly~2S`QM*3wY$tvuZBHMa zM$hQ#`8hPoDx>YQ8;BdSP7?OT2@~mgFn6fiBcTN^dk2|R<-ZapWQG2JP z{clP%YcnZzydX}j?mD)j(S7T6x!NC6_4^rI?wFBoI|ud603kQwIln0e2K zgxK}n?Cy&eU~OckKu+*Ma4>+7sLehWSz_1B4*II}^=Lb|cAX bsZ_@FXoL>#4SxrJP@u!J24(~8lVkD&r9e%Q literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/optional/bignum.json b/bin/jsonschema/tests/draft4/optional/bignum.json new file mode 100644 index 0000000000000000000000000000000000000000..cd479949cb725c18933dfdb4e210a8a6c9d56b50 GIT binary patch literal 1663 zcmc&!ZEwOL5dQA3ApN{7+(8BQANC83AF!g5*_RZmF2?^ps7+fnnoO!Xj9ps3fC-L&^S_Fz0JqtnU!6X)C>Tzbvy(8YC<8 zO4rr}#SUeijAWYYgUy>fYDIEB6`WJS1XXF2N%{;z2MA-8zH-9 z_7)SRLms{N^W?eOmfDY4BYW#NXS7vqGV5aR8xV|`>>EKul?=2hfgQ`WFleI@PV;GBv~W%4X_Z%I}AmVVvq}-&?quRy6zlMCIBKtMSO8}4rZQZ1H|#(`8trw*N$bo(4AV> zmhG1>-Q>!{8tU5N_vPKQ%NtjB^Pya-&d%?biGYpQ#2bx1rQ zVpc@)b9t*DI1Vw#G|+NX-bJfmAm(uyhGB{l0?>NRah~IsvrTS@2^lrt+6X%9E9d-V z*jy17MfoSZLup2^8L(6*@hVC8@1V}ybNa9}*>+qQ7Z(FUm}HyNQ6t!B*BM zwady10a*w+qEXqPidI!N3q79(oT=>o&0A+y<=R)_mAK$^h+p575apmewFn$xuG3s) zr?oo^Ej5Nl{Mf?Xc*9E98@Y5F{eAB7{a(L}(%csp4a>f42bO~ExTjO!*V!?433N$^ zZZN*xcfGL%0iyyXR6hQIgb*Ad0s?tpLV>`%cc1iqf-=FffxO3+Ow4itC`wz~qM?0O zQ&ZKR@Mj&Tdsmwcp9g*lqOZ|g3zdUA19y|@FH?-zu%<;tH1Wv&Uuo) z@T{DZJA;!v5kySGf&&To3@Iyk7G;~UjPOf(CrUO8feIxBeav>61Egi5!adwDF60io zi1Z^(X#Bfy6R*gs%1LRU;x@$k238UkySi-Kiv472Y+q3jLd>YZ(lTIzmkiL&{NGu} wyeNc%eNB%MW-R(X_ty}PY!_vr_JDg8)+_aHKLSM;O<$fvOIKG#I zXn|C1Y$X;BgENYZ<7X|aftW=CK&l+R;OpdGdIz#W|#3-xWC<6y(>aCW<@pu??;FC literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/patternProperties.json b/bin/jsonschema/tests/draft4/patternProperties.json new file mode 100644 index 0000000000000000000000000000000000000000..18586e5daba6021b4ad659ee3649a6940ec99ad6 GIT binary patch literal 3365 zcmchZ!EU245Qgu0ijj|1x@yQCcKZ~2tQ1Aj08Zi+*vK~Bv{BxD$A;RFkThv&IUs{= z_~!Tc_betr*WTY!|kwiR*% z2%2yBj!na7n8~)hME2PEX0o#2|;Za!KcB3mm*JL^D%F3?3mlLhzc5#~b7n(tk7x+P=6#QkJ4-ftqBz$h^kFj3sgp zx{>*#*j{Xke|bjRAnuEhl5N_~l7YVS%O8?=>050mF>Q}` zQ%F}MToWZ%HQC3BwV-Y{9NA0W!Tqd-;2ovQfPoAIjo1z@aYwMF%d>~*El#-j)LBFJ z{Z8ZjCi!BcaT~X@WHeSw^>k&Kbv<-R{d!@+QAgcZ+xL?>K4-2Yzglj(s3 z*h46(Ql$!xlEF}lJ+1nKjnz~e(b%BC_^wFD78R12+DP$A5|zA6xo)&;PPXpx5WS%- z!f0Ph^N-SY=GOUVG91@a|d~JK4ZwkpfDz2WcKpfC8EKOU`OqP@X;`}1W literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/properties.json b/bin/jsonschema/tests/draft4/properties.json new file mode 100644 index 0000000000000000000000000000000000000000..cd1644dcd91fe0428ef298776051c1d9284e4278 GIT binary patch literal 2881 zcmcgu!E(YN5WV{q43}Qg&QyEqAN1C{lLMMn=_sUt9j)WPcYzQ>l1bGza&Tf;cHh2T z-ex`_xK8fZKG6d7Qt{GoDd;Pqa`6F6LrNt}P=c*O|q0gN;`N~q8BISV;pD&M^+I&u-GQF}!7dR*zS~J)K+O9aRDAif#2D!M16>3GY0w`5hf_Awi1=6WC-12zCmnKsjEN zL54r~`-5%Ae2Cb;HvwM@i5*LX6p#KU55YnLlb%be+yztH=I*J=Bz9&hCAGEl8f76P zB{K$;c&{ZUBdjR6RT#F7Z;@*>W6QCWhbhI56kBM=4sQl_RxW0J^jrMWjPIn};rnnLPX636YbPRfrT@+pocD9$gIcnW>Rp{#uVwHm*Z_Z=BVv_X-mD9xngEw)9=fpU6haDeB!dXve0t zbA=IYrOX$>^old~u;@V<>+h!9(C|3XYNqvSX82a~nO#@Q)T;=Snn2$eKPAs-!fek)k$S5yiK37DaWw=M}S3QQetnlx(;% zg6p$0cfOSp4(L~~XMKF3@4+Ytyhk5So)v`vJgoeUEpJ(=c~C@3)NpOU_bQx%oi0je zxfg83Ouk1Ef($&gV8+EsJ#^<8IrLIi?v<6Iu#Sy7L}YN<6P|{mcz#e?ymFEX>evC- za|jsjh^`WP8rFs>n~KR?b<22bvQmJx{KEjp@-=`k5NqxJowQ?F&)SHW%s@3!D-k1! z+`RDIAj;8Oo65X39GVI`cE=SR3d{$N8Ze73n?ZJZ{TQM}#y+vhJiH&s8L$GL|3hKu z<}omz$PcCzdrP5*FuXb+d62UsO`rtkf-{vZdL-~f2ZJaTw~>JKqXX;kwDWegoRP&(h`Xg`V@; zeESOxd{@WG=n4!qc8DF;um@y5iiLNAcovi#?4FW)_p!XJbi&?KYa@DmI%$R}2j1cY zL@=(VyN5kMbfiQ`7)qN$a^ zWOaA{5X%ms0)6{x>~Xu`1O$V|=B577F$cZTn&)9}qLD>F-?6>Nf_!4 zjBXCtD0nD{Pn|6clid;u7oTw+U`o-L35{pV`lmhJKs7B(sYTU7hwNQqEjz2%k7P5O zm#1E0(<^s%(D9rSdgP_z{fUmA<^sgD6LqSNzE7x47iRHDRC~{}dUO-Y{Yk+j@b6D) z@C(X+pVSe|1qhtiqN~VMjcPXJw9Mpc4S`4S!C}2Hy~Nh>X3aLpcd-a9dF)^t^ffK+ zjww}BfQ~15F5r;so5}_6+huR)BetD?J4Xw-8WpZG^#8NiMQOUqvS0Q5W2WV1N>gk8 MUviyb|4|lw0E0NqO#lD@ literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/required.json b/bin/jsonschema/tests/draft4/required.json new file mode 100644 index 0000000000000000000000000000000000000000..612f73f3472bc0a5c42e4012aa3b3669a8d31ed6 GIT binary patch literal 923 zcmcJN!3u*g42JJMMd^7v?CPtChpLekT~4y;3himKS`$cmYC>(PJ(fKupH@Xc9ygkgH2Ege06<8-;q;0$;J+P rF%9ld$3$4@^g>^evp*k%($O(AGusx)T|qP!c`!16pJ+Eri@JCLh4R*+ literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/type.json b/bin/jsonschema/tests/draft4/type.json new file mode 100644 index 0000000000000000000000000000000000000000..257f05129279faf53d2fba1f5db9651c17f0bd64 GIT binary patch literal 9306 zcmd6t&5r6I6oB_W1z|n8iQD@s#sw(9*StWlAB~>fx_eE6n+%!{Rbg@doRg>oM$&bsz^#~dT znu4aKVr|Rri=wsL&vdI4p(2N-sW|lT1w9M;b6&3cR#l6TpujSuen9TKPqy`kp%^-$ zzFiKXnoJsICX*|Nn24=<;>k;EiAAu?3Mqvo10Uf?tJny~D()g2sl17BrotY=f%03( z_Hb{4WYRDTnOsRMwC&YQY_0z%pd>$F{=_H(Xx2hWkZdEt)Dh>w6qLY=PxB$1s=R^F zp0t92P^QubLV@xd$WE<21DQ0;Kqglb0}V^EUPZ2xPc1GYCPPUEzVD(KqLMPQD@WT5 zua%7%DMhGUY@qpcW1>v6K1!mXI-Yb(!+%$W;G& zm}TFc32lS|tsoxp5 zM9fDvTP`EH2K+q}q!^;&PKtn9MM@D|#jO;Zl)jrtTc{Ss2t m7|u4k6y0V61PA9SX&{`YsDN;sa{j?t5Cu)RFm%vnzxf74Dm@?o literal 0 HcmV?d00001 diff --git a/bin/jsonschema/tests/draft4/uniqueItems.json b/bin/jsonschema/tests/draft4/uniqueItems.json new file mode 100644 index 0000000000000000000000000000000000000000..c1f4ab99c9a485d4d8a9d9f97b4945899cbcd4b5 GIT binary patch literal 2613 zcmcJQ&2oY;5XbL6#ZJ!DkskX7eFla@ghkWApb$EvOy0f8f)a#AT7?5c$k%WG`xULg zJPp0=7fZ29N^w-8kn96kEybzEPlbmHzIiTEPBTHjp-T36;AU;(E;eIT)~KC@3M*Ba z|Iuyl@M=4<&olz?vgBtdG7wVX4$BHehs63z+7s*5m>NBn$c0sx*x#WP8^HgaaA+ATyp<_#|b0*jmkaiO|uC3=Ujb=P8l!JU^QWJk>n+ z>bc$o5Uw}&y)g22%d)cK)TTH>R;9)!u^t8UFH*MfheNtJui17@^~CTM3EBvNSASE4?Dw+4z8^+ zUfdT58v>UprHoU{y%js4)yt~5Au2L&CYEU+w0v2vu9)pnVOi`@Vo_J1&PQxJ;loPS pnBEbYMn@6`AnQDT(D+^&k-u@z2+K)w`}41D`&Kz(`qHa-^#cl+aQ^@R literal 0 HcmV?d00001 diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 0ea213c..e4731f2 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -18,7 +18,7 @@ #include "document.h" #include // HUGE_VAL, fmod -#if !defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && __cplusplus >=201103L +#if !defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) #define RAPIDJSON_SCHEMA_USE_STDREGEX 1 #endif @@ -1225,6 +1225,18 @@ inline BaseSchema* CreateSchema(const ValueType& value, const ValueTyp else return 0; } +template +inline BaseSchema* CreateSchema(const ValueType& value, SchemaType type) { + if (type == kNullSchemaType ) return new NullSchema(value); + else if (type == kBooleanSchemaType) return new BooleanSchema(value); + else if (type == kObjectSchemaType ) return new ObjectSchema(value); + else if (type == kArraySchemaType ) return new ArraySchema(value); + else if (type == kStringSchemaType ) return new StringSchema(value); + else if (type == kIntegerSchemaType) return new IntegerSchema(value); + else if (type == kNumberSchemaType ) return new NumberSchema(value); + else return 0; +} + template inline BaseSchema* CreateSchema(const ValueType& value) { if (!value.IsObject()) @@ -1232,9 +1244,44 @@ inline BaseSchema* CreateSchema(const ValueType& value) { typename ValueType::ConstMemberIterator typeItr = value.FindMember("type"); - if (typeItr == value.MemberEnd()) return new TypelessSchema(value); - else if (typeItr->value.IsArray()) return new MultiTypeSchema(value, typeItr->value); - else return CreateSchema(value, typeItr->value); + if (typeItr == value.MemberEnd()) { + // Detect type with existing properties + struct PropertyMap { + const char* name; + SchemaType type; + }; + static const PropertyMap kPropertyMap[] = { + { "additional", kArraySchemaType }, + { "additionalProperties", kObjectSchemaType }, + { "dependencies", kObjectSchemaType }, + { "exclusiveMinimum", kNumberSchemaType }, + { "exclusiveMaximum", kNumberSchemaType }, + { "items", kArraySchemaType }, + { "minimum", kNumberSchemaType }, + { "minItems", kArraySchemaType }, + { "minLength", kStringSchemaType }, + { "minProperties", kObjectSchemaType }, + { "maximum", kNumberSchemaType }, + { "maxItems", kArraySchemaType }, + { "maxLength", kStringSchemaType }, + { "maxProperties", kObjectSchemaType }, + { "multipleOf", kNumberSchemaType }, + { "pattern", kStringSchemaType }, + { "patternProperties", kObjectSchemaType }, + { "properties", kObjectSchemaType }, + { "required", kObjectSchemaType }, + }; + + for (size_t i = 0; i < sizeof(kPropertyMap) / sizeof(kPropertyMap[0]); i++) + if (value.HasMember(kPropertyMap[i].name)) + return CreateSchema(value, kPropertyMap[i].type); + + return new TypelessSchema(value); + } + else if (typeItr->value.IsArray()) + return new MultiTypeSchema(value, typeItr->value); + else + return CreateSchema(value, typeItr->value); } template > diff --git a/test/unittest/schematest.cpp b/test/unittest/schematest.cpp index 3775ef2..7b0df90 100644 --- a/test/unittest/schematest.cpp +++ b/test/unittest/schematest.cpp @@ -27,14 +27,8 @@ using namespace rapidjson; /*printf("\n%s\n", json);*/\ d.Parse(json);\ EXPECT_FALSE(d.HasParseError());\ - if (expected) {\ - EXPECT_TRUE(d.Accept(validator));\ - EXPECT_TRUE(validator.IsValid());\ - }\ - else {\ - EXPECT_FALSE(d.Accept(validator));\ - EXPECT_FALSE(validator.IsValid()); \ - }\ + EXPECT_TRUE(expected == d.Accept(validator));\ + EXPECT_TRUE(expected == validator.IsValid());\ } TEST(SchemaValidator, Typeless) { @@ -613,3 +607,111 @@ TEST(SchemaValidator, AllOf_Nested) { VALIDATE(s, "\"too long\"", false); VALIDATE(s, "123", false); } + +static char* ReadFile(const char* filename, size_t& length) { + const char *paths[] = { + "jsonschema/tests/draft4/%s", + "bin/jsonschema/tests/draft4/%s", + "../bin/jsonschema/tests/draft4/%s", + "../../bin/jsonschema/tests/draft4/%s", + "../../../bin/jsonschema/tests/draft4/%s" + }; + char buffer[1024]; + FILE *fp = 0; + for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) { + sprintf(buffer, paths[i], filename); + fp = fopen(buffer, "rb"); + if (fp) + break; + } + + if (!fp) + return 0; + + fseek(fp, 0, SEEK_END); + length = (size_t)ftell(fp); + fseek(fp, 0, SEEK_SET); + char* json = (char*)malloc(length + 1); + size_t readLength = fread(json, 1, length, fp); + json[readLength] = '\0'; + fclose(fp); + return json; +} + + +TEST(SchemaValidator, TestSuite) { + const char* filenames[] = { + "additionalItems.json", + "additionalProperties.json", + "allOf.json", + "anyOf.json", + "definitions.json", + "dependencies.json", + "enum.json", + "items.json", + "maximum.json", + "maxItems.json", + "maxLength.json", + "maxProperties.json", + "minimum.json", + "minItems.json", + "minLength.json", + "minProperties.json", + "multipleOf.json", + "not.json", + "oneOf.json", + "pattern.json", + "patternProperties.json", + "properties.json", + "ref.json", + "refRemote.json", + "required.json", + "type.json", + "uniqueItems.json" + }; + + unsigned testCount = 0; + unsigned passCount = 0; + + for (size_t i = 0; i < sizeof(filenames) / sizeof(filenames[0]); i++) { + const char* filename = filenames[i]; + size_t length; + char* json = ReadFile(filename, length); + if (!json) { + printf("json test suite file %s not found", filename); + ADD_FAILURE(); + } + else { + Document d; + d.Parse(json); + if (d.HasParseError()) { + printf("json test suite file %s has parse error", filename); + ADD_FAILURE(); + } + else { + for (Value::ConstValueIterator schemaItr = d.Begin(); schemaItr != d.End(); ++schemaItr) { + Schema schema((*schemaItr)["schema"]); + SchemaValidator validator(schema); + const Value& tests = (*schemaItr)["tests"]; + for (Value::ConstValueIterator testItr = tests.Begin(); testItr != tests.End(); ++testItr) { + testCount++; + const Value& data = (*testItr)["data"]; + bool expected = (*testItr)["valid"].GetBool(); + const char* description = (*testItr)["description"].GetString(); + validator.Reset(); + bool actual = data.Accept(validator); + if (expected != actual) { + char buffer[256]; + sprintf(buffer, "%s \"%s\"", filename, description); + GTEST_NONFATAL_FAILURE_(buffer); + } + else + passCount++; + } + } + } + } + free(json); + } + printf("%d / %d passed (%2d%%)\n", passCount, testCount, passCount * 100 / testCount); +} \ No newline at end of file