Test-JSON-Schema-Acceptance-1.015/000770 000766 000024 00000000000 14163671560 016711 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/inc/000770 000766 000024 00000000000 14163671560 017462 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/INSTALL000644 000766 000024 00000004734 14163671560 017755 0ustar00etherstaff000000 000000 This is the Perl distribution Test-JSON-Schema-Acceptance. Installing Test-JSON-Schema-Acceptance is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Test::JSON::Schema::Acceptance If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Test::JSON::Schema::Acceptance ## Manual installation As a last resort, you can manually install it. If you have not already downloaded the release tarball, you can find the download link on the module's MetaCPAN page: https://metacpan.org/pod/Test::JSON::Schema::Acceptance Untar the tarball, install configure prerequisites (see below), then build it: % perl Makefile.PL % make && make test Then install it: % make install On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib The prerequisites of this distribution will also have to be installed manually. The prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated by running the manual build process described above. ## Configure Prerequisites This distribution requires other modules to be installed before this distribution's installer can be run. They can be found under the "configure_requires" key of META.yml or the "{prereqs}{configure}{requires}" key of META.json. ## Other Prerequisites This distribution may require additional modules to be installed after running Makefile.PL. Look for prerequisites in the following phases: * to run make, PHASE = build * to use the module code itself, PHASE = runtime * to run tests, PHASE = test They can all be found in the "PHASE_requires" key of MYMETA.yml or the "{prereqs}{PHASE}{requires}" key of MYMETA.json. ## Documentation Test-JSON-Schema-Acceptance documentation is available as POD. You can run `perldoc` from a shell to read the documentation: % perldoc Test::JSON::Schema::Acceptance For more information on installing Perl modules via CPAN, please see: https://www.cpan.org/modules/INSTALL.html Test-JSON-Schema-Acceptance-1.015/CONTRIBUTING000644 000766 000024 00000010205 14163671560 020544 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. PLEASE NOTE that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are just recommendations, intended to help you (and help us help you faster). The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t $ prove -lvr t/ In most cases, 'prove' is entirely sufficient for you to test any patches you have. You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release -- this is available at https://metacpan.org/release/Test-JSON-Schema-Acceptance If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends Test::JSON::Schema::Acceptance Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps --missing` or $ dzil authordeps --missing | cpanm You should then also install any additional requirements not needed by the dzil build but may be needed by tests or other development: $ cpan `dzil listdeps --author --missing` or $ dzil listdeps --author --missing | cpanm Or, you can use the 'dzil stale' command to install all requirements at once: $ cpan Dist::Zilla::App::Command::stale $ cpan `dzil stale --all` or $ cpanm Dist::Zilla::App::Command::stale $ dzil stale --all | cpanm You can also do this via cpanm directly: $ cpanm --reinstall --installdeps --with-develop --with-recommends Test::JSON::Schema::Acceptance Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil test --release $ dzil xtest $ dzil listdeps --json $ dzil build --notgz You can learn more about Dist::Zilla at http://dzil.org/. The code for this distribution is hosted at GitHub. The repository is: https://github.com/karenetheridge/Test-JSON-Schema-Acceptance This repository uses git submodules. That means you also need to run: $ git submodule update --init --recursive $ git submodule update --remote You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Please include a suitable end-user-oriented entry in the Changes file describing your change. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request All pull requests for this distribution will be automatically tested on Linux by Travis at: https://travis-ci.com/karenetheridge/Test-JSON-Schema-Acceptance Results will be visible in the pull request on GitHub. Follow the appropriate links for details when tests fail. Changes will not be mergeable until all tests pass. If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report here: https://github.com/karenetheridge/Test-JSON-Schema-Acceptance/issues This is a good place to send your questions about the usage of this distribution. If you send me a patch or pull request, your name and email address will be included in the documentation as a contributor (using the attribution on the commit or patch), unless you specifically request for it not to be. If you wish to be listed under a different name or address, you should submit a pull request to the .mailmap file to contain the correct mapping. This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.015 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.162. Test-JSON-Schema-Acceptance-1.015/Changes000640 000766 000024 00000016672 14163671560 020217 0ustar00etherstaff000000 000000 Revision history for Test-JSON-Schema-Acceptance 1.015 2021-12-31 21:17:27Z - removed bignum deserialization that was added in 1.014: you should override the json_decoder attribute if you want this - updated test suite: https://github.com/json-schema-org/JSON-Schema-Test-Suite/compare/26f74befcd2286cce0b74c9ae17ecdd560245924...20fb14bde8f3c45a8933cd13283557c1b1fdf5b5 1.014 2021-12-30 05:08:33Z - "draft-future" is now known as "draft-next" - minimum perl version raised to 5.020 - now deserializes large numbers in test data to Math::BigInt, Math::BigFloat objects - updated test suite: https://github.com/json-schema-org/JSON-Schema-Test-Suite/compare/329efe59c65ea9f49af9c5c07dd6f5d22cb67ef4...26f74befcd2286cce0b74c9ae17ecdd560245924 1.013 2021-10-22 22:00:15Z - reflect schema validation failure (against the metaschema) in the results tally - updated test suite: https://github.com/json-schema-org/JSON-Schema-Test-Suite/compare/fd0aa9f8e2497d9048e17f071abb8fa409f5cb52...329efe59c65ea9f49af9c5c07dd6f5d22cb67ef4 1.012 2021-07-22 05:14:11Z - updated test suite to commit fd0aa9f8e2497d9048e17f071abb8fa409f5cb52 1.011 2021-06-26 19:38:21Z - updated test suite to commit b6769f2b9ae8b3adbe8117d155a1f8ade092fb88 1.010 2021-06-19 18:27:26Z - updated test suite to commit 0aefbb3d80e0caa22f3782677cf09c61b2205aa7 (note that "draft-future" is now available as a specification version) 1.009 2021-06-05 17:48:22Z - always include specification_version in results - pad results with more whitespace, to minimize diffs - updated test suite to commit 8a3a542bfe6b671a51f4e39cdc0dbbf543e8903d 1.008 2021-05-15 18:03:12Z - clean up the results output when printing a custom test_dir - new optional config value "test_schemas", to perform a sanity test on the test schemas themselves - updated test suite to commit bf383b4cf2a0b83957b232d3ba5a92222f632a08 1.007 2021-04-14 00:17:32Z - new "results_text" attribute, containing the textual table printed at the end of the tests - switch from Try::Tiny to Feature::Compat::Try, raising the minimum perl from 5.14 to 5.16 - updated test suite to commit dfcd4a19f857b85e344d6d14e37ca7b2e5d11bdf 1.006 2021-04-08 20:05:11Z - also list skipped directories in diagnostic output - updated test suite to commit fc68499eafa2cdbe52b4ed4d219dbb1c8c99fb2b 1.005 2021-03-23 21:24:15Z - specification => latest now uses draft2020-12 1.004 2021-03-23 20:37:27Z - new "skip_dir" option, to be used in conjunction with include_optional => 1 - updated test suite to commit cd73775f22d4cae64587486c0ee7efca9131643c 1.003 2020-12-05 07:09:12Z - updated test suite to commit 6505944d38c414039cd8f27e3312b9e3831a0a16 1.002 2020-11-24 17:56:27Z - include more data in the summary header - fix minimum declared version for Path::Tiny - make the output look a little nicer on failure - perform the evaluation inside the subtest, to allow for any output or tests generated by the evaluator itself to be grouped properly with related output - updated test suite to commit 3b79a452fc2f3dbb0add34f520fed64de4f465cf 1.001 2020-10-16 18:28:56Z - also display TODO-failures in results summary table - also display a TOTAL line in the results summary table - updated test suite to commit 96742ba3c4a1eff6de45f0c50a66a975796b7c37 1.000 2020-08-13 19:24:23Z - new "add_resource" option, for providing a subref for easy use of additional schema resources used by the test suite - raise minimum required perl to 5.14 - now checking for data and schema mutation during evaluation - updated test suite to commit ec18a7d0c24b4286f101e7e6956b89a2d4cbc59d 0.999 2020-06-08 23:31:40Z - fix type constraint for test data, and add a test to verify it 0.998 2020-06-08 23:05:33Z - fix warning when the test directory is empty - updated test suite to commit 817b724b7a64d7c18a8232aa32b5f1cc1d6dd153 0.997 2020-05-19 23:24:07Z - fix test that warns on 5.10 - updated test suite to commit 8bf2f7f3869230f4d778356730805866c76e5932 0.996 2020-05-14 19:33:09Z - work around problem when files in the test suite are renamed - really fix sorting of results table this time - updated test suite to commit 7ba95f3588d0f98a4cbce9da0fd42bee6c6931bd 0.995 2020-05-13 17:11:29Z - fix sorting of results table so tests in subdirectories appear last - fix minimum declared version for Path::Tiny - updated test suite to commit 2f2e7cf8bd7c4378107db6115d6af5aae062b105 0.994 2020-05-12 18:43:17Z - added "additional_resources" attribute, for accessing remotely-referenced content - new "include_optional" feature, for including optional tests (GH #12) - test results are now available via the "results" accessor method 0.993 2020-05-08 16:55:43Z - soften type constraints so as to tolerate older Cpanel::JSON::XS, which inflates booleans to different types - print information about this module's version, and the commit and version of the test suite data we are using - new "verbose" option, for more helpful output when running under "make test" or "prove" - improved handling of exceptions from the tested implementation - updated test suite to commit 9d0e0eb31d6be6bebd3bacdd6be119a8841e9999 0.992 2020-05-04 22:40:44Z - fix minimum declared version for List::Util (RT#132461) - increase minimum version for JSON::MaybeXS, to ensure that JSON::XS is never used, even when installed - include tabular results of passes, fails for each test file (GH #3) - updated test suite to commit 361620ecf18b71883f8522cb4c7e95e3e0adcdce 0.991 2020-04-30 23:56:50Z - switch from JSON.pm to JSON::MaybeXS (GH #1) - package the submodule of test cases in a sharedir (GH #2) - additional constructor options, including use of a custom directory - add options "validate_data" and "validate_json_string", to accomodate the JSON Schema backend preferring either inflated data or a JSON-encoded string. (GH #4) - remove undocumented "only_test" option, and ability to skip test by number (GH #10, GH #11) - clearer labels for each test - new "tests" option, for restricting the tests that are run (GH #7) - deprecated "skip_tests" option - new "todo_tests" option, for acknowledging that certain tests do not pass yet (GH #6) - non-ascii characters are not corrupted during decoding (GH #13) - always read test data files in sorted order, for consistent results - updated test suite to commit ab9e3d5c53abe0a0d2a5a21429fb12524b0926a0 0.990 2020-04-23 18:00:40Z - updated distribution packaging - updated test suite with latest tests (to commit c4d3e0f92ced13c288d1713815c00539b09c9d2e) 0.0.2 2015-09-04 Fixed Github issue #7 - Draft tested is dependant on last call to new, not object instance. 0.0.1 2015-09-03 First version, released on an unsuspecting world. Test-JSON-Schema-Acceptance-1.015/MANIFEST000644 000766 000024 00000047663 14163671560 020065 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.024. CONTRIBUTING Changes INSTALL LICENCE MANIFEST META.json META.yml Makefile.PL README dist.ini examples/run_all_tests inc/ExtUtils/HasCompiler.pm inc/OldShareDirFiles.pm lib/Test/JSON/Schema/Acceptance.pm share/LICENSE share/README.md share/remotes/baseUriChange/folderInteger.json share/remotes/baseUriChangeFolder/folderInteger.json share/remotes/baseUriChangeFolderInSubschema/folderInteger.json share/remotes/draft2019-09/metaschema-no-validation.json share/remotes/draft2020-12/format-assertion-false.json share/remotes/draft2020-12/format-assertion-true.json share/remotes/draft2020-12/metaschema-no-validation.json share/remotes/extendible-dynamic-ref.json share/remotes/folder/folderInteger.json share/remotes/integer.json share/remotes/name-defs.json share/remotes/name.json share/remotes/ref-and-definitions.json share/remotes/ref-and-defs.json share/remotes/subSchemas-defs.json share/remotes/subSchemas.json share/remotes/tree.json share/submodule_status share/test-schema.json share/tests/draft-next/additionalProperties.json share/tests/draft-next/allOf.json share/tests/draft-next/anchor.json share/tests/draft-next/anyOf.json share/tests/draft-next/boolean_schema.json share/tests/draft-next/const.json share/tests/draft-next/contains.json share/tests/draft-next/content.json share/tests/draft-next/default.json share/tests/draft-next/defs.json share/tests/draft-next/dependentRequired.json share/tests/draft-next/dependentSchemas.json share/tests/draft-next/dynamicRef.json share/tests/draft-next/enum.json share/tests/draft-next/exclusiveMaximum.json share/tests/draft-next/exclusiveMinimum.json share/tests/draft-next/format.json share/tests/draft-next/id.json share/tests/draft-next/if-then-else.json share/tests/draft-next/infinite-loop-detection.json share/tests/draft-next/items.json share/tests/draft-next/maxContains.json share/tests/draft-next/maxItems.json share/tests/draft-next/maxLength.json share/tests/draft-next/maxProperties.json share/tests/draft-next/maximum.json share/tests/draft-next/minContains.json share/tests/draft-next/minItems.json share/tests/draft-next/minLength.json share/tests/draft-next/minProperties.json share/tests/draft-next/minimum.json share/tests/draft-next/multipleOf.json share/tests/draft-next/not.json share/tests/draft-next/oneOf.json share/tests/draft-next/optional/bignum.json share/tests/draft-next/optional/ecmascript-regex.json share/tests/draft-next/optional/float-overflow.json share/tests/draft-next/optional/format-assertion.json share/tests/draft-next/optional/format/date-time.json share/tests/draft-next/optional/format/date.json share/tests/draft-next/optional/format/duration.json share/tests/draft-next/optional/format/email.json share/tests/draft-next/optional/format/hostname.json share/tests/draft-next/optional/format/idn-email.json share/tests/draft-next/optional/format/idn-hostname.json share/tests/draft-next/optional/format/ipv4.json share/tests/draft-next/optional/format/ipv6.json share/tests/draft-next/optional/format/iri-reference.json share/tests/draft-next/optional/format/iri.json share/tests/draft-next/optional/format/json-pointer.json share/tests/draft-next/optional/format/regex.json share/tests/draft-next/optional/format/relative-json-pointer.json share/tests/draft-next/optional/format/time.json share/tests/draft-next/optional/format/uri-reference.json share/tests/draft-next/optional/format/uri-template.json share/tests/draft-next/optional/format/uri.json share/tests/draft-next/optional/format/uuid.json share/tests/draft-next/optional/non-bmp-regex.json share/tests/draft-next/optional/refOfUnknownKeyword.json share/tests/draft-next/pattern.json share/tests/draft-next/patternProperties.json share/tests/draft-next/prefixItems.json share/tests/draft-next/properties.json share/tests/draft-next/propertyNames.json share/tests/draft-next/ref.json share/tests/draft-next/refRemote.json share/tests/draft-next/required.json share/tests/draft-next/type.json share/tests/draft-next/unevaluatedItems.json share/tests/draft-next/unevaluatedProperties.json share/tests/draft-next/uniqueItems.json share/tests/draft-next/unknownKeyword.json share/tests/draft-next/vocabulary.json share/tests/draft2019-09/additionalItems.json share/tests/draft2019-09/additionalProperties.json share/tests/draft2019-09/allOf.json share/tests/draft2019-09/anchor.json share/tests/draft2019-09/anyOf.json share/tests/draft2019-09/boolean_schema.json share/tests/draft2019-09/const.json share/tests/draft2019-09/contains.json share/tests/draft2019-09/content.json share/tests/draft2019-09/default.json share/tests/draft2019-09/defs.json share/tests/draft2019-09/dependentRequired.json share/tests/draft2019-09/dependentSchemas.json share/tests/draft2019-09/enum.json share/tests/draft2019-09/exclusiveMaximum.json share/tests/draft2019-09/exclusiveMinimum.json share/tests/draft2019-09/format.json share/tests/draft2019-09/id.json share/tests/draft2019-09/if-then-else.json share/tests/draft2019-09/infinite-loop-detection.json share/tests/draft2019-09/items.json share/tests/draft2019-09/maxContains.json share/tests/draft2019-09/maxItems.json share/tests/draft2019-09/maxLength.json share/tests/draft2019-09/maxProperties.json share/tests/draft2019-09/maximum.json share/tests/draft2019-09/minContains.json share/tests/draft2019-09/minItems.json share/tests/draft2019-09/minLength.json share/tests/draft2019-09/minProperties.json share/tests/draft2019-09/minimum.json share/tests/draft2019-09/multipleOf.json share/tests/draft2019-09/not.json share/tests/draft2019-09/oneOf.json share/tests/draft2019-09/optional/bignum.json share/tests/draft2019-09/optional/content.json share/tests/draft2019-09/optional/ecmascript-regex.json share/tests/draft2019-09/optional/float-overflow.json share/tests/draft2019-09/optional/format/date-time.json share/tests/draft2019-09/optional/format/date.json share/tests/draft2019-09/optional/format/duration.json share/tests/draft2019-09/optional/format/ecmascript-regex.json share/tests/draft2019-09/optional/format/email.json share/tests/draft2019-09/optional/format/hostname.json share/tests/draft2019-09/optional/format/idn-email.json share/tests/draft2019-09/optional/format/idn-hostname.json share/tests/draft2019-09/optional/format/ipv4.json share/tests/draft2019-09/optional/format/ipv6.json share/tests/draft2019-09/optional/format/iri-reference.json share/tests/draft2019-09/optional/format/iri.json share/tests/draft2019-09/optional/format/json-pointer.json share/tests/draft2019-09/optional/format/regex.json share/tests/draft2019-09/optional/format/relative-json-pointer.json share/tests/draft2019-09/optional/format/time.json share/tests/draft2019-09/optional/format/uri-reference.json share/tests/draft2019-09/optional/format/uri-template.json share/tests/draft2019-09/optional/format/uri.json share/tests/draft2019-09/optional/format/uuid.json share/tests/draft2019-09/optional/non-bmp-regex.json share/tests/draft2019-09/optional/refOfUnknownKeyword.json share/tests/draft2019-09/optional/unicode.json share/tests/draft2019-09/pattern.json share/tests/draft2019-09/patternProperties.json share/tests/draft2019-09/properties.json share/tests/draft2019-09/propertyNames.json share/tests/draft2019-09/recursiveRef.json share/tests/draft2019-09/ref.json share/tests/draft2019-09/refRemote.json share/tests/draft2019-09/required.json share/tests/draft2019-09/type.json share/tests/draft2019-09/unevaluatedItems.json share/tests/draft2019-09/unevaluatedProperties.json share/tests/draft2019-09/uniqueItems.json share/tests/draft2019-09/unknownKeyword.json share/tests/draft2019-09/vocabulary.json share/tests/draft2020-12/additionalProperties.json share/tests/draft2020-12/allOf.json share/tests/draft2020-12/anchor.json share/tests/draft2020-12/anyOf.json share/tests/draft2020-12/boolean_schema.json share/tests/draft2020-12/const.json share/tests/draft2020-12/contains.json share/tests/draft2020-12/content.json share/tests/draft2020-12/default.json share/tests/draft2020-12/defs.json share/tests/draft2020-12/dependentRequired.json share/tests/draft2020-12/dependentSchemas.json share/tests/draft2020-12/dynamicRef.json share/tests/draft2020-12/enum.json share/tests/draft2020-12/exclusiveMaximum.json share/tests/draft2020-12/exclusiveMinimum.json share/tests/draft2020-12/format.json share/tests/draft2020-12/id.json share/tests/draft2020-12/if-then-else.json share/tests/draft2020-12/infinite-loop-detection.json share/tests/draft2020-12/items.json share/tests/draft2020-12/maxContains.json share/tests/draft2020-12/maxItems.json share/tests/draft2020-12/maxLength.json share/tests/draft2020-12/maxProperties.json share/tests/draft2020-12/maximum.json share/tests/draft2020-12/minContains.json share/tests/draft2020-12/minItems.json share/tests/draft2020-12/minLength.json share/tests/draft2020-12/minProperties.json share/tests/draft2020-12/minimum.json share/tests/draft2020-12/multipleOf.json share/tests/draft2020-12/not.json share/tests/draft2020-12/oneOf.json share/tests/draft2020-12/optional/bignum.json share/tests/draft2020-12/optional/ecmascript-regex.json share/tests/draft2020-12/optional/float-overflow.json share/tests/draft2020-12/optional/format-assertion.json share/tests/draft2020-12/optional/format/date-time.json share/tests/draft2020-12/optional/format/date.json share/tests/draft2020-12/optional/format/duration.json share/tests/draft2020-12/optional/format/email.json share/tests/draft2020-12/optional/format/hostname.json share/tests/draft2020-12/optional/format/idn-email.json share/tests/draft2020-12/optional/format/idn-hostname.json share/tests/draft2020-12/optional/format/ipv4.json share/tests/draft2020-12/optional/format/ipv6.json share/tests/draft2020-12/optional/format/iri-reference.json share/tests/draft2020-12/optional/format/iri.json share/tests/draft2020-12/optional/format/json-pointer.json share/tests/draft2020-12/optional/format/regex.json share/tests/draft2020-12/optional/format/relative-json-pointer.json share/tests/draft2020-12/optional/format/time.json share/tests/draft2020-12/optional/format/uri-reference.json share/tests/draft2020-12/optional/format/uri-template.json share/tests/draft2020-12/optional/format/uri.json share/tests/draft2020-12/optional/format/uuid.json share/tests/draft2020-12/optional/non-bmp-regex.json share/tests/draft2020-12/optional/refOfUnknownKeyword.json share/tests/draft2020-12/optional/unicode.json share/tests/draft2020-12/pattern.json share/tests/draft2020-12/patternProperties.json share/tests/draft2020-12/prefixItems.json share/tests/draft2020-12/properties.json share/tests/draft2020-12/propertyNames.json share/tests/draft2020-12/ref.json share/tests/draft2020-12/refRemote.json share/tests/draft2020-12/required.json share/tests/draft2020-12/type.json share/tests/draft2020-12/unevaluatedItems.json share/tests/draft2020-12/unevaluatedProperties.json share/tests/draft2020-12/uniqueItems.json share/tests/draft2020-12/unknownKeyword.json share/tests/draft2020-12/vocabulary.json share/tests/draft3/additionalItems.json share/tests/draft3/additionalProperties.json share/tests/draft3/default.json share/tests/draft3/dependencies.json share/tests/draft3/disallow.json share/tests/draft3/divisibleBy.json share/tests/draft3/enum.json share/tests/draft3/extends.json share/tests/draft3/format.json share/tests/draft3/infinite-loop-detection.json share/tests/draft3/items.json share/tests/draft3/maxItems.json share/tests/draft3/maxLength.json share/tests/draft3/maximum.json share/tests/draft3/minItems.json share/tests/draft3/minLength.json share/tests/draft3/minimum.json share/tests/draft3/optional/bignum.json share/tests/draft3/optional/ecmascript-regex.json share/tests/draft3/optional/format.json share/tests/draft3/optional/format/color.json share/tests/draft3/optional/format/date-time.json share/tests/draft3/optional/format/date.json share/tests/draft3/optional/format/email.json share/tests/draft3/optional/format/host-name.json share/tests/draft3/optional/format/ip-address.json share/tests/draft3/optional/format/ipv6.json share/tests/draft3/optional/format/regex.json share/tests/draft3/optional/format/time.json share/tests/draft3/optional/format/uri.json share/tests/draft3/optional/non-bmp-regex.json share/tests/draft3/optional/zeroTerminatedFloats.json share/tests/draft3/pattern.json share/tests/draft3/patternProperties.json share/tests/draft3/properties.json share/tests/draft3/ref.json share/tests/draft3/refRemote.json share/tests/draft3/required.json share/tests/draft3/type.json share/tests/draft3/uniqueItems.json share/tests/draft4/additionalItems.json share/tests/draft4/additionalProperties.json share/tests/draft4/allOf.json share/tests/draft4/anyOf.json share/tests/draft4/default.json share/tests/draft4/definitions.json share/tests/draft4/dependencies.json share/tests/draft4/enum.json share/tests/draft4/format.json share/tests/draft4/id.json share/tests/draft4/infinite-loop-detection.json share/tests/draft4/items.json share/tests/draft4/maxItems.json share/tests/draft4/maxLength.json share/tests/draft4/maxProperties.json share/tests/draft4/maximum.json share/tests/draft4/minItems.json share/tests/draft4/minLength.json share/tests/draft4/minProperties.json share/tests/draft4/minimum.json share/tests/draft4/multipleOf.json share/tests/draft4/not.json share/tests/draft4/oneOf.json share/tests/draft4/optional/bignum.json share/tests/draft4/optional/ecmascript-regex.json share/tests/draft4/optional/float-overflow.json share/tests/draft4/optional/format.json share/tests/draft4/optional/format/date-time.json share/tests/draft4/optional/format/email.json share/tests/draft4/optional/format/hostname.json share/tests/draft4/optional/format/ipv4.json share/tests/draft4/optional/format/ipv6.json share/tests/draft4/optional/format/uri.json share/tests/draft4/optional/non-bmp-regex.json share/tests/draft4/optional/unicode.json share/tests/draft4/optional/zeroTerminatedFloats.json share/tests/draft4/pattern.json share/tests/draft4/patternProperties.json share/tests/draft4/properties.json share/tests/draft4/ref.json share/tests/draft4/refRemote.json share/tests/draft4/required.json share/tests/draft4/type.json share/tests/draft4/uniqueItems.json share/tests/draft6/additionalItems.json share/tests/draft6/additionalProperties.json share/tests/draft6/allOf.json share/tests/draft6/anyOf.json share/tests/draft6/boolean_schema.json share/tests/draft6/const.json share/tests/draft6/contains.json share/tests/draft6/default.json share/tests/draft6/definitions.json share/tests/draft6/dependencies.json share/tests/draft6/enum.json share/tests/draft6/exclusiveMaximum.json share/tests/draft6/exclusiveMinimum.json share/tests/draft6/format.json share/tests/draft6/id.json share/tests/draft6/infinite-loop-detection.json share/tests/draft6/items.json share/tests/draft6/maxItems.json share/tests/draft6/maxLength.json share/tests/draft6/maxProperties.json share/tests/draft6/maximum.json share/tests/draft6/minItems.json share/tests/draft6/minLength.json share/tests/draft6/minProperties.json share/tests/draft6/minimum.json share/tests/draft6/multipleOf.json share/tests/draft6/not.json share/tests/draft6/oneOf.json share/tests/draft6/optional/bignum.json share/tests/draft6/optional/ecmascript-regex.json share/tests/draft6/optional/float-overflow.json share/tests/draft6/optional/format.json share/tests/draft6/optional/format/date-time.json share/tests/draft6/optional/format/email.json share/tests/draft6/optional/format/hostname.json share/tests/draft6/optional/format/ipv4.json share/tests/draft6/optional/format/ipv6.json share/tests/draft6/optional/format/json-pointer.json share/tests/draft6/optional/format/uri-reference.json share/tests/draft6/optional/format/uri-template.json share/tests/draft6/optional/format/uri.json share/tests/draft6/optional/non-bmp-regex.json share/tests/draft6/optional/unicode.json share/tests/draft6/pattern.json share/tests/draft6/patternProperties.json share/tests/draft6/properties.json share/tests/draft6/propertyNames.json share/tests/draft6/ref.json share/tests/draft6/refRemote.json share/tests/draft6/required.json share/tests/draft6/type.json share/tests/draft6/uniqueItems.json share/tests/draft6/unknownKeyword.json share/tests/draft7/additionalItems.json share/tests/draft7/additionalProperties.json share/tests/draft7/allOf.json share/tests/draft7/anyOf.json share/tests/draft7/boolean_schema.json share/tests/draft7/const.json share/tests/draft7/contains.json share/tests/draft7/default.json share/tests/draft7/definitions.json share/tests/draft7/dependencies.json share/tests/draft7/enum.json share/tests/draft7/exclusiveMaximum.json share/tests/draft7/exclusiveMinimum.json share/tests/draft7/format.json share/tests/draft7/id.json share/tests/draft7/if-then-else.json share/tests/draft7/infinite-loop-detection.json share/tests/draft7/items.json share/tests/draft7/maxItems.json share/tests/draft7/maxLength.json share/tests/draft7/maxProperties.json share/tests/draft7/maximum.json share/tests/draft7/minItems.json share/tests/draft7/minLength.json share/tests/draft7/minProperties.json share/tests/draft7/minimum.json share/tests/draft7/multipleOf.json share/tests/draft7/not.json share/tests/draft7/oneOf.json share/tests/draft7/optional/bignum.json share/tests/draft7/optional/content.json share/tests/draft7/optional/ecmascript-regex.json share/tests/draft7/optional/float-overflow.json share/tests/draft7/optional/format/date-time.json share/tests/draft7/optional/format/date.json share/tests/draft7/optional/format/ecmascript-regex.json share/tests/draft7/optional/format/email.json share/tests/draft7/optional/format/hostname.json share/tests/draft7/optional/format/idn-email.json share/tests/draft7/optional/format/idn-hostname.json share/tests/draft7/optional/format/ipv4.json share/tests/draft7/optional/format/ipv6.json share/tests/draft7/optional/format/iri-reference.json share/tests/draft7/optional/format/iri.json share/tests/draft7/optional/format/json-pointer.json share/tests/draft7/optional/format/regex.json share/tests/draft7/optional/format/relative-json-pointer.json share/tests/draft7/optional/format/time.json share/tests/draft7/optional/format/uri-reference.json share/tests/draft7/optional/format/uri-template.json share/tests/draft7/optional/format/uri.json share/tests/draft7/optional/non-bmp-regex.json share/tests/draft7/optional/unicode.json share/tests/draft7/pattern.json share/tests/draft7/patternProperties.json share/tests/draft7/properties.json share/tests/draft7/propertyNames.json share/tests/draft7/ref.json share/tests/draft7/refRemote.json share/tests/draft7/required.json share/tests/draft7/type.json share/tests/draft7/uniqueItems.json share/tests/draft7/unknownKeyword.json t/00-report-prereqs.dd t/00-report-prereqs.t t/01-basic.t t/02-constructor.t t/03-validate_data.t t/04-validate_json_string.t t/05-test-descriptions.t t/06-subset-of-tests.t t/07-skip-tests-deprecated.t t/08-todo-tests.t t/09-unicode.t t/10-exception.t t/11-additional-resources.t t/12-include-optional.t t/13-empty-test-dir.t t/14-add-resource.t t/15-mutation.t t/16-skip_dir.t t/99-sanity.t t/lib/SchemaParser.pm t/tests/add_resource/foo.json t/tests/add_resource/remotes/remote1.json t/tests/add_resource/remotes/subfolder/remote2.json t/tests/bad/invalid-schema.json t/tests/empty/keep t/tests/include_optional/extra/foo.json t/tests/include_optional/foo.json t/tests/include_optional/optional/alpha.json t/tests/include_optional/optional/beta.json t/tests/include_optional/zulu.json t/tests/mutation/hash.json t/tests/simple-booleans/bar.json t/tests/simple-booleans/foo.json t/tests/skip_dir/main.json t/tests/skip_dir/optional/alpha/test.json t/tests/skip_dir/optional/beta/test.json t/tests/skip_dir/optional/betadyne/test.json t/tests/skip_dir/optional/gamma/test.json t/tests/subset/bar.json t/tests/subset/baz.json t/tests/subset/foo.json t/tests/unicode/unicode.json update-share weaver.ini xt/author/00-compile.t xt/author/clean-namespaces.t xt/author/distmeta.t xt/author/eol.t xt/author/kwalitee.t xt/author/live-data-sanity.t xt/author/minimum-version.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-no404s.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/release/changes_has_content.t xt/release/cpan-changes.t Test-JSON-Schema-Acceptance-1.015/t/000770 000766 000024 00000000000 14163671560 017154 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/xt/000770 000766 000024 00000000000 14163671560 017344 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/README000644 000766 000024 00000000531 14163671560 017573 0ustar00etherstaff000000 000000 This archive contains the distribution Test-JSON-Schema-Acceptance, version 1.015: Acceptance testing for JSON-Schema based validators like JSON::Schema This software is Copyright (c) 2015 by Ben Hutton. This is free software, licensed under: The MIT (X11) License This README file was generated by Dist::Zilla::Plugin::Readme v6.024. Test-JSON-Schema-Acceptance-1.015/examples/000770 000766 000024 00000000000 14163671560 020527 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/META.yml000644 000766 000024 00000071406 14163671560 020175 0ustar00etherstaff000000 000000 --- abstract: 'Acceptance testing for JSON-Schema based validators like JSON::Schema' author: - 'Ben Hutton (@relequestual) ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' JSON::PP: '0' Scalar::Util: '0' Test2::Suite: '0.000131' Test::Deep: '0' Test::Fatal: '0' Test::File::ShareDir: '0' Test::More: '0.88' Test::Simple: '1.302176' Test::Warnings: '0' feature: '0' lib: '0' open: '0' perl: '5.020' utf8: '0' configure_requires: ExtUtils::MakeMaker: '0' File::ShareDir::Install: '0.06' perl: '5.020' dynamic_config: 1 generated_by: 'Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010' license: mit meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Test-JSON-Schema-Acceptance no_index: directory: - examples - inc - share - t - xt provides: Test::JSON::Schema::Acceptance: file: lib/Test/JSON/Schema/Acceptance.pm version: '1.015' requires: Feature::Compat::Try: '0' File::ShareDir: '0' JSON::MaybeXS: '1.004001' List::Util: '1.33' Moo: '0' MooX::TypeTiny: '0.002002' Path::Tiny: '0.069' Ref::Util: '0' Test2::API: '0' Test2::Todo: '0' Test2::Tools::Compare: '0' Types::Common::Numeric: '0' Types::Standard: '1.010002' constant: '0' experimental: '0' if: '0' namespace::clean: '0' perl: '5.020' strict: '0' strictures: '2' warnings: '0' resources: bugtracker: https://github.com/karenetheridge/Test-JSON-Schema-Acceptance/issues homepage: https://github.com/karenetheridge/Test-JSON-Schema-Acceptance repository: https://github.com/karenetheridge/Test-JSON-Schema-Acceptance.git version: '1.015' x_Dist_Zilla: perl: version: '5.035007' plugins: - class: Dist::Zilla::Plugin::Run::BeforeBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 0 run: - 'git submodule update --init --recursive' - 'git submodule update --recursive' version: '0.048' name: Run::BeforeBuild version: '0.048' - class: Dist::Zilla::Plugin::Run::BeforeRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 0 run: - 'git submodule update --remote' - "if [[ -n $(git status --untracked --porcelain share) ]]; then echo -e '\\033[1;33m!!! submodule has changed! run './update-share' to commit updates to share/\\033[0m'; fi" version: '0.048' name: Run::BeforeRelease version: '0.048' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'chomp(my $status = `git submodule status`);' - "my ($new_sha) = split(' ', $status, 2);" - '$new_sha =~ s/^\+//;' - "`pushd ../JSON-Schema-Test-Suite; git tag -a -m'%n-%v' '%n-%v' $new_sha`" fatal_errors: 1 quiet: 0 version: '0.048' name: Run::AfterRelease version: '0.048' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - index.js - package.json - tests/latest - tox.ini exclude_match: - ^bin/ follow_symlinks: 0 include_dotfiles: 0 prefix: share prune_directory: [] root: share Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: 'Gather sharedir' version: '2.048' - class: inc::OldShareDirFiles name: =inc::OldShareDirFiles version: ~ - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle version' version: '6.024' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::ETHER phase: build run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, build' version: '0.057' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '6.024' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING - INSTALL - LICENCE - README.pod - TODO - share exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@Author::ETHER/Git::GatherDir' version: '2.048' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '6.024' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '6.024' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '6.024' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '6.024' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '6.024' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 has_xs: 0 location: build source_filename: CONTRIBUTING Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.009' name: '@Author::ETHER/generate CONTRIBUTING' version: '0.015' - class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/InstallGuide' version: '1.200014' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '1' fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' - '@Author::ETHER/Examples' skips: [] switch: [] name: '@Author::ETHER/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - '@Author::ETHER/Examples' - ':TestFiles' - ':ExtraTestFiles' name: '@Author::ETHER/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':ExtraTestFiles' - ':InstallModules' - ':TestFiles' - '@Author::ETHER/Examples' trailing_whitespace: 1 name: '@Author::ETHER/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: '6.024' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Author::ETHER/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::Test::MinimumVersion config: Dist::Zilla::Plugin::Test::MinimumVersion: max_target_perl: '5.020' name: '@Author::ETHER/Test::MinimumVersion' version: '2.000010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '6.024' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ETHER/PodCoverageTests' version: '6.024' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - examples - lib - script - t - xt spell_cmd: '' stopwords: - irc wordlist: Pod::Wordlist name: '@Author::ETHER/Test::PodSpelling' version: '2.007005' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.004' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/author/kwalitee.t skiptest: [] name: '@Author::ETHER/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ETHER/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::ETHER/Test::ReportPrereqs' version: '0.028' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@Author::ETHER/Test::Portability' version: '2.001000' - class: Dist::Zilla::Plugin::Test::CleanNamespaces config: Dist::Zilla::Plugin::Test::CleanNamespaces: filename: xt/author/clean-namespaces.t skips: [] name: '@Author::ETHER/Test::CleanNamespaces' version: '0.006' - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::ETHER/Git::Describe' version: '0.007' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@Author::ETHER/EnsurePod5' version: '4.018' - class: Pod::Weaver::Plugin::H1Nester name: '@Author::ETHER/H1Nester' version: '4.018' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::ETHER/SingleEncoding' version: '4.018' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/List' version: '4.018' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/Verbatim' version: '4.018' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/header' version: '4.018' - class: Pod::Weaver::Section::Name name: '@Author::ETHER/Name' version: '4.018' - class: Pod::Weaver::Section::Version name: '@Author::ETHER/Version' version: '4.018' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/prelude' version: '4.018' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.018' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.018' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.018' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.018' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.018' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.018' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.018' - class: Pod::Weaver::Section::Leftovers name: '@Author::ETHER/Leftovers' version: '4.018' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/postlude' version: '4.018' - class: Pod::Weaver::Section::GenerateSection name: '@Author::ETHER/generate SUPPORT' version: '4.018' - class: Pod::Weaver::Section::Authors name: '@Author::ETHER/Authors' version: '4.018' - class: Pod::Weaver::Section::AllowOverride name: '@Author::ETHER/allow override AUTHOR' version: '0.05' - class: Pod::Weaver::Section::Contributors name: '@Author::ETHER/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@Author::ETHER/Legal' version: '4.018' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/footer' version: '4.018' - class: Pod::Weaver::Section::AllowOverride name: OverrideLegal version: '0.05' name: '@Author::ETHER/PodWeaver' version: '4.009' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: '6.024' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder: - ':InstallModules' finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.024' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '0' inherit_version: '0' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '6.024' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: [] name: '@Author::ETHER/Keywords' version: '0.007' - class: Dist::Zilla::Plugin::UseUnsafeInc config: Dist::Zilla::Plugin::UseUnsafeInc: dot_in_INC: 0 name: '@Author::ETHER/UseUnsafeInc' version: '0.001' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '6.024' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: '0.007' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/MakeMaker' version: '6.024' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.34.1 include_authors: 0 include_releaser: 1 order_by: commits paths: [] name: '@Author::ETHER/Git::Contributors' version: '0.036' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: off name: '@Author::ETHER/StaticInstall' version: '0.012' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 1 run: - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" version: '0.048' name: '@Author::ETHER/.ackrc' version: '0.048' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" fatal_errors: 0 quiet: 1 version: '0.048' name: '@Author::ETHER/.latest' version: '0.048' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::ETHER/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::EnsureLatestPerl config: Dist::Zilla::Plugin::EnsureLatestPerl: Module::CoreList: '5.20211220' name: '@Author::ETHER/EnsureLatestPerl' version: '0.008' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, release' version: '0.057' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: '@Author::ETHER/initial check' version: '2.048' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: '0.014' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: '0.014' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@Author::ETHER/Git::Remote::Check' version: 0.1.2 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.021' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '6.024' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: '@Author::ETHER/after tests' version: '2.048' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.011' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '6.024' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/copy generated files' version: '0.007' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/@Git::VersionManager/pluginbundle version' version: '6.024' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 1 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::ETHER/@Git::VersionManager/RewriteVersion::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Author::ETHER/@Git::VersionManager/MetaProvides::Update' version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Changes match: [] name: '@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease' version: '0.007' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: - . commit_msg: '%N-%v%t%n%n%c' signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING - Changes - INSTALL - LICENCE - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/release snapshot' version: '2.048' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v1.015 tag_format: v%V tag_message: v%v%t Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/Git::Tag' version: '2.048' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':InstallModules' global: 1 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::ETHER/@Git::VersionManager/BumpVersionAfterRelease::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/@Git::VersionManager/NextRelease' version: '6.024' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Build.PL - Changes - Makefile.PL allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/post-release commit' version: '2.048' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager' version: '6.024' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: '@Author::ETHER/Git::Push' version: '2.048' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.48' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED version: '0.048' name: '@Author::ETHER/install release' version: '0.048' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 version: '0.048' name: '@Author::ETHER/release complete' version: '0.048' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '6.024' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/prereqs for @Author::ETHER' version: '6.024' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: suggests name: RuntimeSuggests version: '6.024' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '6.024' - class: Dist::Zilla::Plugin::DynamicPrereqs config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: DynamicPrereqs version: '0.039' - class: Dist::Zilla::Plugin::GenerateFile name: submodule_status version: '6.024' - class: Dist::Zilla::Plugin::ShareDir name: ShareDir version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.024' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.024' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.016' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.024' x_authority: cpan:RELEQUEST x_contributors: - 'Karen Etheridge ' - 'Daniel Perrett ' x_generated_by_perl: v5.35.7 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: MIT x_static_install: 0 x_use_unsafe_inc: 0 Test-JSON-Schema-Acceptance-1.015/lib/000770 000766 000024 00000000000 14163671560 017457 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/Makefile.PL000644 000766 000024 00000010357 14163671560 020674 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.024. use strict; use warnings; use 5.020; use ExtUtils::MakeMaker; use File::ShareDir::Install; $File::ShareDir::Install::INCLUDE_DOTFILES = 1; $File::ShareDir::Install::INCLUDE_DOTDIRS = 1; install_share dist => "share"; my %WriteMakefileArgs = ( "ABSTRACT" => "Acceptance testing for JSON-Schema based validators like JSON::Schema", "AUTHOR" => "Ben Hutton (\@relequestual) ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::ShareDir::Install" => "0.06" }, "DISTNAME" => "Test-JSON-Schema-Acceptance", "LICENSE" => "mit", "MIN_PERL_VERSION" => "5.020", "NAME" => "Test::JSON::Schema::Acceptance", "PREREQ_PM" => { "Feature::Compat::Try" => 0, "File::ShareDir" => 0, "JSON::MaybeXS" => "1.004001", "List::Util" => "1.33", "Moo" => 0, "MooX::TypeTiny" => "0.002002", "Path::Tiny" => "0.069", "Ref::Util" => 0, "Test2::API" => 0, "Test2::Todo" => 0, "Test2::Tools::Compare" => 0, "Types::Common::Numeric" => 0, "Types::Standard" => "1.010002", "constant" => 0, "experimental" => 0, "if" => 0, "namespace::clean" => 0, "strict" => 0, "strictures" => 2, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "JSON::PP" => 0, "Scalar::Util" => 0, "Test2::Suite" => "0.000131", "Test::Deep" => 0, "Test::Fatal" => 0, "Test::File::ShareDir" => 0, "Test::More" => "0.88", "Test::Simple" => "1.302176", "Test::Warnings" => 0, "feature" => 0, "lib" => 0, "open" => 0, "utf8" => 0 }, "VERSION" => "1.015", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "ExtUtils::MakeMaker" => 0, "Feature::Compat::Try" => 0, "File::ShareDir" => 0, "File::Spec" => 0, "JSON::MaybeXS" => "1.004001", "JSON::PP" => 0, "List::Util" => "1.33", "Moo" => 0, "MooX::TypeTiny" => "0.002002", "Path::Tiny" => "0.069", "Ref::Util" => 0, "Scalar::Util" => 0, "Test2::API" => 0, "Test2::Suite" => "0.000131", "Test2::Todo" => 0, "Test2::Tools::Compare" => 0, "Test::Deep" => 0, "Test::Fatal" => 0, "Test::File::ShareDir" => 0, "Test::More" => "0.88", "Test::Simple" => "1.302176", "Test::Warnings" => 0, "Types::Common::Numeric" => 0, "Types::Standard" => "1.010002", "constant" => 0, "experimental" => 0, "feature" => 0, "if" => 0, "lib" => 0, "namespace::clean" => 0, "open" => 0, "strict" => 0, "strictures" => 2, "utf8" => 0, "warnings" => 0 ); # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.039 if (can_xs()) { requires('Cpanel::JSON::XS', '3.0223') } unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); { package MY; use File::ShareDir::Install qw(postamble); } # inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.039 sub _add_prereq { my ($mm_key, $module, $version_or_range) = @_; $version_or_range ||= 0; warn "$module already exists in $mm_key (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!" if exists $WriteMakefileArgs{$mm_key}{$module} and $WriteMakefileArgs{$mm_key}{$module} ne '0' and $WriteMakefileArgs{$mm_key}{$module} ne $version_or_range; warn "$module already exists in FallbackPrereqs (at version $FallbackPrereqs{$module}) -- need to do a sane metamerge!" if exists $FallbackPrereqs{$module} and $FallbackPrereqs{$module} ne '0' and $FallbackPrereqs{$module} ne $version_or_range; $WriteMakefileArgs{$mm_key}{$module} = $FallbackPrereqs{$module} = $version_or_range; return; } use lib 'inc'; use ExtUtils::HasCompiler 0.014 'can_compile_loadable_object'; { my $can_xs; sub can_xs { return $can_xs if defined $can_xs; $can_xs = can_compile_loadable_object(quiet => 1) ? 1 : 0; } } sub requires { goto &runtime_requires } sub runtime_requires { my ($module, $version_or_range) = @_; _add_prereq(PREREQ_PM => $module, $version_or_range); } Test-JSON-Schema-Acceptance-1.015/weaver.ini000640 000766 000024 00000000154 14163671560 020702 0ustar00etherstaff000000 000000 [@Author::ETHER] [AllowOverride / OverrideLegal] header_re = ^COPYRIGHT match_anywhere = 1 action = append Test-JSON-Schema-Acceptance-1.015/LICENCE000644 000766 000024 00000002205 14163671560 017700 0ustar00etherstaff000000 000000 This software is Copyright (c) 2015 by Ben Hutton. This is free software, licensed under: The MIT (X11) License The MIT License 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. Test-JSON-Schema-Acceptance-1.015/META.json000644 000766 000024 00000143074 14163671560 020346 0ustar00etherstaff000000 000000 { "abstract" : "Acceptance testing for JSON-Schema based validators like JSON::Schema", "author" : [ "Ben Hutton (@relequestual) " ], "dynamic_config" : 1, "generated_by" : "Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010", "license" : [ "mit" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Test-JSON-Schema-Acceptance", "no_index" : { "directory" : [ "examples", "inc", "share", "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "File::ShareDir::Install" : "0.06", "perl" : "5.020" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.162", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { "Encode" : "0", "ExtUtils::HasCompiler" : "0.014", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CleanNamespaces" : "0.15", "Test::EOL" : "0", "Test::File::ShareDir" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::No404s" : "0", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Warnings" : "0" } }, "runtime" : { "requires" : { "Feature::Compat::Try" : "0", "File::ShareDir" : "0", "JSON::MaybeXS" : "1.004001", "List::Util" : "1.33", "Moo" : "0", "MooX::TypeTiny" : "0.002002", "Path::Tiny" : "0.069", "Ref::Util" : "0", "Test2::API" : "0", "Test2::Todo" : "0", "Test2::Tools::Compare" : "0", "Types::Common::Numeric" : "0", "Types::Standard" : "1.010002", "constant" : "0", "experimental" : "0", "if" : "0", "namespace::clean" : "0", "perl" : "5.020", "strict" : "0", "strictures" : "2", "warnings" : "0" }, "suggests" : { "Class::XSAccessor" : "0", "Cpanel::JSON::XS" : "0", "Ref::Util::XS" : "0", "Type::Tiny::XS" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "JSON::PP" : "0", "Scalar::Util" : "0", "Test2::Suite" : "0.000131", "Test::Deep" : "0", "Test::Fatal" : "0", "Test::File::ShareDir" : "0", "Test::More" : "0.88", "Test::Simple" : "1.302176", "Test::Warnings" : "0", "feature" : "0", "lib" : "0", "open" : "0", "perl" : "5.020", "utf8" : "0" } }, "x_Dist_Zilla" : { "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Authority" : "1.009", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::AutoPrereqs" : "5.038", "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", "Dist::Zilla::Plugin::CheckIssues" : "0", "Dist::Zilla::Plugin::CheckMetaResources" : "0", "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0.019", "Dist::Zilla::Plugin::CheckSelfDependency" : "0", "Dist::Zilla::Plugin::CheckStrictVersion" : "0", "Dist::Zilla::Plugin::ConfirmRelease" : "0", "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", "Dist::Zilla::Plugin::DynamicPrereqs" : "0.029", "Dist::Zilla::Plugin::EnsureLatestPerl" : "0", "Dist::Zilla::Plugin::FileFinder::ByName" : "0", "Dist::Zilla::Plugin::GenerateFile" : "0", "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : "0", "Dist::Zilla::Plugin::Git::Check" : "0", "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0.004", "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts" : "0", "Dist::Zilla::Plugin::Git::Commit" : "2.020", "Dist::Zilla::Plugin::Git::Contributors" : "0.029", "Dist::Zilla::Plugin::Git::Describe" : "0.004", "Dist::Zilla::Plugin::Git::GatherDir" : "2.016", "Dist::Zilla::Plugin::Git::Push" : "0", "Dist::Zilla::Plugin::Git::Remote::Check" : "0", "Dist::Zilla::Plugin::Git::Tag" : "0", "Dist::Zilla::Plugin::GitHub::Update" : "0.40", "Dist::Zilla::Plugin::GithubMeta" : "0.54", "Dist::Zilla::Plugin::InstallGuide" : "1.200005", "Dist::Zilla::Plugin::Keywords" : "0.004", "Dist::Zilla::Plugin::License" : "5.038", "Dist::Zilla::Plugin::MakeMaker" : "0", "Dist::Zilla::Plugin::Manifest" : "0", "Dist::Zilla::Plugin::MetaConfig" : "0", "Dist::Zilla::Plugin::MetaJSON" : "0", "Dist::Zilla::Plugin::MetaNoIndex" : "0", "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", "Dist::Zilla::Plugin::MetaTests" : "0", "Dist::Zilla::Plugin::MetaYAML" : "0", "Dist::Zilla::Plugin::MinimumPerl" : "1.006", "Dist::Zilla::Plugin::MojibakeTests" : "0.8", "Dist::Zilla::Plugin::NextRelease" : "5.033", "Dist::Zilla::Plugin::PodCoverageTests" : "5.040", "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", "Dist::Zilla::Plugin::PodWeaver" : "4.008", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0.006", "Dist::Zilla::Plugin::PromptIfStale" : "0", "Dist::Zilla::Plugin::Readme" : "0", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.006", "Dist::Zilla::Plugin::Run::AfterBuild" : "0.041", "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", "Dist::Zilla::Plugin::Run::BeforeBuild" : "0", "Dist::Zilla::Plugin::Run::BeforeRelease" : "0", "Dist::Zilla::Plugin::RunExtraTests" : "0.024", "Dist::Zilla::Plugin::ShareDir" : "0", "Dist::Zilla::Plugin::StaticInstall" : "0.005", "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.012", "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", "Dist::Zilla::Plugin::Test::CleanNamespaces" : "0.006", "Dist::Zilla::Plugin::Test::Compile" : "2.039", "Dist::Zilla::Plugin::Test::EOL" : "0.17", "Dist::Zilla::Plugin::Test::Kwalitee" : "2.10", "Dist::Zilla::Plugin::Test::MinimumVersion" : "2.000010", "Dist::Zilla::Plugin::Test::NoTabs" : "0.08", "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.003", "Dist::Zilla::Plugin::Test::PodSpelling" : "2.006003", "Dist::Zilla::Plugin::Test::Portability" : "2.000007", "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.022", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", "Dist::Zilla::Plugin::UseUnsafeInc" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.154", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007", "Software::License::MIT" : "0" } } }, "provides" : { "Test::JSON::Schema::Acceptance" : { "file" : "lib/Test/JSON/Schema/Acceptance.pm", "version" : "1.015" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/karenetheridge/Test-JSON-Schema-Acceptance/issues" }, "homepage" : "https://github.com/karenetheridge/Test-JSON-Schema-Acceptance", "repository" : { "type" : "git", "url" : "https://github.com/karenetheridge/Test-JSON-Schema-Acceptance.git", "web" : "https://github.com/karenetheridge/Test-JSON-Schema-Acceptance" } }, "version" : "1.015", "x_Dist_Zilla" : { "perl" : { "version" : "5.035007" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Run::BeforeBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "git submodule update --init --recursive", "git submodule update --recursive" ], "version" : "0.048" } }, "name" : "Run::BeforeBuild", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::BeforeRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "git submodule update --remote", "if [[ -n $(git status --untracked --porcelain share) ]]; then echo -e '\\033[1;33m!!! submodule has changed! run './update-share' to commit updates to share/\\033[0m'; fi" ], "version" : "0.048" } }, "name" : "Run::BeforeRelease", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "chomp(my $status = `git submodule status`);", "my ($new_sha) = split(' ', $status, 2);", "$new_sha =~ s/^\\+//;", "`pushd ../JSON-Schema-Test-Suite; git tag -a -m'%n-%v' '%n-%v' $new_sha`" ], "fatal_errors" : 1, "quiet" : 0, "version" : "0.048" } }, "name" : "Run::AfterRelease", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "index.js", "package.json", "tests/latest", "tox.ini" ], "exclude_match" : [ "^bin/" ], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "share", "prune_directory" : [], "root" : "share" }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "Gather sharedir", "version" : "2.048" }, { "class" : "inc::OldShareDirFiles", "name" : "=inc::OldShareDirFiles", "version" : null }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle version", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::ETHER" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, build", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING", "INSTALL", "LICENCE", "README.pod", "TODO", "share" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@Author::ETHER/Git::GatherDir", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "has_xs" : 0, "location" : "build", "source_filename" : "CONTRIBUTING" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.009" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/InstallGuide", "version" : "1.200014" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 1, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles", "@Author::ETHER/Examples" ], "skips" : [], "switch" : [] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", "@Author::ETHER/Examples", ":TestFiles", ":ExtraTestFiles" ] } }, "name" : "@Author::ETHER/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":ExtraTestFiles", ":InstallModules", ":TestFiles", "@Author::ETHER/Examples" ], "trailing_whitespace" : 1 } }, "name" : "@Author::ETHER/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "config" : { "Dist::Zilla::Plugin::Test::MinimumVersion" : { "max_target_perl" : "5.020" } }, "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ETHER/PodCoverageTests", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "examples", "lib", "script", "t", "xt" ], "spell_cmd" : "", "stopwords" : [ "irc" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.007005" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.004" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/author/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::ETHER/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ETHER/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::ETHER/Test::ReportPrereqs", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "@Author::ETHER/Test::Portability", "version" : "2.001000" }, { "class" : "Dist::Zilla::Plugin::Test::CleanNamespaces", "config" : { "Dist::Zilla::Plugin::Test::CleanNamespaces" : { "filename" : "xt/author/clean-namespaces.t", "skips" : [] } }, "name" : "@Author::ETHER/Test::CleanNamespaces", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::ETHER/Git::Describe", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@Author::ETHER/EnsurePod5", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@Author::ETHER/H1Nester", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::ETHER/SingleEncoding", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/List", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/Verbatim", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/header", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::ETHER/Name", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::ETHER/Version", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/prelude", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::ETHER/Leftovers", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/postlude", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@Author::ETHER/generate SUPPORT", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::ETHER/Authors", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@Author::ETHER/allow override AUTHOR", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@Author::ETHER/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::ETHER/Legal", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/footer", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "OverrideLegal", "version" : "0.05" } ] } }, "name" : "@Author::ETHER/PodWeaver", "version" : "4.009" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder" : [ ":InstallModules" ], "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.024" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 0, "inherit_version" : 0, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::UseUnsafeInc", "config" : { "Dist::Zilla::Plugin::UseUnsafeInc" : { "dot_in_INC" : 0 } }, "name" : "@Author::ETHER/UseUnsafeInc", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/MakeMaker", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.34.1", "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.036" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "off" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 1, "run" : [ "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" ], "version" : "0.048" } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" ], "fatal_errors" : 0, "quiet" : 1, "version" : "0.048" } }, "name" : "@Author::ETHER/.latest", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::ETHER/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::EnsureLatestPerl", "config" : { "Dist::Zilla::Plugin::EnsureLatestPerl" : { "Module::CoreList" : "5.20211220" } }, "name" : "@Author::ETHER/EnsureLatestPerl", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, release", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@Author::ETHER/Git::Remote::Check", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.021" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/copy generated files", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/@Git::VersionManager/pluginbundle version", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::ETHER/@Git::VersionManager/RewriteVersion::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Author::ETHER/@Git::VersionManager/MetaProvides::Update", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Changes" ], "match" : [] } }, "name" : "@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [ "." ], "commit_msg" : "%N-%v%t%n%n%c", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENCE", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/release snapshot", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v1.015", "tag_format" : "v%V", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/Git::Tag", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":InstallModules" ], "global" : 1, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::ETHER/@Git::VersionManager/BumpVersionAfterRelease::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/@Git::VersionManager/NextRelease", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Build.PL", "Changes", "Makefile.PL" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/post-release commit", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.48" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ], "version" : "0.048" } }, "name" : "@Author::ETHER/install release", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1, "version" : "0.048" } }, "name" : "@Author::ETHER/release complete", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/prereqs for @Author::ETHER", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "suggests" } }, "name" : "RuntimeSuggests", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::DynamicPrereqs", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "DynamicPrereqs", "version" : "0.039" }, { "class" : "Dist::Zilla::Plugin::GenerateFile", "name" : "submodule_status", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "ShareDir", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.024" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.016" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.024" } }, "x_authority" : "cpan:RELEQUEST", "x_contributors" : [ "Karen Etheridge ", "Daniel Perrett " ], "x_generated_by_perl" : "v5.35.7", "x_serialization_backend" : "Cpanel::JSON::XS version 4.27", "x_spdx_expression" : "MIT", "x_static_install" : 0, "x_use_unsafe_inc" : 0 } Test-JSON-Schema-Acceptance-1.015/share/000770 000766 000024 00000000000 14163671560 020013 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/update-share000750 000766 000024 00000002401 14163671560 021214 0ustar00etherstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Path::Tiny; # ATTENTION DISTRO REPACKAGERS: do NOT use fresh copies of these files # from their source; it is important to include the original versions # of the files as they were packaged with this cpan distribution, or # surprising behaviour may occur. chomp(my $dirty = `git status --untracked --porcelain share`); !length($dirty) and die 'Cannot proceed: share/ is not dirty. Run "git submodule update --remote"'; chomp($dirty = `git status --untracked --porcelain Changes`); length($dirty) and die 'Cannot proceed: Changes is already dirty'; chomp(my $ls_tree = `git ls-tree HEAD share`); my (undef, undef, $old_sha) = split(/\s/, $ls_tree); chomp(my $status = `git submodule status`); my ($new_sha) = split(' ', $status, 2); $new_sha =~ s/^\+//; my ($remote_spec) = path('.gitmodules')->slurp_utf8 =~ m{url\s+=\s+git://(.+)\.git$}m; my $diff_link = 'https://'.$remote_spec.'/compare/'.$old_sha.'...'.$new_sha; my ($seen_next, $seen_blank); path('Changes')->edit_lines_utf8(sub { if ($seen_next ||= /^\{\{\$NEXT\}\}/ and not $seen_blank and /^$/) { s/^$/ - updated test suite:\n $diff_link\n/; $seen_blank = 1; } }); exec 'git commit -m"update test suite to latest commit" Changes share'; Test-JSON-Schema-Acceptance-1.015/dist.ini000640 000766 000024 00000006631 14163671560 020362 0ustar00etherstaff000000 000000 name = Test-JSON-Schema-Acceptance author = Ben Hutton (@relequestual) license = MIT copyright_year = 2015 copyright_holder = Ben Hutton ; ATTENTION DISTRO REPACKAGERS: do NOT use fresh copies of these files ; from their source; it is important to include the original versions ; of the files as they were packaged with this cpan distribution, or ; surprising behaviour may occur. ; bring local checkout up to what the submodule commit says [Run::BeforeBuild] run = git submodule update --init --recursive run = git submodule update --recursive ; fetches the commit captured in 'share' ; pull in updates to the latest commit in the submodule repository ; if there are new changes to the submodule, release will be halted by [Git::Check] [Run::BeforeRelease] run = git submodule update --remote run = if [[ -n $(git status --untracked --porcelain share) ]]; then echo -e '\033[1;33m!!! submodule has changed! run './update-share' to commit updates to share/\033[0m'; fi [Run::AfterRelease] eval = chomp(my $status = `git submodule status`); eval = my ($new_sha) = split(' ', $status, 2); eval = $new_sha =~ s/^\+//; eval = `pushd ../JSON-Schema-Test-Suite; git tag -a -m'%n-%v' '%n-%v' $new_sha` [Git::GatherDir / Gather sharedir] root = share prefix = share exclude_filename = index.js exclude_filename = package.json exclude_filename = tox.ini exclude_match = ^bin/ exclude_filename = tests/latest [=inc::OldShareDirFiles] removed = share/tests/draft2019-09/optional/format/ecmascript-regex.json removed = share/tests/draft3/optional/format.json removed = share/tests/draft4/optional/format.json removed = share/tests/draft6/optional/format.json removed = share/tests/draft7/optional/format/ecmascript-regex.json removed = share/remotes/folder/folderInteger.json removed = share/tests/draft2019-09/optional/content.json removed = share/tests/draft2019-09/optional/unicode.json removed = share/tests/draft2020-12/optional/unicode.json removed = share/tests/draft4/optional/unicode.json removed = share/tests/draft6/optional/unicode.json removed = share/tests/draft7/optional/unicode.json [@Author::ETHER] :version = 0.154 ; submodules, github issues authority = cpan:RELEQUEST bugtracker = github installer = MakeMaker Test::MinimumVersion.max_target_perl = 5.020 ; may go higher later on Git::GatherDir.exclude_filename = share ; in git, this is a filename (containing submodule info) StaticInstall.mode = off ; sharedir Test::ReportPrereqs.include[0] = JSON::PP Test::ReportPrereqs.include[1] = Cpanel::JSON::XS Test::ReportPrereqs.include[2] = JSON::XS [Prereqs / RuntimeSuggests] Class::XSAccessor = 0 Type::Tiny::XS = 0 Ref::Util::XS = 0 Cpanel::JSON::XS = 0 [Prereqs / TestRequires] Test::Simple = 1.302176 ; Test2::API::intercept compatibility with Test::Builder and TODO Test2::Suite = 0.000131 ; "" ; we almost certainly have a compiler available, because Syntax::Keyword::Try ; is used (via Feature::Compat::Try) on all but the most recent perl versions. [DynamicPrereqs] :version = 0.029 -condition = can_xs() -body = requires('Cpanel::JSON::XS', '3.0223') [GenerateFile / submodule_status] filename = share/submodule_status content_is_template = 1 content = {{ content = chomp(my $str = `git submodule status`); content = my ($sha, undef, $tag) = split(' ', $str); content = chomp(my $url = `git config --file .gitmodules submodule.share.url`); content = $sha.' '.$tag."\n".$url; content = }} [ShareDir] dir = share Test-JSON-Schema-Acceptance-1.015/share/test-schema.json000640 000766 000024 00000006367 14163671560 023136 0ustar00etherstaff000000 000000 { "$schema": "http://json-schema.org/draft-06/schema#", "description": "Schema for tests", "type": "array", "items": { "type": "object", "required": [ "description", "schema", "tests" ], "properties": { "id": { "description": "Uniquely identifies a set of tests", "type": "string", "format": "uri" }, "description": { "description": "The test set description", "type": "string" }, "comment": { "description": "Any additional comments about the test set", "type": "string" }, "schema": { "description": "This should be a valid schema. This should be a ref to a meta-schema if schema keywords need testing." }, "tests": { "description": "A set of related tests all using the same schema", "type": "array", "items": { "$ref": "#/definitions/test" }, "minItems": 1 } }, "additionalProperties": false, "minItems": 1 }, "definitions": { "outputItem": { "type": "object", "properties": { "valid": { "type": "boolean" }, "keywordLocation": { "type": "string" }, "absoluteKeywordLocation": { "type": "string", "format": "uri" }, "instanceLocation": { "type": "string" }, "annotations": { "type": "array", "items": { "$ref": "#/definitions/outputItem" } }, "errors": { "type": "array", "items": { "$ref": "#/definitions/outputItem" } } } }, "test": { "description": "A single test", "type": "object", "required": [ "description", "data", "valid" ], "properties": { "id": { "description": "Uniquely identifies a single test", "type": "string", "format": "uri" }, "description": { "description": "The test description", "type": "string" }, "comment": { "description": "Any additional comments about the test", "type": "string" }, "data": { "description": "This is the instance to be validated against the schema in \"schema\"." }, "valid": { "type": "boolean" }, "output": { "type": "object", "required": [ "basic", "detailed", "verbose" ], "properties": { "basic": { "$ref": "#/definitions/outputItem" }, "detailed": { "$ref": "#/definitions/outputItem" }, "verbose": { "$ref": "#/definitions/outputItem" } } } }, "additionalProperties": false } } } Test-JSON-Schema-Acceptance-1.015/share/LICENSE000640 000766 000024 00000002041 14163671560 021014 0ustar00etherstaff000000 000000 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. Test-JSON-Schema-Acceptance-1.015/share/tests/000770 000766 000024 00000000000 14163671560 021155 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/submodule_status000644 000766 000024 00000000172 14163671560 023343 0ustar00etherstaff000000 000000 20fb14bde8f3c45a8933cd13283557c1b1fdf5b5 (2.0.0-454-g20fb14b) git://github.com/json-schema-org/JSON-Schema-Test-Suite.git Test-JSON-Schema-Acceptance-1.015/share/README.md000640 000766 000024 00000017225 14163671560 021300 0ustar00etherstaff000000 000000 # JSON Schema Test Suite [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/json-schema-org/.github/blob/main/CODE_OF_CONDUCT.md) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Financial Contributors on Open Collective](https://opencollective.com/json-schema/all/badge.svg?label=financial+contributors)](https://opencollective.com/json-schema) [![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) 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 The tests in this suite 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 specification. Inside each draft directory, there are a number of `.json` files and one or more special subdirectories. The subdirectories contain `.json` files meant for a specific testing purpose, and each `.json` file logically groups a set of test cases together. Often the grouping is by property under test, but not always. The subdirectories are described in the next section. 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": { "description": "The schema against which the data in each test is validated", "type": "string" }, "tests": [ { "description": "Test for a valid instance", "data": "the instance to validate", "valid": true }, { "description": "Test for an invalid instance", "data": 15, "valid": false } ] } ``` In short: a description, a schema under test, and some tests, where each test in the `tests` array is an objects with a description of the case itself, the instance under test, and a boolean indicating whether it should be valid or invalid. ## Test Subdirectories There is currently only one subdirectory that may exist within each draft directory. This is: 1. `optional/`: Contains tests that are considered optional. ## Coverage All JSON Schema specification releases should be well covered by this suite, including drafts 2020-12, 2019-09, 07, 06, 04 and 03. Additional coverage is always welcome, particularly for bugs encountered in real-world implementations. Drafts 04 and 03 are considered "frozen" in that less effort is put in to backport new tests to these versions. Contributions are very welcome, especially from implementers as they add support to their own implementations. If you see anything missing from the current supported drafts, or incorrect on any draft still accepting bug fixes, please [file an issue](https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues) or [submit a PR](https://github.com/json-schema-org/JSON-Schema-Test-Suite). ## Who Uses the Test Suite This suite is being used by: ### Clojure * [jinx](https://github.com/juxt/jinx) * [json-schema](https://github.com/tatut/json-schema) ### Coffeescript * [jsck](https://github.com/pandastrike/jsck) ### Common Lisp * [json-schema](https://github.com/fisxoj/json-schema) ### C++ * [Modern C++ JSON schema validator](https://github.com/pboettch/json-schema-validator) ### Dart * [json\_schema](https://github.com/patefacio/json_schema) ### Elixir * [ex\_json\_schema](https://github.com/jonasschmidt/ex_json_schema) ### Erlang * [jesse](https://github.com/for-GET/jesse) ### Go * [gojsonschema](https://github.com/sigu-399/gojsonschema) * [validate-json](https://github.com/cesanta/validate-json) ### Haskell * [aeson-schema](https://github.com/timjb/aeson-schema) * [hjsonschema](https://github.com/seagreen/hjsonschema) ### Java * [json-schema-validator](https://github.com/daveclayton/json-schema-validator) * [everit-org/json-schema](https://github.com/everit-org/json-schema) * [networknt/json-schema-validator](https://github.com/networknt/json-schema-validator) * [Justify](https://github.com/leadpony/justify) * [Snow](https://github.com/ssilverman/snowy-json) * [jsonschemafriend](https://github.com/jimblackler/jsonschemafriend) ### JavaScript * [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark) * [direct-schema](https://github.com/IreneKnapp/direct-schema) * [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) * [jassi](https://github.com/iclanzan/jassi) * [JaySchema](https://github.com/natesilva/jayschema) * [json-schema-valid](https://github.com/ericgj/json-schema-valid) * [Jsonary](https://github.com/jsonary-js/jsonary) * [jsonschema](https://github.com/tdegrunt/jsonschema) * [request-validator](https://github.com/bugventure/request-validator) * [skeemas](https://github.com/Prestaul/skeemas) * [tv4](https://github.com/geraintluff/tv4) * [z-schema](https://github.com/zaggino/z-schema) * [jsen](https://github.com/bugventure/jsen) * [ajv](https://github.com/epoberezkin/ajv) * [djv](https://github.com/korzio/djv) ### Node.js For node.js developers, the suite is also available as an [npm](https://www.npmjs.com/package/@json-schema-org/tests) package. Node-specific support is maintained in a [separate repository](https://github.com/json-schema-org/json-schema-test-suite-npm) which also welcomes your contributions! ### .NET * [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema) * [Manatee.Json](https://github.com/gregsdennis/Manatee.Json) ### Perl * [JSON::Schema::Draft201909](https://github.com/karenetheridge/JSON-Schema-Draft201909) * [JSON::Schema::Tiny](https://github.com/karenetheridge/JSON-Schema-Tiny) * [Test::JSON::Schema::Acceptance](https://github.com/karenetheridge/Test-JSON-Schema-Acceptance) ### PHP * [opis/json-schema](https://github.com/opis/json-schema) * [json-schema](https://github.com/justinrainbow/json-schema) * [json-guard](https://github.com/thephpleague/json-guard) ### PostgreSQL * [postgres-json-schema](https://github.com/gavinwahl/postgres-json-schema) * [is\_jsonb\_valid](https://github.com/furstenheim/is_jsonb_valid) ### Python * [jsonschema](https://github.com/Julian/jsonschema) * [fastjsonschema](https://github.com/seznam/python-fastjsonschema) * [hypothesis-jsonschema](https://github.com/Zac-HD/hypothesis-jsonschema) * [jschon](https://github.com/marksparkza/jschon) ### Ruby * [json-schema](https://github.com/hoxworth/json-schema) * [json\_schemer](https://github.com/davishmcclurg/json_schemer) ### Rust * [jsonschema](https://github.com/Stranger6667/jsonschema-rs) * [valico](https://github.com/rustless/valico) ### Swift * [JSONSchema](https://github.com/kylef/JSONSchema.swift) 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` or `tox`. They will be run automatically by [GitHub Actions](https://github.com/json-schema-org/JSON-Schema-Test-Suite/actions?query=workflow%3A%22Test+Suite+Sanity+Checking%22) as well. Test-JSON-Schema-Acceptance-1.015/share/remotes/000770 000766 000024 00000000000 14163671560 021471 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/baseUriChangeFolder/000770 000766 000024 00000000000 14163671560 025325 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/baseUriChange/000770 000766 000024 00000000000 14163671560 024171 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/name.json000640 000766 000024 00000000404 14163671560 023301 0ustar00etherstaff000000 000000 { "definitions": { "orNull": { "anyOf": [ { "type": "null" }, { "$ref": "#" } ] } }, "type": "string" } Test-JSON-Schema-Acceptance-1.015/share/remotes/subSchemas-defs.json000640 000766 000024 00000000241 14163671560 025374 0ustar00etherstaff000000 000000 { "$defs": { "integer": { "type": "integer" }, "refToInteger": { "$ref": "#/$defs/integer" } } } Test-JSON-Schema-Acceptance-1.015/share/remotes/draft2020-12/000770 000766 000024 00000000000 14163671560 023315 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/folder/000770 000766 000024 00000000000 14163671560 022744 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/name-defs.json000640 000766 000024 00000000376 14163671560 024230 0ustar00etherstaff000000 000000 { "$defs": { "orNull": { "anyOf": [ { "type": "null" }, { "$ref": "#" } ] } }, "type": "string" } Test-JSON-Schema-Acceptance-1.015/share/remotes/subSchemas.json000640 000766 000024 00000000156 14163671560 024462 0ustar00etherstaff000000 000000 { "integer": { "type": "integer" }, "refToInteger": { "$ref": "#/integer" } } Test-JSON-Schema-Acceptance-1.015/share/remotes/draft2019-09/000770 000766 000024 00000000000 14163671560 023333 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/baseUriChangeFolderInSubschema/000770 000766 000024 00000000000 14163671560 027447 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/remotes/extendible-dynamic-ref.json000640 000766 000024 00000000710 14163671560 026700 0ustar00etherstaff000000 000000 { "description": "extendible array", "$id": "http://localhost:1234/extendible-dynamic-ref.json", "type": "object", "properties": { "elements": { "type": "array", "items": { "$dynamicRef": "#elements" } } }, "required": ["elements"], "additionalProperties": false, "$defs": { "elements": { "$dynamicAnchor": "elements" } } } Test-JSON-Schema-Acceptance-1.015/share/remotes/ref-and-defs.json000640 000766 000024 00000000337 14163671560 024621 0ustar00etherstaff000000 000000 { "$id": "http://localhost:1234/ref-and-defs.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } Test-JSON-Schema-Acceptance-1.015/share/remotes/ref-and-definitions.json000640 000766 000024 00000000403 14163671560 026205 0ustar00etherstaff000000 000000 { "$id": "http://localhost:1234/ref-and-definitions.json", "definitions": { "inner": { "properties": { "bar": { "type": "string" } } } }, "allOf": [ { "$ref": "#/definitions/inner" } ] } Test-JSON-Schema-Acceptance-1.015/share/remotes/integer.json000640 000766 000024 00000000032 14163671560 024013 0ustar00etherstaff000000 000000 { "type": "integer" } Test-JSON-Schema-Acceptance-1.015/share/remotes/tree.json000640 000766 000024 00000000516 14163671560 023324 0ustar00etherstaff000000 000000 { "description": "tree schema, extensible", "$id": "http://localhost:1234/tree.json", "$dynamicAnchor": "node", "type": "object", "properties": { "data": true, "children": { "type": "array", "items": { "$dynamicRef": "#node" } } } } Test-JSON-Schema-Acceptance-1.015/share/remotes/baseUriChangeFolderInSubschema/folderInteger.json000640 000766 000024 00000000032 14163671560 033125 0ustar00etherstaff000000 000000 { "type": "integer" } Test-JSON-Schema-Acceptance-1.015/share/remotes/draft2019-09/metaschema-no-validation.json000640 000766 000024 00000000640 14163671560 031076 0ustar00etherstaff000000 000000 { "$id": "http://localhost:1234/draft2019-09/metaschema-no-validation.json", "$vocabulary": { "https://json-schema.org/draft/2019-09/vocab/applicator": true, "https://json-schema.org/draft/2019-09/vocab/core": true }, "allOf": [ { "$ref": "https://json-schema.org/draft/2019-09/meta/applicator" }, { "$ref": "https://json-schema.org/draft/2019-09/meta/core" } ] } Test-JSON-Schema-Acceptance-1.015/share/remotes/folder/folderInteger.json000644 000766 000024 00000000002 14163671560 026423 0ustar00etherstaff000000 000000 {}Test-JSON-Schema-Acceptance-1.015/share/remotes/draft2020-12/metaschema-no-validation.json000640 000766 000024 00000000640 14163671560 031060 0ustar00etherstaff000000 000000 { "$id": "http://localhost:1234/draft2020-12/metaschema-no-validation.json", "$vocabulary": { "https://json-schema.org/draft/2020-12/vocab/applicator": true, "https://json-schema.org/draft/2020-12/vocab/core": true }, "allOf": [ { "$ref": "https://json-schema.org/draft/2020-12/meta/applicator" }, { "$ref": "https://json-schema.org/draft/2020-12/meta/core" } ] } Test-JSON-Schema-Acceptance-1.015/share/remotes/draft2020-12/format-assertion-true.json000640 000766 000024 00000000766 14163671560 030472 0ustar00etherstaff000000 000000 { "$id": "http://localhost:1234/draft2020-12/format-assertion-true.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "$vocabulary": { "https://json-schema.org/draft/2020-12/vocab/core": true, "https://json-schema.org/draft/2020-12/vocab/format-assertion": true }, "allOf": [ { "$ref": "https://json-schema.org/draft/2020-12/schema/meta/core" }, { "$ref": "https://json-schema.org/draft/2020-12/schema/meta/format-assertion" } ] } Test-JSON-Schema-Acceptance-1.015/share/remotes/draft2020-12/format-assertion-false.json000640 000766 000024 00000000770 14163671560 030600 0ustar00etherstaff000000 000000 { "$id": "http://localhost:1234/draft2020-12/format-assertion-false.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "$vocabulary": { "https://json-schema.org/draft/2020-12/vocab/core": true, "https://json-schema.org/draft/2020-12/vocab/format-assertion": false }, "allOf": [ { "$ref": "https://json-schema.org/draft/2020-12/schema/meta/core" }, { "$ref": "https://json-schema.org/draft/2020-12/schema/meta/format-assertion" } ] } Test-JSON-Schema-Acceptance-1.015/share/remotes/baseUriChange/folderInteger.json000640 000766 000024 00000000032 14163671560 027647 0ustar00etherstaff000000 000000 { "type": "integer" } Test-JSON-Schema-Acceptance-1.015/share/remotes/baseUriChangeFolder/folderInteger.json000640 000766 000024 00000000032 14163671560 031003 0ustar00etherstaff000000 000000 { "type": "integer" } Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/000770 000766 000024 00000000000 14163671560 022343 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/000770 000766 000024 00000000000 14163671560 023001 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/000770 000766 000024 00000000000 14163671560 022344 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/000770 000766 000024 00000000000 14163671560 023231 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/000770 000766 000024 00000000000 14163671560 023017 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/000770 000766 000024 00000000000 14163671560 022341 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/000770 000766 000024 00000000000 14163671560 022340 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/uniqueItems.json000640 000766 000024 00000030763 14163671560 025553 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/minItems.json000640 000766 000024 00000001265 14163671560 025023 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/extends.json000640 000766 000024 00000005037 14163671560 024711 0ustar00etherstaff000000 000000 [ { "description": "extends", "schema": { "properties": {"bar": {"type": "integer", "required": true}}, "extends": { "properties": { "foo": {"type": "string", "required": true} } } }, "tests": [ { "description": "extends", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch extends", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch extended", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "multiple extends", "schema": { "properties": {"bar": {"type": "integer", "required": true}}, "extends" : [ { "properties": { "foo": {"type": "string", "required": true} } }, { "properties": { "baz": {"type": "null", "required": true} } } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch first extends", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second extends", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "extends simple types", "schema": { "minimum": 20, "extends": {"maximum": 30} }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch extends", "data": 35, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/additionalProperties.json000640 000766 000024 00000007760 14163671560 027431 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "extends": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in extends are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/dependencies.json000640 000766 000024 00000006540 14163671560 025665 0ustar00etherstaff000000 000000 [ { "description": "dependencies", "schema": { "dependencies": {"bar": "foo"} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple dependencies", "schema": { "dependencies": {"quux": ["foo", "bar"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "multiple dependencies subschema", "schema": { "dependencies": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/items.json000640 000766 000024 00000002160 14163671560 024352 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true } ] }, { "description": "an array of schemas for items", "schema": { "items": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/enum.json000640 000766 000024 00000006440 14163671560 024202 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"], "required":true} } }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/properties.json000640 000766 000024 00000005717 14163671560 025440 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/maxLength.json000640 000766 000024 00000001577 14163671560 025173 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 10, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/infinite-loop-detection.json000640 000766 000024 00000001554 14163671560 027767 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "definitions": { "int": { "type": "integer" } }, "properties": { "foo": { "$ref": "#/definitions/int" } }, "extends": { "additionalProperties": { "$ref": "#/definitions/int" } } }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/minimum.json000640 000766 000024 00000004571 14163671560 024714 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "exclusiveMinimum validation", "schema": { "minimum": 1.1, "exclusiveMinimum": true }, "tests": [ { "description": "above the minimum is still valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/000770 000766 000024 00000000000 14163671560 024165 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/additionalItems.json000640 000766 000024 00000006223 14163671560 026347 0ustar00etherstaff000000 000000 [ { "description": "additionalItems as schema", "schema": { "items": [], "additionalItems": {"type": "integer"} }, "tests": [ { "description": "additional items match schema", "data": [ 1, 2, 3, 4 ], "valid": true }, { "description": "additional items do not match schema", "data": [ 1, 2, 3, "foo" ], "valid": false } ] }, { "description": "when items is schema, additionalItems does nothing", "schema": { "items": {}, "additionalItems": false }, "tests": [ { "description": "all items match schema", "data": [ 1, 2, 3, 4, 5 ], "valid": true } ] }, { "description": "array of items with no additionalItems permitted", "schema": { "items": [{}, {}, {}], "additionalItems": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "additionalItems as false without items", "schema": {"additionalItems": false}, "tests": [ { "description": "items defaults to empty schema so everything is valid", "data": [ 1, 2, 3, 4, 5 ], "valid": true }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true } ] }, { "description": "additionalItems are allowed by default", "schema": {"items": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] }, { "description": "additionalItems should not look in applicators", "schema": { "extends": [ { "items": [ { "type": "integer" } ] } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in extends are not examined", "data": [ 1, null ], "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/pattern.json000640 000766 000024 00000003003 14163671560 024703 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/required.json000640 000766 000024 00000002402 14163671560 025050 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {"required" : true}, "bar": {} } }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required explicitly false validation", "schema": { "properties": { "foo": {"required": false} } }, "tests": [ { "description": "not required if required is false", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/type.json000640 000766 000024 00000033152 14163671560 024217 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "a boolean is a boolean", "data": true, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "a boolean is not null", "data": true, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "any type matches any type", "schema": {"type": "any"}, "tests": [ { "description": "any type includes integers", "data": 1, "valid": true }, { "description": "any type includes float", "data": 1.1, "valid": true }, { "description": "any type includes string", "data": "foo", "valid": true }, { "description": "any type includes object", "data": {}, "valid": true }, { "description": "any type includes array", "data": [], "valid": true }, { "description": "any type includes boolean", "data": true, "valid": true }, { "description": "any type includes null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "types can include schemas", "schema": { "type": [ "array", {"type": "object"} ] }, "tests": [ { "description": "an integer is invalid", "data": 1, "valid": false }, { "description": "a string is invalid", "data": "foo", "valid": false }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is valid", "data": {}, "valid": true }, { "description": "an array is valid", "data": [], "valid": true }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "when types includes a schema it should fully validate the schema", "schema": { "type": [ "integer", { "properties": { "foo": {"type": "null"} } } ] }, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "an object is valid only if it is fully valid", "data": {"foo": null}, "valid": true }, { "description": "an object is invalid otherwise", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "types from separate schemas are merged", "schema": { "type": [ {"type": ["string"]}, {"type": ["array", "null"]} ] }, "tests": [ { "description": "an integer is invalid", "data": 1, "valid": false }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "an array is valid", "data": [1, 2, 3], "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/default.json000640 000766 000024 00000004267 14163671560 024667 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/patternProperties.json000640 000766 000024 00000006663 14163671560 026777 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/refRemote.json000640 000766 000024 00000003660 14163671560 025167 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "change resolution scope", "schema": { "id": "http://localhost:1234/", "items": { "id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "changed scope ref valid", "data": [[1]], "valid": true }, { "description": "changed scope ref invalid", "data": [["a"]], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/format.json000640 000766 000024 00000024523 14163671560 024530 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ip-address format", "schema": { "format": "ip-address" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "host-name format", "schema": { "format": "host-name" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "regex format", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date format", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "time format", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "color format", "schema": { "format": "color" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/ref.json000640 000766 000024 00000017660 14163671560 024020 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "items": [ {"type": "integer"}, {"$ref": "#/items/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "definitions": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/definitions/tilde~0field"}, "slash": {"$ref": "#/definitions/slash~1field"}, "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "definitions": { "a": {"type": "integer"}, "b": {"$ref": "#/definitions/a"}, "c": {"$ref": "#/definitions/b"} }, "$ref": "#/definitions/c" }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref overrides any sibling keywords", "schema": { "definitions": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/definitions/reffed", "maxItems": 2 } } }, "tests": [ { "description": "remote ref valid", "data": { "foo": [] }, "valid": true }, { "description": "remote ref valid, maxItems ignored", "data": { "foo": [ 1, 2, 3] }, "valid": true }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/definitions/is-string"} }, "definitions": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "$ref prevents a sibling id from changing the base uri", "schema": { "id": "http://localhost:1234/sibling_id/base/", "definitions": { "foo": { "id": "http://localhost:1234/sibling_id/foo.json", "type": "string" }, "base_foo": { "$comment": "this canonical uri is http://localhost:1234/sibling_id/base/foo.json", "id": "foo.json", "type": "number" } }, "allOf": [ { "$comment": "$ref resolves to http://localhost:1234/sibling_id/base/foo.json, not http://localhost:1234/sibling_id/foo.json", "id": "http://localhost:1234/sibling_id/", "$ref": "foo.json" } ] }, "tests": [ { "description": "$ref resolves to /definitions/base_foo, data does not validate", "data": "a", "valid": false }, { "description": "$ref resolves to /definitions/base_foo, data validates", "data": 1, "valid": true } ] }, { "description": "remote ref, containing refs itself", "schema": {"$ref": "http://json-schema.org/draft-03/schema#"}, "tests": [ { "description": "remote ref valid", "data": {"items": {"type": "integer"}}, "valid": true }, { "description": "remote ref invalid", "data": {"items": {"type": 1}}, "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "definitions": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/definitions/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/definitions/a_string" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/maximum.json000640 000766 000024 00000005262 14163671560 024714 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] }, { "description": "maximum validation (explicit false exclusivity)", "schema": {"maximum": 3.0, "exclusiveMaximum": false}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "exclusiveMaximum validation", "schema": { "maximum": 3.0, "exclusiveMaximum": true }, "tests": [ { "description": "below the maximum is still valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/disallow.json000640 000766 000024 00000003620 14163671560 025051 0ustar00etherstaff000000 000000 [ { "description": "disallow", "schema": { "disallow": "integer" }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "multiple disallow", "schema": { "disallow": ["integer", "boolean"] }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "multiple disallow subschema", "schema": { "disallow": ["string", { "type": "object", "properties": { "foo": { "type": "string" } } }] }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": "foo", "valid": false }, { "description": "other mismatch", "data": {"foo": "bar"}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/minLength.json000640 000766 000024 00000001566 14163671560 025167 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/maxItems.json000640 000766 000024 00000001302 14163671560 025015 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/divisibleBy.json000640 000766 000024 00000003010 14163671560 025471 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"divisibleBy": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"divisibleBy": 1.5}, "tests": [ { "description": "zero is divisible by anything (except 0)", "data": 0, "valid": true }, { "description": "4.5 is divisible by 1.5", "data": 4.5, "valid": true }, { "description": "35 is not divisible by 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"divisibleBy": 0.0001}, "tests": [ { "description": "0.0075 is divisible by 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not divisible by 0.0001", "data": 0.00751, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/zeroTerminatedFloats.json000640 000766 000024 00000000600 14163671560 031220 0ustar00etherstaff000000 000000 [ { "description": "some languages do not distinguish between different types of numeric value", "schema": { "type": "integer" }, "tests": [ { "description": "a float is not an integer even without fractional part", "data": 1.0, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/bignum.json000640 000766 000024 00000006003 14163671560 026337 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": {"type": "integer"}, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": {"type": "number"}, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "integer", "schema": {"type": "integer"}, "tests": [ { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": {"type": "number"}, "tests": [ { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": {"type": "string"}, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": {"maximum": 18446744073709551615}, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "maximum": 972783798187987123879878123.18878137, "exclusiveMaximum": true }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": {"minimum": -18446744073709551615}, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "minimum": -972783798187987123879878123.18878137, "exclusiveMinimum": true }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 027545 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/000770 000766 000024 00000000000 14163671560 025455 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/ecmascript-regex.json000640 000766 000024 00000000717 14163671560 030326 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex dialect recognition", "schema": { "format": "regex" }, "tests": [ { "description": "[^] is a valid regex", "data": "[^]", "valid": true }, { "description": "ECMA 262 has no support for lookbehind", "data": "(?<=foo)bar", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format.json000644 000766 000024 00000000002 14163671560 026343 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/color.json000640 000766 000024 00000002126 14163671560 027466 0ustar00etherstaff000000 000000 [ { "description": "validation of CSS colors", "schema": { "format": "color" }, "tests": [ { "description": "a valid CSS color name", "data": "fuchsia", "valid": true }, { "description": "a valid six-digit CSS color code", "data": "#CC8899", "valid": true }, { "description": "a valid three-digit CSS color code", "data": "#C89", "valid": true }, { "description": "an invalid CSS color code", "data": "#00332520", "valid": false }, { "description": "an invalid CSS color name", "data": "puce", "valid": false }, { "description": "a CSS color name containing invalid characters", "data": "light_grayish_red-violet", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/date.json000640 000766 000024 00000013132 14163671560 027264 0ustar00etherstaff000000 000000 [ { "description": "validation of date strings", "schema": { "format": "date" }, "tests": [ { "description": "a valid date string", "data": "1963-06-19", "valid": true }, { "description": "a valid date string with 31 days in January", "data": "2020-01-31", "valid": true }, { "description": "a invalid date string with 32 days in January", "data": "2020-01-32", "valid": false }, { "description": "a valid date string with 28 days in February (normal)", "data": "2021-02-28", "valid": true }, { "description": "a invalid date string with 29 days in February (normal)", "data": "2021-02-29", "valid": false }, { "description": "a valid date string with 29 days in February (leap)", "data": "2020-02-29", "valid": true }, { "description": "a invalid date string with 30 days in February (leap)", "data": "2020-02-30", "valid": false }, { "description": "a valid date string with 31 days in March", "data": "2020-03-31", "valid": true }, { "description": "a invalid date string with 32 days in March", "data": "2020-03-32", "valid": false }, { "description": "a valid date string with 30 days in April", "data": "2020-04-30", "valid": true }, { "description": "a invalid date string with 31 days in April", "data": "2020-04-31", "valid": false }, { "description": "a valid date string with 31 days in May", "data": "2020-05-31", "valid": true }, { "description": "a invalid date string with 32 days in May", "data": "2020-05-32", "valid": false }, { "description": "a valid date string with 30 days in June", "data": "2020-06-30", "valid": true }, { "description": "a invalid date string with 31 days in June", "data": "2020-06-31", "valid": false }, { "description": "a valid date string with 31 days in July", "data": "2020-07-31", "valid": true }, { "description": "a invalid date string with 32 days in July", "data": "2020-07-32", "valid": false }, { "description": "a valid date string with 31 days in August", "data": "2020-08-31", "valid": true }, { "description": "a invalid date string with 32 days in August", "data": "2020-08-32", "valid": false }, { "description": "a valid date string with 30 days in September", "data": "2020-09-30", "valid": true }, { "description": "a invalid date string with 31 days in September", "data": "2020-09-31", "valid": false }, { "description": "a valid date string with 31 days in October", "data": "2020-10-31", "valid": true }, { "description": "a invalid date string with 32 days in October", "data": "2020-10-32", "valid": false }, { "description": "a valid date string with 30 days in November", "data": "2020-11-30", "valid": true }, { "description": "a invalid date string with 31 days in November", "data": "2020-11-31", "valid": false }, { "description": "a valid date string with 31 days in December", "data": "2020-12-31", "valid": true }, { "description": "a invalid date string with 32 days in December", "data": "2020-12-32", "valid": false }, { "description": "a invalid date string with invalid month", "data": "2020-13-01", "valid": false }, { "description": "an invalid date string", "data": "06/19/1963", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false }, { "description": "invalidates non-padded month dates", "data": "1998-1-20", "valid": false }, { "description": "invalidates non-padded day dates", "data": "1998-01-1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/uri.json000640 000766 000024 00000001443 14163671560 027150 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/host-name.json000640 000766 000024 00000004101 14163671560 030236 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "host-name" }, "tests": [ { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/ip-address.json000640 000766 000024 00000001202 14163671560 030375 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ip-address" }, "tests": [ { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/time.json000640 000766 000024 00000000666 14163671560 027315 0ustar00etherstaff000000 000000 [ { "description": "validation of time strings", "schema": { "format": "time" }, "tests": [ { "description": "a valid time string", "data": "08:30:06", "valid": true }, { "description": "an invalid time string", "data": "8:30 AM", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/ipv6.json000640 000766 000024 00000004223 14163671560 027234 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/email.json000640 000766 000024 00000003235 14163671560 027441 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/date-time.json000640 000766 000024 00000002264 14163671560 030224 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft3/optional/format/regex.json000640 000766 000024 00000000747 14163671560 027471 0ustar00etherstaff000000 000000 [ { "description": "validation of regular expressions", "schema": { "format": "regex" }, "tests": [ { "description": "a valid regular expression", "data": "([abc])+\\s+$", "valid": true }, { "description": "a regular expression with unclosed parens is invalid", "data": "^(abc]", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/uniqueItems.json000640 000766 000024 00000032740 14163671560 025551 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1, "{}"], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "different objects are unique", "data": [{"a": 1, "b": 2}, {"a": 2, "b": 1}], "valid": true }, { "description": "objects are non-unique despite key order", "data": [{"a": 1, "b": 2}, {"b": 2, "a": 1}], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/minItems.json000640 000766 000024 00000001265 14163671560 025024 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/additionalProperties.json000640 000766 000024 00000007754 14163671560 027435 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "allOf": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in allOf are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/dependencies.json000640 000766 000024 00000012361 14163671560 025664 0ustar00etherstaff000000 000000 [ { "description": "dependencies", "schema": { "dependencies": {"bar": ["foo"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple dependencies", "schema": { "dependencies": {"quux": ["foo", "bar"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "multiple dependencies subschema", "schema": { "dependencies": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false } ] }, { "description": "dependencies with escaped characters", "schema": { "dependencies": { "foo\nbar": ["foo\rbar"], "foo\tbar": { "minProperties": 4 }, "foo'bar": {"required": ["foo\"bar"]}, "foo\"bar": ["foo'bar"] } }, "tests": [ { "description": "valid object 1", "data": { "foo\nbar": 1, "foo\rbar": 2 }, "valid": true }, { "description": "valid object 2", "data": { "foo\tbar": 1, "a": 2, "b": 3, "c": 4 }, "valid": true }, { "description": "valid object 3", "data": { "foo'bar": 1, "foo\"bar": 2 }, "valid": true }, { "description": "invalid object 1", "data": { "foo\nbar": 1, "foo": 2 }, "valid": false }, { "description": "invalid object 2", "data": { "foo\tbar": 1, "a": 2 }, "valid": false }, { "description": "invalid object 3", "data": { "foo'bar": 1 }, "valid": false }, { "description": "invalid object 4", "data": { "foo\"bar": 2 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/anyOf.json000640 000766 000024 00000010771 14163671560 024315 0ustar00etherstaff000000 000000 [ { "description": "anyOf", "schema": { "anyOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first anyOf valid", "data": 1, "valid": true }, { "description": "second anyOf valid", "data": 2.5, "valid": true }, { "description": "both anyOf valid", "data": 3, "valid": true }, { "description": "neither anyOf valid", "data": 1.5, "valid": false } ] }, { "description": "anyOf with base schema", "schema": { "type": "string", "anyOf" : [ { "maxLength": 2 }, { "minLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one anyOf valid", "data": "foobar", "valid": true }, { "description": "both anyOf invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf complex types", "schema": { "anyOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first anyOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second anyOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both anyOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "neither anyOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "anyOf with one empty schema", "schema": { "anyOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is valid", "data": 123, "valid": true } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/not.json000640 000766 000024 00000004332 14163671560 024035 0ustar00etherstaff000000 000000 [ { "description": "not", "schema": { "not": {"type": "integer"} }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "not multiple types", "schema": { "not": {"type": ["integer", "boolean"]} }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "not more complex schema", "schema": { "not": { "type": "object", "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "forbidden property", "schema": { "properties": { "foo": { "not": {} } } }, "tests": [ { "description": "property present", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "property absent", "data": {"bar": 1, "baz": 2}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/items.json000640 000766 000024 00000013271 14163671560 024360 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "length": 1 }, "valid": true } ] }, { "description": "an array of schemas for items", "schema": { "items": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false }, { "description": "incomplete array of items", "data": [ 1 ], "valid": true }, { "description": "array with additional items", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array", "data": [ ], "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "1": "valid", "length": 2 }, "valid": true } ] }, { "description": "items and subitems", "schema": { "definitions": { "item": { "type": "array", "additionalItems": false, "items": [ { "$ref": "#/definitions/sub-item" }, { "$ref": "#/definitions/sub-item" } ] }, "sub-item": { "type": "object", "required": ["foo"] } }, "type": "array", "additionalItems": false, "items": [ { "$ref": "#/definitions/item" }, { "$ref": "#/definitions/item" }, { "$ref": "#/definitions/item" } ] }, "tests": [ { "description": "valid items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": true }, { "description": "too many items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "too many sub-items", "data": [ [ {"foo": null}, {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong item", "data": [ {"foo": null}, [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong sub-item", "data": [ [ {}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "fewer items is valid", "data": [ [ {"foo": null} ], [ {"foo": null} ] ], "valid": true } ] }, { "description": "nested items", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } }, "tests": [ { "description": "valid nested array", "data": [[[[1]], [[2],[3]]], [[[4], [5], [6]]]], "valid": true }, { "description": "nested array with invalid type", "data": [[[["1"]], [[2],[3]]], [[[4], [5], [6]]]], "valid": false }, { "description": "not deep enough", "data": [[[1], [2],[3]], [[4], [5], [6]]], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/enum.json000640 000766 000024 00000014643 14163671560 024207 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false }, { "description": "valid object matches", "data": {"foo": 12}, "valid": true }, { "description": "extra properties in object is invalid", "data": {"foo": 12, "boo": 42}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"]} }, "required": ["bar"] }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "enum with escaped characters", "schema": { "enum": ["foo\nbar", "foo\rbar"] }, "tests": [ { "description": "member 1 is valid", "data": "foo\nbar", "valid": true }, { "description": "member 2 is valid", "data": "foo\rbar", "valid": true }, { "description": "another string is invalid", "data": "abc", "valid": false } ] }, { "description": "enum with false does not match 0", "schema": {"enum": [false]}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true } ] }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/minProperties.json000640 000766 000024 00000001754 14163671560 026102 0ustar00etherstaff000000 000000 [ { "description": "minProperties validation", "schema": {"minProperties": 1}, "tests": [ { "description": "longer is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1}, "valid": true }, { "description": "too short is invalid", "data": {}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/properties.json000640 000766 000024 00000010240 14163671560 025424 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] }, { "description": "properties with escaped characters", "schema": { "properties": { "foo\nbar": {"type": "number"}, "foo\"bar": {"type": "number"}, "foo\\bar": {"type": "number"}, "foo\rbar": {"type": "number"}, "foo\tbar": {"type": "number"}, "foo\fbar": {"type": "number"} } }, "tests": [ { "description": "object with all numbers is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1", "foo\\bar": "1", "foo\rbar": "1", "foo\tbar": "1", "foo\fbar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/maxLength.json000640 000766 000024 00000001600 14163671560 025157 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/infinite-loop-detection.json000640 000766 000024 00000001746 14163671560 027773 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "definitions": { "int": { "type": "integer" } }, "allOf": [ { "properties": { "foo": { "$ref": "#/definitions/int" } } }, { "additionalProperties": { "$ref": "#/definitions/int" } } ] }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/minimum.json000640 000766 000024 00000006170 14163671560 024712 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "minimum validation (explicit false exclusivity)", "schema": {"minimum": 1.1, "exclusiveMinimum": false}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "exclusiveMinimum validation", "schema": { "minimum": 1.1, "exclusiveMinimum": true }, "tests": [ { "description": "above the minimum is still valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/000770 000766 000024 00000000000 14163671560 024166 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/oneOf.json000640 000766 000024 00000013623 14163671560 024306 0ustar00etherstaff000000 000000 [ { "description": "oneOf", "schema": { "oneOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first oneOf valid", "data": 1, "valid": true }, { "description": "second oneOf valid", "data": 2.5, "valid": true }, { "description": "both oneOf valid", "data": 3, "valid": false }, { "description": "neither oneOf valid", "data": 1.5, "valid": false } ] }, { "description": "oneOf with base schema", "schema": { "type": "string", "oneOf" : [ { "minLength": 2 }, { "maxLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one oneOf valid", "data": "foobar", "valid": true }, { "description": "both oneOf valid", "data": "foo", "valid": false } ] }, { "description": "oneOf complex types", "schema": { "oneOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second oneOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both oneOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": false }, { "description": "neither oneOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "oneOf with empty schema", "schema": { "oneOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "one valid - valid", "data": "foo", "valid": true }, { "description": "both valid - invalid", "data": 123, "valid": false } ] }, { "description": "oneOf with required", "schema": { "type": "object", "oneOf": [ { "required": ["foo", "bar"] }, { "required": ["foo", "baz"] } ] }, "tests": [ { "description": "both invalid - invalid", "data": {"bar": 2}, "valid": false }, { "description": "first valid - valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "second valid - valid", "data": {"foo": 1, "baz": 3}, "valid": true }, { "description": "both valid - invalid", "data": {"foo": 1, "bar": 2, "baz" : 3}, "valid": false } ] }, { "description": "oneOf with missing optional property", "schema": { "oneOf": [ { "properties": { "bar": {}, "baz": {} }, "required": ["bar"] }, { "properties": { "foo": {} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid", "data": {"bar": 8}, "valid": true }, { "description": "second oneOf valid", "data": {"foo": "foo"}, "valid": true }, { "description": "both oneOf valid", "data": {"foo": "foo", "bar": 8}, "valid": false }, { "description": "neither oneOf valid", "data": {"baz": "quux"}, "valid": false } ] }, { "description": "nested oneOf, to check validation semantics", "schema": { "oneOf": [ { "oneOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/additionalItems.json000640 000766 000024 00000010373 14163671560 026351 0ustar00etherstaff000000 000000 [ { "description": "additionalItems as schema", "schema": { "items": [{}], "additionalItems": {"type": "integer"} }, "tests": [ { "description": "additional items match schema", "data": [ null, 2, 3, 4 ], "valid": true }, { "description": "additional items do not match schema", "data": [ null, 2, 3, "foo" ], "valid": false } ] }, { "description": "when items is schema, additionalItems does nothing", "schema": { "items": {}, "additionalItems": false }, "tests": [ { "description": "all items match schema", "data": [ 1, 2, 3, 4, 5 ], "valid": true } ] }, { "description": "array of items with no additionalItems permitted", "schema": { "items": [{}, {}, {}], "additionalItems": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "additionalItems as false without items", "schema": {"additionalItems": false}, "tests": [ { "description": "items defaults to empty schema so everything is valid", "data": [ 1, 2, 3, 4, 5 ], "valid": true }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true } ] }, { "description": "additionalItems are allowed by default", "schema": {"items": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] }, { "description": "additionalItems should not look in applicators, valid case", "schema": { "allOf": [ { "items": [ { "type": "integer" } ] } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, null ], "valid": true } ] }, { "description": "additionalItems should not look in applicators, invalid case", "schema": { "allOf": [ { "items": [ { "type": "integer" }, { "type": "string" } ] } ], "items": [ {"type": "integer" } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, "hello" ], "valid": false } ] }, { "description": "items validation adjusts the starting index for additionalItems", "schema": { "items": [ { "type": "string" } ], "additionalItems": { "type": "integer" } }, "tests": [ { "description": "valid items", "data": [ "x", 2, 3 ], "valid": true }, { "description": "wrong type of second item", "data": [ "x", "y" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/pattern.json000640 000766 000024 00000003003 14163671560 024704 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/definitions.json000640 000766 000024 00000001317 14163671560 025550 0ustar00etherstaff000000 000000 [ { "description": "validate definition against metaschema", "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, "tests": [ { "description": "valid definition schema", "data": { "definitions": { "foo": {"type": "integer"} } }, "valid": true }, { "description": "invalid definition schema", "data": { "definitions": { "foo": {"type": 1} } }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/maxProperties.json000640 000766 000024 00000002732 14163671560 026101 0ustar00etherstaff000000 000000 [ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, "tests": [ { "description": "shorter is valid", "data": {"foo": 1}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "too long is invalid", "data": {"foo": 1, "bar": 2, "baz": 3}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "maxProperties = 0 means the object is empty", "schema": { "maxProperties": 0 }, "tests": [ { "description": "no properties is valid", "data": {}, "valid": true }, { "description": "one property is invalid", "data": { "foo": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/required.json000640 000766 000024 00000004433 14163671560 025057 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {}, "bar": {} }, "required": ["foo"] }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required with escaped characters", "schema": { "required": [ "foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar" ] }, "tests": [ { "description": "object with all properties present is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with some properties missing is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/id.json000640 000766 000024 00000003267 14163671560 023637 0ustar00etherstaff000000 000000 [ { "description": "id inside an enum is not a real identifier", "comment": "the implementation must not be confused by an id buried in the enum", "schema": { "definitions": { "id_in_enum": { "enum": [ { "id": "https://localhost:1234/my_identifier.json", "type": "null" } ] }, "real_id_in_schema": { "id": "https://localhost:1234/my_identifier.json", "type": "string" }, "zzz_id_in_const": { "const": { "id": "https://localhost:1234/my_identifier.json", "type": "null" } } }, "anyOf": [ { "$ref": "#/definitions/id_in_enum" }, { "$ref": "https://localhost:1234/my_identifier.json" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "id": "https://localhost:1234/my_identifier.json", "type": "null" }, "valid": true }, { "description": "match $ref to id", "data": "a string to match #/definitions/id_in_enum", "valid": true }, { "description": "no match on enum or $ref to id", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/type.json000640 000766 000024 00000031645 14163671560 024225 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an empty string is still a string", "data": "", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "zero is not a boolean", "data": 0, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an empty string is not a boolean", "data": "", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "true is a boolean", "data": true, "valid": true }, { "description": "false is a boolean", "data": false, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "zero is not null", "data": 0, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an empty string is not null", "data": "", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "true is not null", "data": true, "valid": false }, { "description": "false is not null", "data": false, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type as array with one item", "schema": { "type": ["string"] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is invalid", "data": 123, "valid": false } ] }, { "description": "type: array or object", "schema": { "type": ["array", "object"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type: array, object or null", "schema": { "type": ["array", "object", "null"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/default.json000640 000766 000024 00000004267 14163671560 024670 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/multipleOf.json000640 000766 000024 00000003577 14163671560 025367 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"multipleOf": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"multipleOf": 1.5}, "tests": [ { "description": "zero is multiple of anything", "data": 0, "valid": true }, { "description": "4.5 is multiple of 1.5", "data": 4.5, "valid": true }, { "description": "35 is not multiple of 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"multipleOf": 0.0001}, "tests": [ { "description": "0.0075 is multiple of 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not multiple of 0.0001", "data": 0.00751, "valid": false } ] }, { "description": "invalid instance should not raise error when float division = inf", "schema": {"type": "integer", "multipleOf": 0.123456789}, "tests": [ { "description": "always invalid, but naive implementations may raise an overflow error", "data": 1e308, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/patternProperties.json000640 000766 000024 00000007074 14163671560 026775 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/refRemote.json000640 000766 000024 00000011260 14163671560 025163 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "base URI change", "schema": { "id": "http://localhost:1234/", "items": { "id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "base URI change ref valid", "data": [[1]], "valid": true }, { "description": "base URI change ref invalid", "data": [["a"]], "valid": false } ] }, { "description": "base URI change - change folder", "schema": { "id": "http://localhost:1234/scope_change_defs1.json", "type" : "object", "properties": { "list": {"$ref": "#/definitions/baz"} }, "definitions": { "baz": { "id": "baseUriChangeFolder/", "type": "array", "items": {"$ref": "folderInteger.json"} } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "base URI change - change folder in subschema", "schema": { "id": "http://localhost:1234/scope_change_defs2.json", "type" : "object", "properties": { "list": {"$ref": "#/definitions/baz/definitions/bar"} }, "definitions": { "baz": { "id": "baseUriChangeFolderInSubschema/", "definitions": { "bar": { "type": "array", "items": {"$ref": "folderInteger.json"} } } } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "root ref in remote ref", "schema": { "id": "http://localhost:1234/object", "type": "object", "properties": { "name": {"$ref": "name.json#/definitions/orNull"} } }, "tests": [ { "description": "string is valid", "data": { "name": "foo" }, "valid": true }, { "description": "null is valid", "data": { "name": null }, "valid": true }, { "description": "object is invalid", "data": { "name": { "name": null } }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/allOf.json000640 000766 000024 00000015365 14163671560 024302 0ustar00etherstaff000000 000000 [ { "description": "allOf", "schema": { "allOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "allOf", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch second", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch first", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "allOf with base schema", "schema": { "properties": {"bar": {"type": "integer"}}, "required": ["bar"], "allOf" : [ { "properties": { "foo": {"type": "string"} }, "required": ["foo"] }, { "properties": { "baz": {"type": "null"} }, "required": ["baz"] } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch base schema", "data": {"foo": "quux", "baz": null}, "valid": false }, { "description": "mismatch first allOf", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second allOf", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "allOf simple types", "schema": { "allOf": [ {"maximum": 30}, {"minimum": 20} ] }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch one", "data": 35, "valid": false } ] }, { "description": "allOf with one empty schema", "schema": { "allOf": [ {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with two empty schemas", "schema": { "allOf": [ {}, {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with the first empty schema", "schema": { "allOf": [ {}, { "type": "number" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with the last empty schema", "schema": { "allOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "nested allOf, to check validation semantics", "schema": { "allOf": [ { "allOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "allOf combined with anyOf, oneOf", "schema": { "allOf": [ { "multipleOf": 2 } ], "anyOf": [ { "multipleOf": 3 } ], "oneOf": [ { "multipleOf": 5 } ] }, "tests": [ { "description": "allOf: false, anyOf: false, oneOf: false", "data": 1, "valid": false }, { "description": "allOf: false, anyOf: false, oneOf: true", "data": 5, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: false", "data": 3, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: true", "data": 15, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: false", "data": 2, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: true", "data": 10, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: false", "data": 6, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: true", "data": 30, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/format.json000640 000766 000024 00000014311 14163671560 024523 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv4 format", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "hostname format", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/ref.json000640 000766 000024 00000035133 14163671560 024014 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "items": [ {"type": "integer"}, {"$ref": "#/items/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "definitions": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/definitions/tilde~0field"}, "slash": {"$ref": "#/definitions/slash~1field"}, "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "definitions": { "a": {"type": "integer"}, "b": {"$ref": "#/definitions/a"}, "c": {"$ref": "#/definitions/b"} }, "allOf": [{ "$ref": "#/definitions/c" }] }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref overrides any sibling keywords", "schema": { "definitions": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/definitions/reffed", "maxItems": 2 } } }, "tests": [ { "description": "ref valid", "data": { "foo": [] }, "valid": true }, { "description": "ref valid, maxItems ignored", "data": { "foo": [ 1, 2, 3] }, "valid": true }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "$ref prevents a sibling id from changing the base uri", "schema": { "id": "http://localhost:1234/sibling_id/base/", "definitions": { "foo": { "id": "http://localhost:1234/sibling_id/foo.json", "type": "string" }, "base_foo": { "$comment": "this canonical uri is http://localhost:1234/sibling_id/base/foo.json", "id": "foo.json", "type": "number" } }, "allOf": [ { "$comment": "$ref resolves to http://localhost:1234/sibling_id/base/foo.json, not http://localhost:1234/sibling_id/foo.json", "id": "http://localhost:1234/sibling_id/", "$ref": "foo.json" } ] }, "tests": [ { "description": "$ref resolves to /definitions/base_foo, data does not validate", "data": "a", "valid": false }, { "description": "$ref resolves to /definitions/base_foo, data validates", "data": 1, "valid": true } ] }, { "description": "remote ref, containing refs itself", "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, "tests": [ { "description": "remote ref valid", "data": {"minLength": 1}, "valid": true }, { "description": "remote ref invalid", "data": {"minLength": -1}, "valid": false } ] }, { "description": "property named $ref that is not a reference", "schema": { "properties": { "$ref": {"type": "string"} } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/definitions/is-string"} }, "definitions": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "Recursive references between schemas", "schema": { "id": "http://localhost:1234/tree", "description": "tree of nodes", "type": "object", "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "required": ["meta", "nodes"], "definitions": { "node": { "id": "http://localhost:1234/node", "description": "node", "type": "object", "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} }, "required": ["value"] } } }, "tests": [ { "description": "valid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": 1.1}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": true }, { "description": "invalid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": "string is invalid"}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": false } ] }, { "description": "refs with quote", "schema": { "properties": { "foo\"bar": {"$ref": "#/definitions/foo%22bar"} }, "definitions": { "foo\"bar": {"type": "number"} } }, "tests": [ { "description": "object with numbers is valid", "data": { "foo\"bar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\"bar": "1" }, "valid": false } ] }, { "description": "Location-independent identifier", "schema": { "allOf": [{ "$ref": "#foo" }], "definitions": { "A": { "id": "#foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { "id": "http://localhost:1234/root", "allOf": [{ "$ref": "http://localhost:1234/nested.json#foo" }], "definitions": { "A": { "id": "nested.json", "definitions": { "B": { "id": "#foo", "type": "integer" } } } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "definitions": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/definitions/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/definitions/a_string" }, "valid": true } ] }, { "description": "id must be resolved against nearest parent, not just immediate parent", "schema": { "id": "http://example.com/a.json", "definitions": { "x": { "id": "http://example.com/b/c.json", "not": { "definitions": { "y": { "id": "d.json", "type": "number" } } } } }, "allOf": [ { "$ref": "http://example.com/b/d.json" } ] }, "tests": [ { "description": "number should pass", "data": 1, "valid": true }, { "description": "non-number should fail", "data": "a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/maximum.json000640 000766 000024 00000005262 14163671560 024715 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] }, { "description": "maximum validation (explicit false exclusivity)", "schema": {"maximum": 3.0, "exclusiveMaximum": false}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "exclusiveMaximum validation", "schema": { "maximum": 3.0, "exclusiveMaximum": true }, "tests": [ { "description": "below the maximum is still valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/minLength.json000640 000766 000024 00000001566 14163671560 025170 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/maxItems.json000640 000766 000024 00000001302 14163671560 025016 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/zeroTerminatedFloats.json000640 000766 000024 00000000600 14163671560 031221 0ustar00etherstaff000000 000000 [ { "description": "some languages do not distinguish between different types of numeric value", "schema": { "type": "integer" }, "tests": [ { "description": "a float is not an integer even without fractional part", "data": 1.0, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/bignum.json000640 000766 000024 00000005453 14163671560 026350 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": { "type": "integer" }, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true }, { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": { "type": "number" }, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true }, { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": { "type": "string" }, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": { "maximum": 18446744073709551615 }, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "maximum": 972783798187987123879878123.18878137, "exclusiveMaximum": true }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": { "minimum": -18446744073709551615 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "minimum": -972783798187987123879878123.18878137, "exclusiveMinimum": true }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/unicode.json000644 000766 000024 00000000002 14163671560 026502 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 027546 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/000770 000766 000024 00000000000 14163671560 025456 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/float-overflow.json000640 000766 000024 00000000550 14163671560 030026 0ustar00etherstaff000000 000000 [ { "description": "all integers are multiples of 0.5, if overflow is handled", "schema": {"type": "number", "multipleOf": 0.5}, "tests": [ { "description": "valid if optional overflow handling is implemented", "data": 1e308, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/ecmascript-regex.json000640 000766 000024 00000044173 14163671560 030333 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { "type": "string", "pattern": "^abc$" }, "tests": [ { "description": "matches in Python, but should not in jsonschema", "data": "abc\\n", "valid": false }, { "description": "should match", "data": "abc", "valid": true } ] }, { "description": "ECMA 262 regex converts \\t to horizontal tab", "schema": { "type": "string", "pattern": "^\\t$" }, "tests": [ { "description": "does not match", "data": "\\t", "valid": false }, { "description": "matches", "data": "\u0009", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and upper letter", "schema": { "type": "string", "pattern": "^\\cC$" }, "tests": [ { "description": "does not match", "data": "\\cC", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and lower letter", "schema": { "type": "string", "pattern": "^\\cc$" }, "tests": [ { "description": "does not match", "data": "\\cc", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 \\d matches ascii digits only", "schema": { "type": "string", "pattern": "^\\d$" }, "tests": [ { "description": "ASCII zero matches", "data": "0", "valid": true }, { "description": "NKO DIGIT ZERO does not match (unlike e.g. Python)", "data": "߀", "valid": false }, { "description": "NKO DIGIT ZERO (as \\u escape) does not match", "data": "\u07c0", "valid": false } ] }, { "description": "ECMA 262 \\D matches everything but ascii digits", "schema": { "type": "string", "pattern": "^\\D$" }, "tests": [ { "description": "ASCII zero does not match", "data": "0", "valid": false }, { "description": "NKO DIGIT ZERO matches (unlike e.g. Python)", "data": "߀", "valid": true }, { "description": "NKO DIGIT ZERO (as \\u escape) matches", "data": "\u07c0", "valid": true } ] }, { "description": "ECMA 262 \\w matches ascii letters only", "schema": { "type": "string", "pattern": "^\\w$" }, "tests": [ { "description": "ASCII 'a' matches", "data": "a", "valid": true }, { "description": "latin-1 e-acute does not match (unlike e.g. Python)", "data": "é", "valid": false } ] }, { "description": "ECMA 262 \\W matches everything but ascii letters", "schema": { "type": "string", "pattern": "^\\W$" }, "tests": [ { "description": "ASCII 'a' does not match", "data": "a", "valid": false }, { "description": "latin-1 e-acute matches (unlike e.g. Python)", "data": "é", "valid": true } ] }, { "description": "ECMA 262 \\s matches whitespace", "schema": { "type": "string", "pattern": "^\\s$" }, "tests": [ { "description": "ASCII space matches", "data": " ", "valid": true }, { "description": "Character tabulation matches", "data": "\t", "valid": true }, { "description": "Line tabulation matches", "data": "\u000b", "valid": true }, { "description": "Form feed matches", "data": "\u000c", "valid": true }, { "description": "latin-1 non-breaking-space matches", "data": "\u00a0", "valid": true }, { "description": "zero-width whitespace matches", "data": "\ufeff", "valid": true }, { "description": "line feed matches (line terminator)", "data": "\u000a", "valid": true }, { "description": "paragraph separator matches (line terminator)", "data": "\u2029", "valid": true }, { "description": "EM SPACE matches (Space_Separator)", "data": "\u2003", "valid": true }, { "description": "Non-whitespace control does not match", "data": "\u0001", "valid": false }, { "description": "Non-whitespace does not match", "data": "\u2013", "valid": false } ] }, { "description": "ECMA 262 \\S matches everything but whitespace", "schema": { "type": "string", "pattern": "^\\S$" }, "tests": [ { "description": "ASCII space does not match", "data": " ", "valid": false }, { "description": "Character tabulation does not match", "data": "\t", "valid": false }, { "description": "Line tabulation does not match", "data": "\u000b", "valid": false }, { "description": "Form feed does not match", "data": "\u000c", "valid": false }, { "description": "latin-1 non-breaking-space does not match", "data": "\u00a0", "valid": false }, { "description": "zero-width whitespace does not match", "data": "\ufeff", "valid": false }, { "description": "line feed does not match (line terminator)", "data": "\u000a", "valid": false }, { "description": "paragraph separator does not match (line terminator)", "data": "\u2029", "valid": false }, { "description": "EM SPACE does not match (Space_Separator)", "data": "\u2003", "valid": false }, { "description": "Non-whitespace control matches", "data": "\u0001", "valid": true }, { "description": "Non-whitespace matches", "data": "\u2013", "valid": true } ] }, { "description": "unicode semantics should be used for all pattern matching", "schema": { "pattern": "\\p{Letter}cole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters", "schema": { "pattern": "\\wcole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "pattern": "[a-z]cole" }, "tests": [ { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "ascii characters match", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true } ] }, { "description": "\\d in pattern matches [0-9], not unicode digits", "schema": { "pattern": "^\\d+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "pattern": "^\\p{digit}+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": true } ] }, { "description": "unicode semantics should be used for all patternProperties matching", "schema": { "type": "object", "patternProperties": { "\\p{Letter}cole": {} }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": true }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": true }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters", "schema": { "type": "object", "patternProperties": { "\\wcole": {} }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "type": "object", "patternProperties": { "[a-z]cole": {} }, "additionalProperties": false }, "tests": [ { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "ascii characters match", "data": { "l'ecole": "pas de vraie vie" }, "valid": true } ] }, { "description": "\\d in patternProperties matches [0-9], not unicode digits", "schema": { "type": "object", "patternProperties": { "^\\d+$": {} }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "type": "object", "patternProperties": { "^\\p{digit}+$": {} }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format.json000644 000766 000024 00000000002 14163671560 026344 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/uri.json000640 000766 000024 00000007165 14163671560 027160 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid URL with anchor tag and parentheses", "data": "http://foo.com/blah_(wikipedia)_blah#cite-1", "valid": true }, { "description": "a valid URL with URL-encoded stuff", "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid puny-coded URL ", "data": "http://xn--nw2a.xn--j6w193g/", "valid": true }, { "description": "a valid URL with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid URL based on IPv4", "data": "http://223.255.255.254", "valid": true }, { "description": "a valid URL with ftp scheme", "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt", "valid": true }, { "description": "a valid URL for a simple text file", "data": "http://www.ietf.org/rfc/rfc2396.txt", "valid": true }, { "description": "a valid URL ", "data": "ldap://[2001:db8::7]/c=GB?objectClass?one", "valid": true }, { "description": "a valid mailto URI", "data": "mailto:John.Doe@example.com", "valid": true }, { "description": "a valid newsgroup URI", "data": "news:comp.infosystems.www.servers.unix", "valid": true }, { "description": "a valid tel URI", "data": "tel:+1-816-555-1212", "valid": true }, { "description": "a valid URN", "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid relative URI Reference", "data": "/abc", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false }, { "description": "an invalid URI with spaces", "data": "http:// shouldfail.com", "valid": false }, { "description": "an invalid URI with spaces and missing scheme", "data": ":// should fail", "valid": false }, { "description": "an invalid URI with comma in scheme", "data": "bar,baz:foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/ipv4.json000640 000766 000024 00000005415 14163671560 027237 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false }, { "description": "an IP address without 4 components", "data": "127.0", "valid": false }, { "description": "an IP address as an integer", "data": "0x7f000001", "valid": false }, { "description": "an IP address as an integer (decimal)", "data": "2130706433", "valid": false }, { "description": "leading zeroes should be rejected, as they are treated as octals", "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", "data": "087.10.0.1", "valid": false }, { "description": "value without leading zero is valid", "data": "87.10.0.1", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1২7.0.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/ipv6.json000640 000766 000024 00000015440 14163671560 027240 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "trailing 4 hex symbols is valid", "data": "::abef", "valid": true }, { "description": "trailing 5 hex symbols is invalid", "data": "::abcef", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::42:ff:1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "missing leading octet is invalid", "data": ":2:3:4:5:6:7:8", "valid": false }, { "description": "missing trailing octet is invalid", "data": "1:2:3:4:5:6:7:", "valid": false }, { "description": "missing leading octet with omitted octets later", "data": ":2:3:4::8", "valid": false }, { "description": "single set of double colons in the middle is valid", "data": "1:d6::42", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false }, { "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", "data": "::ffff:192.168.0.1", "valid": true }, { "description": "triple colons is invalid", "data": "1:2:3:4:5:::8", "valid": false }, { "description": "8 octets", "data": "1:2:3:4:5:6:7:8", "valid": true }, { "description": "insufficient octets without double colons", "data": "1:2:3:4:5:6:7", "valid": false }, { "description": "no colons is invalid", "data": "1", "valid": false }, { "description": "ipv4 is not ipv6", "data": "127.0.0.1", "valid": false }, { "description": "ipv4 segment must have 4 octets", "data": "1:2:3:4:1.2.3", "valid": false }, { "description": "leading whitespace is invalid", "data": " ::1", "valid": false }, { "description": "trailing whitespace is invalid", "data": "::1 ", "valid": false }, { "description": "netmask is not a part of ipv6 address", "data": "fe80::/64", "valid": false }, { "description": "zone id is not a part of ipv6 address", "data": "fe80::a%eth1", "valid": false }, { "description": "a long valid ipv6", "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", "valid": true }, { "description": "a long invalid ipv6, below length limit, first", "data": "100:100:100:100:100:100:255.255.255.255.255", "valid": false }, { "description": "a long invalid ipv6, below length limit, second", "data": "100:100:100:100:100:100:100:255.255.255.255", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1:2:3:4:5:6:7:৪", "valid": false }, { "description": "non-ascii digits should be rejected in the ipv4 portion also", "data": "1:2::192.16৪.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/hostname.json000640 000766 000024 00000006224 14163671560 030172 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a valid punycoded IDN hostname", "data": "xn--4gbwdl.xn--wgbh1c", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/email.json000640 000766 000024 00000005104 14163671560 027437 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft4/optional/format/date-time.json000640 000766 000024 00000011064 14163671560 030223 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "a valid date-time string without second fraction", "data": "1963-06-19T08:30:06Z", "valid": true }, { "description": "a valid date-time string with plus offset", "data": "1937-01-01T12:00:27.87+00:20", "valid": true }, { "description": "a valid date-time string with minus offset", "data": "1990-12-31T15:59:50.123-08:00", "valid": true }, { "description": "a valid date-time with a leap second, UTC", "data": "1998-12-31T23:59:60Z", "valid": true }, { "description": "a valid date-time with a leap second, with minus offset", "data": "1998-12-31T15:59:60.123-08:00", "valid": true }, { "description": "an invalid date-time past leap second, UTC", "data": "1998-12-31T23:59:61Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong minute, UTC", "data": "1998-12-31T23:58:60Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong hour, UTC", "data": "1998-12-31T22:59:60Z", "valid": false }, { "description": "an invalid day in date-time string", "data": "1990-02-31T15:59:59.123-08:00", "valid": false }, { "description": "an invalid offset in date-time string", "data": "1990-12-31T15:59:59-24:00", "valid": false }, { "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false }, { "description": "non-ascii digits should be rejected in the date portion", "data": "1963-06-1৪T00:00:00Z", "valid": false }, { "description": "non-ascii digits should be rejected in the time portion", "data": "1963-06-11T0৪:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/recursiveRef.json000640 000766 000024 00000032015 14163671560 026356 0ustar00etherstaff000000 000000 [ { "description": "$recursiveRef without $recursiveAnchor works like $ref", "schema": { "properties": { "foo": { "$recursiveRef": "#" } }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": { "foo": { "foo": false } }, "valid": true }, { "description": "mismatch", "data": { "bar": false }, "valid": false }, { "description": "recursive mismatch", "data": { "foo": { "bar": false } }, "valid": false } ] }, { "description": "$recursiveRef without using nesting", "schema": { "$id": "http://localhost:4242/recursiveRef2/schema.json", "$defs": { "myobject": { "$id": "myobject.json", "$recursiveAnchor": true, "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": { "$recursiveRef": "#" } } ] } }, "anyOf": [ { "type": "integer" }, { "$ref": "#/$defs/myobject" } ] }, "tests": [ { "description": "integer matches at the outer level", "data": 1, "valid": true }, { "description": "single level match", "data": { "foo": "hi" }, "valid": true }, { "description": "integer does not match as a property value", "data": { "foo": 1 }, "valid": false }, { "description": "two levels, properties match with inner definition", "data": { "foo": { "bar": "hi" } }, "valid": true }, { "description": "two levels, no match", "data": { "foo": { "bar": 1 } }, "valid": false } ] }, { "description": "$recursiveRef with nesting", "schema": { "$id": "http://localhost:4242/recursiveRef3/schema.json", "$recursiveAnchor": true, "$defs": { "myobject": { "$id": "myobject.json", "$recursiveAnchor": true, "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": { "$recursiveRef": "#" } } ] } }, "anyOf": [ { "type": "integer" }, { "$ref": "#/$defs/myobject" } ] }, "tests": [ { "description": "integer matches at the outer level", "data": 1, "valid": true }, { "description": "single level match", "data": { "foo": "hi" }, "valid": true }, { "description": "integer now matches as a property value", "data": { "foo": 1 }, "valid": true }, { "description": "two levels, properties match with inner definition", "data": { "foo": { "bar": "hi" } }, "valid": true }, { "description": "two levels, properties match with $recursiveRef", "data": { "foo": { "bar": 1 } }, "valid": true } ] }, { "description": "$recursiveRef with $recursiveAnchor: false works like $ref", "schema": { "$id": "http://localhost:4242/recursiveRef4/schema.json", "$recursiveAnchor": false, "$defs": { "myobject": { "$id": "myobject.json", "$recursiveAnchor": false, "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": { "$recursiveRef": "#" } } ] } }, "anyOf": [ { "type": "integer" }, { "$ref": "#/$defs/myobject" } ] }, "tests": [ { "description": "integer matches at the outer level", "data": 1, "valid": true }, { "description": "single level match", "data": { "foo": "hi" }, "valid": true }, { "description": "integer does not match as a property value", "data": { "foo": 1 }, "valid": false }, { "description": "two levels, properties match with inner definition", "data": { "foo": { "bar": "hi" } }, "valid": true }, { "description": "two levels, integer does not match as a property value", "data": { "foo": { "bar": 1 } }, "valid": false } ] }, { "description": "$recursiveRef with no $recursiveAnchor works like $ref", "schema": { "$id": "http://localhost:4242/recursiveRef5/schema.json", "$defs": { "myobject": { "$id": "myobject.json", "$recursiveAnchor": false, "anyOf": [ { "type": "string" }, { "type": "object", "additionalProperties": { "$recursiveRef": "#" } } ] } }, "anyOf": [ { "type": "integer" }, { "$ref": "#/$defs/myobject" } ] }, "tests": [ { "description": "integer matches at the outer level", "data": 1, "valid": true }, { "description": "single level match", "data": { "foo": "hi" }, "valid": true }, { "description": "integer does not match as a property value", "data": { "foo": 1 }, "valid": false }, { "description": "two levels, properties match with inner definition", "data": { "foo": { "bar": "hi" } }, "valid": true }, { "description": "two levels, integer does not match as a property value", "data": { "foo": { "bar": 1 } }, "valid": false } ] }, { "description": "$recursiveRef with no $recursiveAnchor in the initial target schema resource", "schema": { "$id": "http://localhost:4242/recursiveRef6/base.json", "$recursiveAnchor": true, "anyOf": [ { "type": "boolean" }, { "type": "object", "additionalProperties": { "$id": "http://localhost:4242/recursiveRef6/inner.json", "$comment": "there is no $recursiveAnchor: true here, so we do NOT recurse to the base", "anyOf": [ { "type": "integer" }, { "type": "object", "additionalProperties": { "$recursiveRef": "#" } } ] } } ] }, "tests": [ { "description": "leaf node does not match; no recursion", "data": { "foo": true }, "valid": false }, { "description": "leaf node matches: recursion uses the inner schema", "data": { "foo": { "bar": 1 } }, "valid": true }, { "description": "leaf node does not match: recursion uses the inner schema", "data": { "foo": { "bar": true } }, "valid": false } ] }, { "description": "$recursiveRef with no $recursiveAnchor in the outer schema resource", "schema": { "$id": "http://localhost:4242/recursiveRef7/base.json", "anyOf": [ { "type": "boolean" }, { "type": "object", "additionalProperties": { "$id": "http://localhost:4242/recursiveRef7/inner.json", "$recursiveAnchor": true, "anyOf": [ { "type": "integer" }, { "type": "object", "additionalProperties": { "$recursiveRef": "#" } } ] } } ] }, "tests": [ { "description": "leaf node does not match; no recursion", "data": { "foo": true }, "valid": false }, { "description": "leaf node matches: recursion only uses inner schema", "data": { "foo": { "bar": 1 } }, "valid": true }, { "description": "leaf node does not match: recursion only uses inner schema", "data": { "foo": { "bar": true } }, "valid": false } ] }, { "description": "multiple dynamic paths to the $recursiveRef keyword", "schema": { "$id": "recursiveRef8_main.json", "$defs": { "inner": { "$id": "recursiveRef8_inner.json", "$recursiveAnchor": true, "title": "inner", "additionalProperties": { "$recursiveRef": "#" } } }, "if": { "propertyNames": { "pattern": "^[a-m]" } }, "then": { "title": "any type of node", "$id": "recursiveRef8_anyLeafNode.json", "$recursiveAnchor": true, "$ref": "recursiveRef8_inner.json" }, "else": { "title": "integer node", "$id": "recursiveRef8_integerNode.json", "$recursiveAnchor": true, "type": [ "object", "integer" ], "$ref": "recursiveRef8_inner.json" } }, "tests": [ { "description": "recurse to anyLeafNode - floats are allowed", "data": { "alpha": 1.1 }, "valid": true }, { "description": "recurse to integerNode - floats are not allowed", "data": { "november": 1.1 }, "valid": false } ] }, { "description": "dynamic $recursiveRef destination (not predictable at schema compile time)", "schema": { "$id": "main.json", "$defs": { "inner": { "$id": "inner.json", "$recursiveAnchor": true, "title": "inner", "additionalProperties": { "$recursiveRef": "#" } } }, "if": { "propertyNames": { "pattern": "^[a-m]" } }, "then": { "title": "any type of node", "$id": "anyLeafNode.json", "$recursiveAnchor": true, "$ref": "main.json#/$defs/inner" }, "else": { "title": "integer node", "$id": "integerNode.json", "$recursiveAnchor": true, "type": [ "object", "integer" ], "$ref": "main.json#/$defs/inner" } }, "tests": [ { "description": "numeric node", "data": { "alpha": 1.1 }, "valid": true }, { "description": "integer node", "data": { "november": 1.1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/anchor.json000640 000766 000024 00000011617 14163671560 025171 0ustar00etherstaff000000 000000 [ { "description": "Location-independent identifier", "schema": { "$ref": "#foo", "$defs": { "A": { "$anchor": "foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with absolute URI", "schema": { "$ref": "http://localhost:1234/bar#foo", "$defs": { "A": { "$id": "http://localhost:1234/bar", "$anchor": "foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#foo", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$anchor": "foo", "type": "integer" } } } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "$anchor inside an enum is not a real identifier", "comment": "the implementation must not be confused by an $anchor buried in the enum", "schema": { "$defs": { "anchor_in_enum": { "enum": [ { "$anchor": "my_anchor", "type": "null" } ] }, "real_identifier_in_schema": { "$anchor": "my_anchor", "type": "string" }, "zzz_anchor_in_const": { "const": { "$anchor": "my_anchor", "type": "null" } } }, "anyOf": [ { "$ref": "#/$defs/anchor_in_enum" }, { "$ref": "#my_anchor" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$anchor": "my_anchor", "type": "null" }, "valid": true }, { "description": "in implementations that strip $anchor, this may match either $def", "data": { "type": "null" }, "valid": false }, { "description": "match $ref to $anchor", "data": "a string to match #/$defs/anchor_in_enum", "valid": true }, { "description": "no match on enum or $ref to $anchor", "data": 1, "valid": false } ] }, { "description": "same $anchor with different base uri", "schema": { "$id": "http://localhost:1234/foobar", "$defs": { "A": { "$id": "child1", "allOf": [ { "$id": "child2", "$anchor": "my_anchor", "type": "number" }, { "$anchor": "my_anchor", "type": "string" } ] } }, "$ref": "child1#my_anchor" }, "tests": [ { "description": "$ref should resolve to /$defs/A/allOf/1", "data": "a", "valid": true }, { "description": "$ref should not resolve to /$defs/A/allOf/0", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/content.json000640 000766 000024 00000007777 14163671560 025405 0ustar00etherstaff000000 000000 [ { "description": "validation of string-encoded content based on media type", "schema": { "contentMediaType": "application/json" }, "tests": [ { "description": "a valid JSON document", "data": "{\"foo\": \"bar\"}", "valid": true }, { "description": "an invalid JSON document; validates true", "data": "{:}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary string-encoding", "schema": { "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64 string", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "an invalid base64 string (% is not a valid character); validates true", "data": "eyJmb28iOi%iYmFyIn0K", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "a validly-encoded invalid JSON document; validates true", "data": "ezp9Cg==", "valid": true }, { "description": "an invalid base64 string that is valid JSON; validates true", "data": "{}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents with schema", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64", "contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "another valid base64-encoded JSON document", "data": "eyJib28iOiAyMCwgImZvbyI6ICJiYXoifQ==", "valid": true }, { "description": "an invalid base64-encoded JSON document; validates true", "data": "eyJib28iOiAyMH0=", "valid": true }, { "description": "an empty object as a base64-encoded JSON document; validates true", "data": "e30=", "valid": true }, { "description": "an empty array as a base64-encoded JSON document", "data": "W10=", "valid": true }, { "description": "a validly-encoded invalid JSON document; validates true", "data": "ezp9Cg==", "valid": true }, { "description": "an invalid base64 string that is valid JSON; validates true", "data": "{}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/uniqueItems.json000640 000766 000024 00000032740 14163671560 026227 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1, "{}"], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "different objects are unique", "data": [{"a": 1, "b": 2}, {"a": 2, "b": 1}], "valid": true }, { "description": "objects are non-unique despite key order", "data": [{"a": 1, "b": 2}, {"b": 2, "a": 1}], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/minItems.json000640 000766 000024 00000001265 14163671560 025502 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/additionalProperties.json000640 000766 000024 00000007754 14163671560 030113 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "allOf": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in allOf are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/exclusiveMinimum.json000640 000766 000024 00000001407 14163671560 027256 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMinimum validation", "schema": { "exclusiveMinimum": 1.1 }, "tests": [ { "description": "above the exclusiveMinimum is valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false }, { "description": "below the exclusiveMinimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/const.json000640 000766 000024 00000022564 14163671560 025050 0ustar00etherstaff000000 000000 [ { "description": "const validation", "schema": {"const": 2}, "tests": [ { "description": "same value is valid", "data": 2, "valid": true }, { "description": "another value is invalid", "data": 5, "valid": false }, { "description": "another type is invalid", "data": "a", "valid": false } ] }, { "description": "const with object", "schema": {"const": {"foo": "bar", "baz": "bax"}}, "tests": [ { "description": "same object is valid", "data": {"foo": "bar", "baz": "bax"}, "valid": true }, { "description": "same object with different property order is valid", "data": {"baz": "bax", "foo": "bar"}, "valid": true }, { "description": "another object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "another type is invalid", "data": [1, 2], "valid": false } ] }, { "description": "const with array", "schema": {"const": [{ "foo": "bar" }]}, "tests": [ { "description": "same array is valid", "data": [{"foo": "bar"}], "valid": true }, { "description": "another array item is invalid", "data": [2], "valid": false }, { "description": "array with additional items is invalid", "data": [1, 2, 3], "valid": false } ] }, { "description": "const with null", "schema": {"const": null}, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "not null is invalid", "data": 0, "valid": false } ] }, { "description": "const with false does not match 0", "schema": {"const": false}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "const with true does not match 1", "schema": {"const": true}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "const with [false] does not match [0]", "schema": {"const": [false]}, "tests": [ { "description": "[false] is valid", "data": [false], "valid": true }, { "description": "[0] is invalid", "data": [0], "valid": false }, { "description": "[0.0] is invalid", "data": [0.0], "valid": false } ] }, { "description": "const with [true] does not match [1]", "schema": {"const": [true]}, "tests": [ { "description": "[true] is valid", "data": [true], "valid": true }, { "description": "[1] is invalid", "data": [1], "valid": false }, { "description": "[1.0] is invalid", "data": [1.0], "valid": false } ] }, { "description": "const with {\"a\": false} does not match {\"a\": 0}", "schema": {"const": {"a": false}}, "tests": [ { "description": "{\"a\": false} is valid", "data": {"a": false}, "valid": true }, { "description": "{\"a\": 0} is invalid", "data": {"a": 0}, "valid": false }, { "description": "{\"a\": 0.0} is invalid", "data": {"a": 0.0}, "valid": false } ] }, { "description": "const with {\"a\": true} does not match {\"a\": 1}", "schema": {"const": {"a": true}}, "tests": [ { "description": "{\"a\": true} is valid", "data": {"a": true}, "valid": true }, { "description": "{\"a\": 1} is invalid", "data": {"a": 1}, "valid": false }, { "description": "{\"a\": 1.0} is invalid", "data": {"a": 1.0}, "valid": false } ] }, { "description": "const with 0 does not match other zero-like types", "schema": {"const": 0}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "empty string is invalid", "data": "", "valid": false } ] }, { "description": "const with 1 does not match true", "schema": {"const": 1}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "const with -2.0 matches integer and float types", "schema": {"const": -2.0}, "tests": [ { "description": "integer -2 is valid", "data": -2, "valid": true }, { "description": "integer 2 is invalid", "data": 2, "valid": false }, { "description": "float -2.0 is valid", "data": -2.0, "valid": true }, { "description": "float 2.0 is invalid", "data": 2.0, "valid": false }, { "description": "float -2.00001 is invalid", "data": -2.00001, "valid": false } ] }, { "description": "float and integers are equal up to 64-bit representation limits", "schema": {"const": 9007199254740992}, "tests": [ { "description": "integer is valid", "data": 9007199254740992, "valid": true }, { "description": "integer minus one is invalid", "data": 9007199254740991, "valid": false }, { "description": "float is valid", "data": 9007199254740992.0, "valid": true }, { "description": "float minus one is invalid", "data": 9007199254740991.0, "valid": false } ] }, { "description": "nul characters in strings", "schema": { "const": "hello\u0000there" }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/defs.json000640 000766 000024 00000001040 14163671560 024625 0ustar00etherstaff000000 000000 [ { "description": "validate definition against metaschema", "schema": {"$ref": "https://json-schema.org/draft/2019-09/schema"}, "tests": [ { "description": "valid definition schema", "data": {"$defs": {"foo": {"type": "integer"}}}, "valid": true }, { "description": "invalid definition schema", "data": {"$defs": {"foo": {"type": 1}}}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/anyOf.json000640 000766 000024 00000011333 14163671560 024766 0ustar00etherstaff000000 000000 [ { "description": "anyOf", "schema": { "anyOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first anyOf valid", "data": 1, "valid": true }, { "description": "second anyOf valid", "data": 2.5, "valid": true }, { "description": "both anyOf valid", "data": 3, "valid": true }, { "description": "neither anyOf valid", "data": 1.5, "valid": false } ] }, { "description": "anyOf with base schema", "schema": { "type": "string", "anyOf" : [ { "maxLength": 2 }, { "minLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one anyOf valid", "data": "foobar", "valid": true }, { "description": "both anyOf invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf with boolean schemas, all true", "schema": {"anyOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, some true", "schema": {"anyOf": [true, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, all false", "schema": {"anyOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf complex types", "schema": { "anyOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first anyOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second anyOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both anyOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "neither anyOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "anyOf with one empty schema", "schema": { "anyOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is valid", "data": 123, "valid": true } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/propertyNames.json000640 000766 000024 00000005577 14163671560 026577 0ustar00etherstaff000000 000000 [ { "description": "propertyNames validation", "schema": { "propertyNames": {"maxLength": 3} }, "tests": [ { "description": "all property names valid", "data": { "f": {}, "foo": {} }, "valid": true }, { "description": "some property names invalid", "data": { "foo": {}, "foobar": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [1, 2, 3, 4], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "propertyNames validation with pattern", "schema": { "propertyNames": { "pattern": "^a+$" } }, "tests": [ { "description": "matching property names valid", "data": { "a": {}, "aa": {}, "aaa": {} }, "valid": true }, { "description": "non-matching property name is invalid", "data": { "aaA": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema true", "schema": {"propertyNames": true}, "tests": [ { "description": "object with any properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema false", "schema": {"propertyNames": false}, "tests": [ { "description": "object with any properties is invalid", "data": {"foo": 1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/unknownKeyword.json000640 000766 000024 00000003720 14163671560 026757 0ustar00etherstaff000000 000000 [ { "description": "$id inside an unknown keyword is not a real identifier", "comment": "the implementation must not be confused by an $id in locations we do not know how to parse", "schema": { "$defs": { "id_in_unknown0": { "not": { "array_of_schemas": [ { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "null" } ] } }, "real_id_in_schema": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "string" }, "id_in_unknown1": { "not": { "object_of_schemas": { "foo": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "integer" } } } } }, "anyOf": [ { "$ref": "#/$defs/id_in_unknown0" }, { "$ref": "#/$defs/id_in_unknown1" }, { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" } ] }, "tests": [ { "description": "type matches second anyOf, which has a real schema in it", "data": "a string", "valid": true }, { "description": "type matches non-schema in first anyOf", "data": null, "valid": false }, { "description": "type matches non-schema in third anyOf", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/unevaluatedItems.json000640 000766 000024 00000031672 14163671560 027241 0ustar00etherstaff000000 000000 [ { "description": "unevaluatedItems true", "schema": { "type": "array", "unevaluatedItems": true }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": true } ] }, { "description": "unevaluatedItems false", "schema": { "type": "array", "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": false } ] }, { "description": "unevaluatedItems as schema", "schema": { "type": "array", "unevaluatedItems": { "type": "string" } }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with valid unevaluated items", "data": ["foo"], "valid": true }, { "description": "with invalid unevaluated items", "data": [42], "valid": false } ] }, { "description": "unevaluatedItems with uniform items", "schema": { "type": "array", "items": { "type": "string" }, "unevaluatedItems": false }, "tests": [ { "description": "unevaluatedItems doesn't apply", "data": ["foo", "bar"], "valid": true } ] }, { "description": "unevaluatedItems with tuple", "schema": { "type": "array", "items": [ { "type": "string" } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar"], "valid": false } ] }, { "description": "unevaluatedItems with additionalItems", "schema": { "type": "array", "items": [ { "type": "string" } ], "additionalItems": true, "unevaluatedItems": false }, "tests": [ { "description": "unevaluatedItems doesn't apply", "data": ["foo", 42], "valid": true } ] }, { "description": "unevaluatedItems with nested tuple", "schema": { "type": "array", "items": [ { "type": "string" } ], "allOf": [ { "items": [ true, { "type": "number" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", 42], "valid": true }, { "description": "with unevaluated items", "data": ["foo", 42, true], "valid": false } ] }, { "description": "unevaluatedItems with nested additionalItems", "schema": { "type": "array", "allOf": [ { "items": [ { "type": "string" } ], "additionalItems": true } ], "unevaluatedItems": false }, "tests": [ { "description": "with no additional items", "data": ["foo"], "valid": true }, { "description": "with additional items", "data": ["foo", 42, true], "valid": true } ] }, { "description": "unevaluatedItems with nested unevaluatedItems", "schema": { "type": "array", "allOf": [ { "items": [ { "type": "string" } ] }, { "unevaluatedItems": true } ], "unevaluatedItems": false }, "tests": [ { "description": "with no additional items", "data": ["foo"], "valid": true }, { "description": "with additional items", "data": ["foo", 42, true], "valid": true } ] }, { "description": "unevaluatedItems with anyOf", "schema": { "type": "array", "items": [ { "const": "foo" } ], "anyOf": [ { "items": [ true, { "const": "bar" } ] }, { "items": [ true, true, { "const": "baz" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "when one schema matches and has no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "when one schema matches and has unevaluated items", "data": ["foo", "bar", 42], "valid": false }, { "description": "when two schemas match and has no unevaluated items", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "when two schemas match and has unevaluated items", "data": ["foo", "bar", "baz", 42], "valid": false } ] }, { "description": "unevaluatedItems with oneOf", "schema": { "type": "array", "items": [ { "const": "foo" } ], "oneOf": [ { "items": [ true, { "const": "bar" } ] }, { "items": [ true, { "const": "baz" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar", 42], "valid": false } ] }, { "description": "unevaluatedItems with not", "schema": { "type": "array", "items": [ { "const": "foo" } ], "not": { "not": { "items": [ true, { "const": "bar" } ] } }, "unevaluatedItems": false }, "tests": [ { "description": "with unevaluated items", "data": ["foo", "bar"], "valid": false } ] }, { "description": "unevaluatedItems with if/then/else", "schema": { "type": "array", "items": [ { "const": "foo" } ], "if": { "items": [ true, { "const": "bar" } ] }, "then": { "items": [ true, true, { "const": "then" } ] }, "else": { "items": [ true, true, true, { "const": "else" } ] }, "unevaluatedItems": false }, "tests": [ { "description": "when if matches and it has no unevaluated items", "data": ["foo", "bar", "then"], "valid": true }, { "description": "when if matches and it has unevaluated items", "data": ["foo", "bar", "then", "else"], "valid": false }, { "description": "when if doesn't match and it has no unevaluated items", "data": ["foo", 42, 42, "else"], "valid": true }, { "description": "when if doesn't match and it has unevaluated items", "data": ["foo", 42, 42, "else", 42], "valid": false } ] }, { "description": "unevaluatedItems with boolean schemas", "schema": { "type": "array", "allOf": [true], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": false } ] }, { "description": "unevaluatedItems with $ref", "schema": { "type": "array", "$ref": "#/$defs/bar", "items": [ { "type": "string" } ], "unevaluatedItems": false, "$defs": { "bar": { "items": [ true, { "type": "string" } ] } } }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar", "baz"], "valid": false } ] }, { "description": "unevaluatedItems can't see inside cousins", "schema": { "allOf": [ { "items": [ true ] }, { "unevaluatedItems": false } ] }, "tests": [ { "description": "always fails", "data": [ 1 ], "valid": false } ] }, { "description": "item is evaluated in an uncle schema to unevaluatedItems", "schema": { "type": "object", "properties": { "foo": { "type": "array", "items": [ { "type": "string" } ], "unevaluatedItems": false } }, "anyOf": [ { "properties": { "foo": { "items": [ true, { "type": "string" } ] } } } ] }, "tests": [ { "description": "no extra items", "data": { "foo": [ "test" ] }, "valid": true }, { "description": "uncle keyword evaluation is not significant", "data": { "foo": [ "test", "test" ] }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/vocabulary.json000640 000766 000024 00000002217 14163671560 026062 0ustar00etherstaff000000 000000 [ { "description": "schema that uses custom metaschema with with no validation vocabulary", "schema": { "$id": "https://schema/using/no/validation", "$schema": "http://localhost:1234/draft2019-09/metaschema-no-validation.json", "properties": { "badProperty": false, "numberProperty": { "minimum": 10 } } }, "tests": [ { "description": "applicator vocabulary still works", "data": { "badProperty": "this property should not exist" }, "valid": false }, { "description": "no validation: valid number", "data": { "numberProperty": 20 }, "valid": true }, { "description": "no validation: invalid number, but it still validates", "data": { "numberProperty": 1 }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/boolean_schema.json000640 000766 000024 00000005402 14163671560 026651 0ustar00etherstaff000000 000000 [ { "description": "boolean schema 'true'", "schema": true, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is valid", "data": "foo", "valid": true }, { "description": "boolean true is valid", "data": true, "valid": true }, { "description": "boolean false is valid", "data": false, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "object is valid", "data": {"foo": "bar"}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true }, { "description": "array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "boolean schema 'false'", "schema": false, "tests": [ { "description": "number is invalid", "data": 1, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "boolean true is invalid", "data": true, "valid": false }, { "description": "boolean false is invalid", "data": false, "valid": false }, { "description": "null is invalid", "data": null, "valid": false }, { "description": "object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/not.json000640 000766 000024 00000005376 14163671560 024524 0ustar00etherstaff000000 000000 [ { "description": "not", "schema": { "not": {"type": "integer"} }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "not multiple types", "schema": { "not": {"type": ["integer", "boolean"]} }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "not more complex schema", "schema": { "not": { "type": "object", "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "forbidden property", "schema": { "properties": { "foo": { "not": {} } } }, "tests": [ { "description": "property present", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "property absent", "data": {"bar": 1, "baz": 2}, "valid": true } ] }, { "description": "not with boolean schema true", "schema": {"not": true}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "not with boolean schema false", "schema": {"not": false}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/items.json000640 000766 000024 00000016161 14163671560 025037 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "length": 1 }, "valid": true } ] }, { "description": "an array of schemas for items", "schema": { "items": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false }, { "description": "incomplete array of items", "data": [ 1 ], "valid": true }, { "description": "array with additional items", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array", "data": [ ], "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "1": "valid", "length": 2 }, "valid": true } ] }, { "description": "items with boolean schema (true)", "schema": {"items": true}, "tests": [ { "description": "any array is valid", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schema (false)", "schema": {"items": false}, "tests": [ { "description": "any non-empty array is invalid", "data": [ 1, "foo", true ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schemas", "schema": { "items": [true, false] }, "tests": [ { "description": "array with one item is valid", "data": [ 1 ], "valid": true }, { "description": "array with two items is invalid", "data": [ 1, "foo" ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items and subitems", "schema": { "$defs": { "item": { "type": "array", "additionalItems": false, "items": [ { "$ref": "#/$defs/sub-item" }, { "$ref": "#/$defs/sub-item" } ] }, "sub-item": { "type": "object", "required": ["foo"] } }, "type": "array", "additionalItems": false, "items": [ { "$ref": "#/$defs/item" }, { "$ref": "#/$defs/item" }, { "$ref": "#/$defs/item" } ] }, "tests": [ { "description": "valid items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": true }, { "description": "too many items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "too many sub-items", "data": [ [ {"foo": null}, {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong item", "data": [ {"foo": null}, [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong sub-item", "data": [ [ {}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "fewer items is valid", "data": [ [ {"foo": null} ], [ {"foo": null} ] ], "valid": true } ] }, { "description": "nested items", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } }, "tests": [ { "description": "valid nested array", "data": [[[[1]], [[2],[3]]], [[[4], [5], [6]]]], "valid": true }, { "description": "nested array with invalid type", "data": [[[["1"]], [[2],[3]]], [[[4], [5], [6]]]], "valid": false }, { "description": "not deep enough", "data": [[[1], [2],[3]], [[4], [5], [6]]], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/enum.json000640 000766 000024 00000014643 14163671560 024665 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false }, { "description": "valid object matches", "data": {"foo": 12}, "valid": true }, { "description": "extra properties in object is invalid", "data": {"foo": 12, "boo": 42}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"]} }, "required": ["bar"] }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "enum with escaped characters", "schema": { "enum": ["foo\nbar", "foo\rbar"] }, "tests": [ { "description": "member 1 is valid", "data": "foo\nbar", "valid": true }, { "description": "member 2 is valid", "data": "foo\rbar", "valid": true }, { "description": "another string is invalid", "data": "abc", "valid": false } ] }, { "description": "enum with false does not match 0", "schema": {"enum": [false]}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true } ] }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/minProperties.json000640 000766 000024 00000001754 14163671560 026560 0ustar00etherstaff000000 000000 [ { "description": "minProperties validation", "schema": {"minProperties": 1}, "tests": [ { "description": "longer is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1}, "valid": true }, { "description": "too short is invalid", "data": {}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/minContains.json000640 000766 000024 00000012604 14163671560 026176 0ustar00etherstaff000000 000000 [ { "description": "minContains without contains is ignored", "schema": { "minContains": 1 }, "tests": [ { "description": "one item valid against lone minContains", "data": [ 1 ], "valid": true }, { "description": "zero items still valid against lone minContains", "data": [], "valid": true } ] }, { "description": "minContains=1 with contains", "schema": { "contains": {"const": 1}, "minContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "no elements match", "data": [ 2 ], "valid": false }, { "description": "single element matches, valid minContains", "data": [ 1 ], "valid": true }, { "description": "some elements match, valid minContains", "data": [ 1, 2 ], "valid": true }, { "description": "all elements match, valid minContains", "data": [ 1, 1 ], "valid": true } ] }, { "description": "minContains=2 with contains", "schema": { "contains": {"const": 1}, "minContains": 2 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "all elements match, invalid minContains", "data": [ 1 ], "valid": false }, { "description": "some elements match, invalid minContains", "data": [ 1, 2 ], "valid": false }, { "description": "all elements match, valid minContains (exactly as needed)", "data": [ 1, 1 ], "valid": true }, { "description": "all elements match, valid minContains (more than needed)", "data": [ 1, 1, 1 ], "valid": true }, { "description": "some elements match, valid minContains", "data": [ 1, 2, 1 ], "valid": true } ] }, { "description": "maxContains = minContains", "schema": { "contains": {"const": 1}, "maxContains": 2, "minContains": 2 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "all elements match, invalid minContains", "data": [ 1 ], "valid": false }, { "description": "all elements match, invalid maxContains", "data": [ 1, 1, 1 ], "valid": false }, { "description": "all elements match, valid maxContains and minContains", "data": [ 1, 1 ], "valid": true } ] }, { "description": "maxContains < minContains", "schema": { "contains": {"const": 1}, "maxContains": 1, "minContains": 3 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "invalid minContains", "data": [ 1 ], "valid": false }, { "description": "invalid maxContains", "data": [ 1, 1, 1 ], "valid": false }, { "description": "invalid maxContains and minContains", "data": [ 1, 1 ], "valid": false } ] }, { "description": "minContains = 0 with no maxContains", "schema": { "contains": {"const": 1}, "minContains": 0 }, "tests": [ { "description": "empty data", "data": [ ], "valid": true }, { "description": "minContains = 0 makes contains always pass", "data": [ 2 ], "valid": true } ] }, { "description": "minContains = 0 with maxContains", "schema": { "contains": {"const": 1}, "minContains": 0, "maxContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": true }, { "description": "not more than maxContains", "data": [ 1 ], "valid": true }, { "description": "too many", "data": [ 1, 1 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/properties.json000640 000766 000024 00000012034 14163671560 026105 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] }, { "description": "properties with boolean schema", "schema": { "properties": { "foo": true, "bar": false } }, "tests": [ { "description": "no property present is valid", "data": {}, "valid": true }, { "description": "only 'true' property present is valid", "data": {"foo": 1}, "valid": true }, { "description": "only 'false' property present is invalid", "data": {"bar": 2}, "valid": false }, { "description": "both properties present is invalid", "data": {"foo": 1, "bar": 2}, "valid": false } ] }, { "description": "properties with escaped characters", "schema": { "properties": { "foo\nbar": {"type": "number"}, "foo\"bar": {"type": "number"}, "foo\\bar": {"type": "number"}, "foo\rbar": {"type": "number"}, "foo\tbar": {"type": "number"}, "foo\fbar": {"type": "number"} } }, "tests": [ { "description": "object with all numbers is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1", "foo\\bar": "1", "foo\rbar": "1", "foo\tbar": "1", "foo\fbar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/maxContains.json000640 000766 000024 00000004243 14163671560 026200 0ustar00etherstaff000000 000000 [ { "description": "maxContains without contains is ignored", "schema": { "maxContains": 1 }, "tests": [ { "description": "one item valid against lone maxContains", "data": [ 1 ], "valid": true }, { "description": "two items still valid against lone maxContains", "data": [ 1, 2 ], "valid": true } ] }, { "description": "maxContains with contains", "schema": { "contains": {"const": 1}, "maxContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "all elements match, valid maxContains", "data": [ 1 ], "valid": true }, { "description": "all elements match, invalid maxContains", "data": [ 1, 1 ], "valid": false }, { "description": "some elements match, valid maxContains", "data": [ 1, 2 ], "valid": true }, { "description": "some elements match, invalid maxContains", "data": [ 1, 2, 1 ], "valid": false } ] }, { "description": "minContains < maxContains", "schema": { "contains": {"const": 1}, "minContains": 1, "maxContains": 3 }, "tests": [ { "description": "actual < minContains < maxContains", "data": [ ], "valid": false }, { "description": "minContains < actual < maxContains", "data": [ 1, 1 ], "valid": true }, { "description": "minContains < maxContains < actual", "data": [ 1, 1, 1, 1 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/maxLength.json000640 000766 000024 00000001600 14163671560 025635 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/dependentSchemas.json000640 000766 000024 00000007112 14163671560 027164 0ustar00etherstaff000000 000000 [ { "description": "single dependency", "schema": { "dependentSchemas": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "boolean subschemas", "schema": { "dependentSchemas": { "foo": true, "bar": false } }, "tests": [ { "description": "object with property having schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property having schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "dependencies with escaped characters", "schema": { "dependentSchemas": { "foo\tbar": {"minProperties": 4}, "foo'bar": {"required": ["foo\"bar"]} } }, "tests": [ { "description": "quoted tab", "data": { "foo\tbar": 1, "a": 2, "b": 3, "c": 4 }, "valid": true }, { "description": "quoted quote", "data": { "foo'bar": {"foo\"bar": 1} }, "valid": false }, { "description": "quoted tab invalid under dependent schema", "data": { "foo\tbar": 1, "a": 2 }, "valid": false }, { "description": "quoted quote invalid under dependent schema", "data": {"foo'bar": 1}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/infinite-loop-detection.json000640 000766 000024 00000001724 14163671560 030445 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "$defs": { "int": { "type": "integer" } }, "allOf": [ { "properties": { "foo": { "$ref": "#/$defs/int" } } }, { "additionalProperties": { "$ref": "#/$defs/int" } } ] }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/exclusiveMaximum.json000640 000766 000024 00000001407 14163671560 027260 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMaximum validation", "schema": { "exclusiveMaximum": 3.0 }, "tests": [ { "description": "below the exclusiveMaximum is valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false }, { "description": "above the exclusiveMaximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/minimum.json000640 000766 000024 00000003612 14163671560 025366 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/000770 000766 000024 00000000000 14163671560 024644 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/oneOf.json000640 000766 000024 00000016123 14163671560 024762 0ustar00etherstaff000000 000000 [ { "description": "oneOf", "schema": { "oneOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first oneOf valid", "data": 1, "valid": true }, { "description": "second oneOf valid", "data": 2.5, "valid": true }, { "description": "both oneOf valid", "data": 3, "valid": false }, { "description": "neither oneOf valid", "data": 1.5, "valid": false } ] }, { "description": "oneOf with base schema", "schema": { "type": "string", "oneOf" : [ { "minLength": 2 }, { "maxLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one oneOf valid", "data": "foobar", "valid": true }, { "description": "both oneOf valid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all true", "schema": {"oneOf": [true, true, true]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, one true", "schema": {"oneOf": [true, false, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "oneOf with boolean schemas, more than one true", "schema": {"oneOf": [true, true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all false", "schema": {"oneOf": [false, false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf complex types", "schema": { "oneOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second oneOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both oneOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": false }, { "description": "neither oneOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "oneOf with empty schema", "schema": { "oneOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "one valid - valid", "data": "foo", "valid": true }, { "description": "both valid - invalid", "data": 123, "valid": false } ] }, { "description": "oneOf with required", "schema": { "type": "object", "oneOf": [ { "required": ["foo", "bar"] }, { "required": ["foo", "baz"] } ] }, "tests": [ { "description": "both invalid - invalid", "data": {"bar": 2}, "valid": false }, { "description": "first valid - valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "second valid - valid", "data": {"foo": 1, "baz": 3}, "valid": true }, { "description": "both valid - invalid", "data": {"foo": 1, "bar": 2, "baz" : 3}, "valid": false } ] }, { "description": "oneOf with missing optional property", "schema": { "oneOf": [ { "properties": { "bar": true, "baz": true }, "required": ["bar"] }, { "properties": { "foo": true }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid", "data": {"bar": 8}, "valid": true }, { "description": "second oneOf valid", "data": {"foo": "foo"}, "valid": true }, { "description": "both oneOf valid", "data": {"foo": "foo", "bar": 8}, "valid": false }, { "description": "neither oneOf valid", "data": {"baz": "quux"}, "valid": false } ] }, { "description": "nested oneOf, to check validation semantics", "schema": { "oneOf": [ { "oneOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/if-then-else.json000640 000766 000024 00000015322 14163671560 026174 0ustar00etherstaff000000 000000 [ { "description": "ignore if without then or else", "schema": { "if": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone if", "data": 0, "valid": true }, { "description": "valid when invalid against lone if", "data": "hello", "valid": true } ] }, { "description": "ignore then without if", "schema": { "then": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone then", "data": 0, "valid": true }, { "description": "valid when invalid against lone then", "data": "hello", "valid": true } ] }, { "description": "ignore else without if", "schema": { "else": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone else", "data": 0, "valid": true }, { "description": "valid when invalid against lone else", "data": "hello", "valid": true } ] }, { "description": "if and then without else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid when if test fails", "data": 3, "valid": true } ] }, { "description": "if and else without then", "schema": { "if": { "exclusiveMaximum": 0 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid when if test passes", "data": -1, "valid": true }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "validate against correct branch, then vs else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "non-interference across combined schemas", "schema": { "allOf": [ { "if": { "exclusiveMaximum": 0 } }, { "then": { "minimum": -10 } }, { "else": { "multipleOf": 2 } } ] }, "tests": [ { "description": "valid, but would have been invalid through then", "data": -100, "valid": true }, { "description": "valid, but would have been invalid through else", "data": 3, "valid": true } ] }, { "description": "if with boolean schema true", "schema": { "if": true, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema true in if always chooses the then path (valid)", "data": "then", "valid": true }, { "description": "boolean schema true in if always chooses the then path (invalid)", "data": "else", "valid": false } ] }, { "description": "if with boolean schema false", "schema": { "if": false, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema false in if always chooses the else path (invalid)", "data": "then", "valid": false }, { "description": "boolean schema false in if always chooses the else path (valid)", "data": "else", "valid": true } ] }, { "description": "if appears at the end when serialized (keyword processing sequence)", "schema": { "then": { "const": "yes" }, "else": { "const": "other" }, "if": { "maxLength": 4 } }, "tests": [ { "description": "yes redirects to then and passes", "data": "yes", "valid": true }, { "description": "other redirects to else and passes", "data": "other", "valid": true }, { "description": "no redirects to then and fails", "data": "no", "valid": false }, { "description": "invalid redirects to else and fails", "data": "invalid", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/additionalItems.json000640 000766 000024 00000010373 14163671560 027027 0ustar00etherstaff000000 000000 [ { "description": "additionalItems as schema", "schema": { "items": [{}], "additionalItems": {"type": "integer"} }, "tests": [ { "description": "additional items match schema", "data": [ null, 2, 3, 4 ], "valid": true }, { "description": "additional items do not match schema", "data": [ null, 2, 3, "foo" ], "valid": false } ] }, { "description": "when items is schema, additionalItems does nothing", "schema": { "items": {}, "additionalItems": false }, "tests": [ { "description": "all items match schema", "data": [ 1, 2, 3, 4, 5 ], "valid": true } ] }, { "description": "array of items with no additionalItems permitted", "schema": { "items": [{}, {}, {}], "additionalItems": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "additionalItems as false without items", "schema": {"additionalItems": false}, "tests": [ { "description": "items defaults to empty schema so everything is valid", "data": [ 1, 2, 3, 4, 5 ], "valid": true }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true } ] }, { "description": "additionalItems are allowed by default", "schema": {"items": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] }, { "description": "additionalItems should not look in applicators, valid case", "schema": { "allOf": [ { "items": [ { "type": "integer" } ] } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, null ], "valid": true } ] }, { "description": "additionalItems should not look in applicators, invalid case", "schema": { "allOf": [ { "items": [ { "type": "integer" }, { "type": "string" } ] } ], "items": [ {"type": "integer" } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, "hello" ], "valid": false } ] }, { "description": "items validation adjusts the starting index for additionalItems", "schema": { "items": [ { "type": "string" } ], "additionalItems": { "type": "integer" } }, "tests": [ { "description": "valid items", "data": [ "x", 2, 3 ], "valid": true }, { "description": "wrong type of second item", "data": [ "x", "y" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/pattern.json000640 000766 000024 00000003003 14163671560 025362 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/unevaluatedProperties.json000640 000766 000024 00000111627 14163671560 030313 0ustar00etherstaff000000 000000 [ { "description": "unevaluatedProperties true", "schema": { "type": "object", "unevaluatedProperties": true }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo" }, "valid": true } ] }, { "description": "unevaluatedProperties schema", "schema": { "type": "object", "unevaluatedProperties": { "type": "string", "minLength": 3 } }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with valid unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with invalid unevaluated properties", "data": { "foo": "fo" }, "valid": false } ] }, { "description": "unevaluatedProperties false", "schema": { "type": "object", "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent properties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent patternProperties", "schema": { "type": "object", "patternProperties": { "^foo": { "type": "string" } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent additionalProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "additionalProperties": true, "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with nested properties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "properties": { "bar": { "type": "string" } } } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with nested patternProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "patternProperties": { "^bar": { "type": "string" } } } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with nested additionalProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "additionalProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with nested unevaluatedProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": true } ], "unevaluatedProperties": { "type": "string", "maxLength": 2 } }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with anyOf", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "anyOf": [ { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] }, { "properties": { "baz": { "const": "baz" } }, "required": ["baz"] }, { "properties": { "quux": { "const": "quux" } }, "required": ["quux"] } ], "unevaluatedProperties": false }, "tests": [ { "description": "when one matches and has no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "when one matches and has unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "not-baz" }, "valid": false }, { "description": "when two match and has no unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": true }, { "description": "when two match and has unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz", "quux": "not-quux" }, "valid": false } ] }, { "description": "unevaluatedProperties with oneOf", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "oneOf": [ { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] }, { "properties": { "baz": { "const": "baz" } }, "required": ["baz"] } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar", "quux": "quux" }, "valid": false } ] }, { "description": "unevaluatedProperties with not", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "not": { "not": { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] } }, "unevaluatedProperties": false }, "tests": [ { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "then": { "properties": { "bar": { "type": "string" } }, "required": ["bar"] }, "else": { "properties": { "baz": { "type": "string" } }, "required": ["baz"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": true }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": true }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else, then not defined", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "else": { "properties": { "baz": { "type": "string" } }, "required": ["baz"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": false }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": true }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else, else not defined", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "then": { "properties": { "bar": { "type": "string" } }, "required": ["bar"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": true }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": false }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with dependentSchemas", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "dependentSchemas": { "foo": { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with boolean schemas", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [true], "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with $ref", "schema": { "type": "object", "$ref": "#/$defs/bar", "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false, "$defs": { "bar": { "properties": { "bar": { "type": "string" } } } } }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties can't see inside cousins", "schema": { "allOf": [ { "properties": { "foo": true } }, { "unevaluatedProperties": false } ] }, "tests": [ { "description": "always fails", "data": { "foo": 1 }, "valid": false } ] }, { "description": "nested unevaluatedProperties, outer false, inner true, properties outside", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "nested unevaluatedProperties, outer false, inner true, properties inside", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "nested unevaluatedProperties, outer true, inner false, properties outside", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": false } ], "unevaluatedProperties": true }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": false }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "nested unevaluatedProperties, outer true, inner false, properties inside", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false } ], "unevaluatedProperties": true }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "cousin unevaluatedProperties, true and false, true with properties", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": true }, { "unevaluatedProperties": false } ] }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": false }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "cousin unevaluatedProperties, true and false, false with properties", "schema": { "type": "object", "allOf": [ { "unevaluatedProperties": true }, { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false } ] }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "property is evaluated in an uncle schema to unevaluatedProperties", "comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations", "schema": { "type": "object", "properties": { "foo": { "type": "object", "properties": { "bar": { "type": "string" } }, "unevaluatedProperties": false } }, "anyOf": [ { "properties": { "foo": { "properties": { "faz": { "type": "string" } } } } } ] }, "tests": [ { "description": "no extra properties", "data": { "foo": { "bar": "test" } }, "valid": true }, { "description": "uncle keyword evaluation is not significant", "data": { "foo": { "bar": "test", "faz": "test" } }, "valid": false } ] }, { "description": "in-place applicator siblings, allOf has unevaluated", "schema": { "type": "object", "allOf": [ { "properties": { "foo": true }, "unevaluatedProperties": false } ], "anyOf": [ { "properties": { "bar": true } } ] }, "tests": [ { "description": "base case: both properties present", "data": { "foo": 1, "bar": 1 }, "valid": false }, { "description": "in place applicator siblings, bar is missing", "data": { "foo": 1 }, "valid": true }, { "description": "in place applicator siblings, foo is missing", "data": { "bar": 1 }, "valid": false } ] }, { "description": "in-place applicator siblings, anyOf has unevaluated", "schema": { "type": "object", "allOf": [ { "properties": { "foo": true } } ], "anyOf": [ { "properties": { "bar": true }, "unevaluatedProperties": false } ] }, "tests": [ { "description": "base case: both properties present", "data": { "foo": 1, "bar": 1 }, "valid": false }, { "description": "in place applicator siblings, bar is missing", "data": { "foo": 1 }, "valid": false }, { "description": "in place applicator siblings, foo is missing", "data": { "bar": 1 }, "valid": true } ] }, { "description": "unevaluatedProperties + single cyclic ref", "schema": { "type": "object", "properties": { "x": { "$ref": "#" } }, "unevaluatedProperties": false }, "tests": [ { "description": "Empty is valid", "data": {}, "valid": true }, { "description": "Single is valid", "data": { "x": {} }, "valid": true }, { "description": "Unevaluated on 1st level is invalid", "data": { "x": {}, "y": {} }, "valid": false }, { "description": "Nested is valid", "data": { "x": { "x": {} } }, "valid": true }, { "description": "Unevaluated on 2nd level is invalid", "data": { "x": { "x": {}, "y": {} } }, "valid": false }, { "description": "Deep nested is valid", "data": { "x": { "x": { "x": {} } } }, "valid": true }, { "description": "Unevaluated on 3rd level is invalid", "data": { "x": { "x": { "x": {}, "y": {} } } }, "valid": false } ] }, { "description": "unevaluatedProperties + ref inside allOf / oneOf", "schema": { "$defs": { "one": { "properties": { "a": true } }, "two": { "required": ["x"], "properties": { "x": true } } }, "allOf": [ { "$ref": "#/$defs/one" }, { "properties": { "b": true } }, { "oneOf": [ { "$ref": "#/$defs/two" }, { "required": ["y"], "properties": { "y": true } } ] } ], "unevaluatedProperties": false }, "tests": [ { "description": "Empty is invalid (no x or y)", "data": {}, "valid": false }, { "description": "a and b are invalid (no x or y)", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "x and y are invalid", "data": { "x": 1, "y": 1 }, "valid": false }, { "description": "a and x are valid", "data": { "a": 1, "x": 1 }, "valid": true }, { "description": "a and y are valid", "data": { "a": 1, "y": 1 }, "valid": true }, { "description": "a and b and x are valid", "data": { "a": 1, "b": 1, "x": 1 }, "valid": true }, { "description": "a and b and y are valid", "data": { "a": 1, "b": 1, "y": 1 }, "valid": true }, { "description": "a and b and x and y are invalid", "data": { "a": 1, "b": 1, "x": 1, "y": 1 }, "valid": false } ] }, { "description": "dynamic evalation inside nested refs", "schema": { "$defs": { "one": { "oneOf": [ { "$ref": "#/$defs/two" }, { "required": ["b"], "properties": { "b": true } }, { "required": ["xx"], "patternProperties": { "x": true } }, { "required": ["all"], "unevaluatedProperties": true } ] }, "two": { "oneOf": [ { "required": ["c"], "properties": { "c": true } }, { "required": ["d"], "properties": { "d": true } } ] } }, "oneOf": [ { "$ref": "#/$defs/one" }, { "required": ["a"], "properties": { "a": true } } ], "unevaluatedProperties": false }, "tests": [ { "description": "Empty is invalid", "data": {}, "valid": false }, { "description": "a is valid", "data": { "a": 1 }, "valid": true }, { "description": "b is valid", "data": { "b": 1 }, "valid": true }, { "description": "c is valid", "data": { "c": 1 }, "valid": true }, { "description": "d is valid", "data": { "d": 1 }, "valid": true }, { "description": "a + b is invalid", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "a + c is invalid", "data": { "a": 1, "c": 1 }, "valid": false }, { "description": "a + d is invalid", "data": { "a": 1, "d": 1 }, "valid": false }, { "description": "b + c is invalid", "data": { "b": 1, "c": 1 }, "valid": false }, { "description": "b + d is invalid", "data": { "b": 1, "d": 1 }, "valid": false }, { "description": "c + d is invalid", "data": { "c": 1, "d": 1 }, "valid": false }, { "description": "xx is valid", "data": { "xx": 1 }, "valid": true }, { "description": "xx + foox is valid", "data": { "xx": 1, "foox": 1 }, "valid": true }, { "description": "xx + foo is invalid", "data": { "xx": 1, "foo": 1 }, "valid": false }, { "description": "xx + a is invalid", "data": { "xx": 1, "a": 1 }, "valid": false }, { "description": "xx + b is invalid", "data": { "xx": 1, "b": 1 }, "valid": false }, { "description": "xx + c is invalid", "data": { "xx": 1, "c": 1 }, "valid": false }, { "description": "xx + d is invalid", "data": { "xx": 1, "d": 1 }, "valid": false }, { "description": "all is valid", "data": { "all": 1 }, "valid": true }, { "description": "all + foo is valid", "data": { "all": 1, "foo": 1 }, "valid": true }, { "description": "all + a is invalid", "data": { "all": 1, "a": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/maxProperties.json000640 000766 000024 00000002732 14163671560 026557 0ustar00etherstaff000000 000000 [ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, "tests": [ { "description": "shorter is valid", "data": {"foo": 1}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "too long is invalid", "data": {"foo": 1, "bar": 2, "baz": 3}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "maxProperties = 0 means the object is empty", "schema": { "maxProperties": 0 }, "tests": [ { "description": "no properties is valid", "data": {}, "valid": true }, { "description": "one property is invalid", "data": { "foo": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/dependentRequired.json000640 000766 000024 00000007550 14163671560 027367 0ustar00etherstaff000000 000000 [ { "description": "single dependency", "schema": {"dependentRequired": {"bar": ["foo"]}}, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "empty dependents", "schema": {"dependentRequired": {"bar": []}}, "tests": [ { "description": "empty object", "data": {}, "valid": true }, { "description": "object with one property", "data": {"bar": 2}, "valid": true }, { "description": "non-object is valid", "data": 1, "valid": true } ] }, { "description": "multiple dependents required", "schema": {"dependentRequired": {"quux": ["foo", "bar"]}}, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "dependencies with escaped characters", "schema": { "dependentRequired": { "foo\nbar": ["foo\rbar"], "foo\"bar": ["foo'bar"] } }, "tests": [ { "description": "CRLF", "data": { "foo\nbar": 1, "foo\rbar": 2 }, "valid": true }, { "description": "quoted quotes", "data": { "foo'bar": 1, "foo\"bar": 2 }, "valid": true }, { "description": "CRLF missing dependent", "data": { "foo\nbar": 1, "foo": 2 }, "valid": false }, { "description": "quoted quotes missing dependent", "data": { "foo\"bar": 2 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/required.json000640 000766 000024 00000005206 14163671560 025534 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {}, "bar": {} }, "required": ["foo"] }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required with empty array", "schema": { "properties": { "foo": {} }, "required": [] }, "tests": [ { "description": "property not required", "data": {}, "valid": true } ] }, { "description": "required with escaped characters", "schema": { "required": [ "foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar" ] }, "tests": [ { "description": "object with all properties present is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with some properties missing is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/id.json000640 000766 000024 00000021057 14163671560 024312 0ustar00etherstaff000000 000000 [ { "description": "Invalid use of fragments in location-independent $id", "schema": {"$ref": "https://json-schema.org/draft/2019-09/schema"}, "tests": [ { "description": "Identifier name", "data": { "$ref": "#foo", "$defs": { "A": { "$id": "#foo", "type": "integer" } } }, "valid": false }, { "description": "Identifier name and no ref", "data": { "$defs": { "A": { "$id": "#foo" } } }, "valid": false }, { "description": "Identifier path", "data": { "$ref": "#/a/b", "$defs": { "A": { "$id": "#/a/b", "type": "integer" } } }, "valid": false }, { "description": "Identifier name with absolute URI", "data": { "$ref": "http://localhost:1234/bar#foo", "$defs": { "A": { "$id": "http://localhost:1234/bar#foo", "type": "integer" } } }, "valid": false }, { "description": "Identifier path with absolute URI", "data": { "$ref": "http://localhost:1234/bar#/a/b", "$defs": { "A": { "$id": "http://localhost:1234/bar#/a/b", "type": "integer" } } }, "valid": false }, { "description": "Identifier name with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#foo", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#foo", "type": "integer" } } } } }, "valid": false }, { "description": "Identifier path with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#/a/b", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#/a/b", "type": "integer" } } } } }, "valid": false } ] }, { "description": "Valid use of empty fragments in location-independent $id", "comment": "These are allowed but discouraged", "schema": { "$ref": "https://json-schema.org/draft/2019-09/schema" }, "tests": [ { "description": "Identifier name with absolute URI", "data": { "$ref": "http://localhost:1234/bar", "$defs": { "A": { "$id": "http://localhost:1234/bar#", "type": "integer" } } }, "valid": true }, { "description": "Identifier name with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#/$defs/B", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#", "type": "integer" } } } } }, "valid": true } ] }, { "description": "Unnormalized $ids are allowed but discouraged", "schema": { "$ref": "https://json-schema.org/draft/2019-09/schema" }, "tests": [ { "description": "Unnormalized identifier", "data": { "$ref": "http://localhost:1234/foo/baz", "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier and no ref", "data": { "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier with empty fragment", "data": { "$ref": "http://localhost:1234/foo/baz", "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz#", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier with empty fragment and no ref", "data": { "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz#", "type": "integer" } } }, "valid": true } ] }, { "description": "$id inside an enum is not a real identifier", "comment": "the implementation must not be confused by an $id buried in the enum", "schema": { "$defs": { "id_in_enum": { "enum": [ { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } ] }, "real_id_in_schema": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "string" }, "zzz_id_in_const": { "const": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } } }, "anyOf": [ { "$ref": "#/$defs/id_in_enum" }, { "$ref": "https://localhost:1234/id/my_identifier.json" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" }, "valid": true }, { "description": "match $ref to $id", "data": "a string to match #/$defs/id_in_enum", "valid": true }, { "description": "no match on enum or $ref to $id", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/type.json000640 000766 000024 00000032140 14163671560 024672 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float with zero fractional part is an integer", "data": 1.0, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number (and an integer)", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an empty string is still a string", "data": "", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "zero is not a boolean", "data": 0, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an empty string is not a boolean", "data": "", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "true is a boolean", "data": true, "valid": true }, { "description": "false is a boolean", "data": false, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "zero is not null", "data": 0, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an empty string is not null", "data": "", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "true is not null", "data": true, "valid": false }, { "description": "false is not null", "data": false, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type as array with one item", "schema": { "type": ["string"] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is invalid", "data": 123, "valid": false } ] }, { "description": "type: array or object", "schema": { "type": ["array", "object"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type: array, object or null", "schema": { "type": ["array", "object", "null"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/default.json000640 000766 000024 00000004267 14163671560 025346 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/multipleOf.json000640 000766 000024 00000003577 14163671560 026045 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"multipleOf": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"multipleOf": 1.5}, "tests": [ { "description": "zero is multiple of anything", "data": 0, "valid": true }, { "description": "4.5 is multiple of 1.5", "data": 4.5, "valid": true }, { "description": "35 is not multiple of 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"multipleOf": 0.0001}, "tests": [ { "description": "0.0075 is multiple of 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not multiple of 0.0001", "data": 0.00751, "valid": false } ] }, { "description": "invalid instance should not raise error when float division = inf", "schema": {"type": "integer", "multipleOf": 0.123456789}, "tests": [ { "description": "always invalid, but naive implementations may raise an overflow error", "data": 1e308, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/patternProperties.json000640 000766 000024 00000011251 14163671560 027443 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": ["foo"], "valid": true }, { "description": "ignores strings", "data": "foo", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] }, { "description": "patternProperties with boolean schemas", "schema": { "patternProperties": { "f.*": true, "b.*": false } }, "tests": [ { "description": "object with property matching schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property matching schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "object with a property matching both true and false is invalid", "data": {"foobar":1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/refRemote.json000640 000766 000024 00000012334 14163671560 025644 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "base URI change", "schema": { "$id": "http://localhost:1234/", "items": { "$id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "base URI change ref valid", "data": [[1]], "valid": true }, { "description": "base URI change ref invalid", "data": [["a"]], "valid": false } ] }, { "description": "base URI change - change folder", "schema": { "$id": "http://localhost:1234/scope_change_defs1.json", "type" : "object", "properties": {"list": {"$ref": "baseUriChangeFolder/"}}, "$defs": { "baz": { "$id": "baseUriChangeFolder/", "type": "array", "items": {"$ref": "folderInteger.json"} } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "base URI change - change folder in subschema", "schema": { "$id": "http://localhost:1234/scope_change_defs2.json", "type" : "object", "properties": {"list": {"$ref": "baseUriChangeFolderInSubschema/#/$defs/bar"}}, "$defs": { "baz": { "$id": "baseUriChangeFolderInSubschema/", "$defs": { "bar": { "type": "array", "items": {"$ref": "folderInteger.json"} } } } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "root ref in remote ref", "schema": { "$id": "http://localhost:1234/object", "type": "object", "properties": { "name": {"$ref": "name-defs.json#/$defs/orNull"} } }, "tests": [ { "description": "string is valid", "data": { "name": "foo" }, "valid": true }, { "description": "null is valid", "data": { "name": null }, "valid": true }, { "description": "object is invalid", "data": { "name": { "name": null } }, "valid": false } ] }, { "description": "remote ref with ref to defs", "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "$ref": "ref-and-defs.json" }, "tests": [ { "description": "invalid", "data": { "bar": 1 }, "valid": false }, { "description": "valid", "data": { "bar": "a" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/allOf.json000640 000766 000024 00000017147 14163671560 024760 0ustar00etherstaff000000 000000 [ { "description": "allOf", "schema": { "allOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "allOf", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch second", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch first", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "allOf with base schema", "schema": { "properties": {"bar": {"type": "integer"}}, "required": ["bar"], "allOf" : [ { "properties": { "foo": {"type": "string"} }, "required": ["foo"] }, { "properties": { "baz": {"type": "null"} }, "required": ["baz"] } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch base schema", "data": {"foo": "quux", "baz": null}, "valid": false }, { "description": "mismatch first allOf", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second allOf", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "allOf simple types", "schema": { "allOf": [ {"maximum": 30}, {"minimum": 20} ] }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch one", "data": 35, "valid": false } ] }, { "description": "allOf with boolean schemas, all true", "schema": {"allOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "allOf with boolean schemas, some false", "schema": {"allOf": [true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with boolean schemas, all false", "schema": {"allOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with one empty schema", "schema": { "allOf": [ {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with two empty schemas", "schema": { "allOf": [ {}, {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with the first empty schema", "schema": { "allOf": [ {}, { "type": "number" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with the last empty schema", "schema": { "allOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "nested allOf, to check validation semantics", "schema": { "allOf": [ { "allOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "allOf combined with anyOf, oneOf", "schema": { "allOf": [ { "multipleOf": 2 } ], "anyOf": [ { "multipleOf": 3 } ], "oneOf": [ { "multipleOf": 5 } ] }, "tests": [ { "description": "allOf: false, anyOf: false, oneOf: false", "data": 1, "valid": false }, { "description": "allOf: false, anyOf: false, oneOf: true", "data": 5, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: false", "data": 3, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: true", "data": 15, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: false", "data": 2, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: true", "data": 10, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: false", "data": 6, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: true", "data": 30, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/format.json000640 000766 000024 00000047327 14163671560 025216 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-email format", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "regex format", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv4 format", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-hostname format", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "hostname format", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date format", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "time format", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "json-pointer format", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "relative-json-pointer format", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri format", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri-reference format", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-reference format", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-template format", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uuid format", "schema": { "format": "uuid" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "duration format", "schema": { "format": "duration" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/ref.json000640 000766 000024 00000040526 14163671560 024474 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "items": [ {"type": "integer"}, {"$ref": "#/items/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "$defs": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/$defs/tilde~0field"}, "slash": {"$ref": "#/$defs/slash~1field"}, "percent": {"$ref": "#/$defs/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "$defs": { "a": {"type": "integer"}, "b": {"$ref": "#/$defs/a"}, "c": {"$ref": "#/$defs/b"} }, "$ref": "#/$defs/c" }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref applies alongside sibling keywords", "schema": { "$defs": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/$defs/reffed", "maxItems": 2 } } }, "tests": [ { "description": "ref valid, maxItems valid", "data": { "foo": [] }, "valid": true }, { "description": "ref valid, maxItems invalid", "data": { "foo": [1, 2, 3] }, "valid": false }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "remote ref, containing refs itself", "schema": {"$ref": "https://json-schema.org/draft/2019-09/schema"}, "tests": [ { "description": "remote ref valid", "data": {"minLength": 1}, "valid": true }, { "description": "remote ref invalid", "data": {"minLength": -1}, "valid": false } ] }, { "description": "property named $ref that is not a reference", "schema": { "properties": { "$ref": {"type": "string"} } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/$defs/is-string"} }, "$defs": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "$ref to boolean schema true", "schema": { "$ref": "#/$defs/bool", "$defs": { "bool": true } }, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "$ref to boolean schema false", "schema": { "$ref": "#/$defs/bool", "$defs": { "bool": false } }, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "Recursive references between schemas", "schema": { "$id": "http://localhost:1234/tree", "description": "tree of nodes", "type": "object", "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "required": ["meta", "nodes"], "$defs": { "node": { "$id": "http://localhost:1234/node", "description": "node", "type": "object", "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} }, "required": ["value"] } } }, "tests": [ { "description": "valid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": 1.1}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": true }, { "description": "invalid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": "string is invalid"}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": false } ] }, { "description": "refs with quote", "schema": { "properties": { "foo\"bar": {"$ref": "#/$defs/foo%22bar"} }, "$defs": { "foo\"bar": {"type": "number"} } }, "tests": [ { "description": "object with numbers is valid", "data": { "foo\"bar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\"bar": "1" }, "valid": false } ] }, { "description": "ref creates new scope when adjacent to keywords", "schema": { "$defs": { "A": { "unevaluatedProperties": false } }, "properties": { "prop1": { "type": "string" } }, "$ref": "#/$defs/A" }, "tests": [ { "description": "referenced subschema doesn't see annotations from properties", "data": { "prop1": "match" }, "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "$defs": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/$defs/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "do not evaluate the $ref inside the enum, definition exact match", "data": { "type": "string" }, "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/$defs/a_string" }, "valid": true } ] }, { "description": "refs with relative uris and defs", "schema": { "$id": "http://example.com/schema-relative-uri-defs1.json", "properties": { "foo": { "$id": "schema-relative-uri-defs2.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } }, "$ref": "schema-relative-uri-defs2.json" }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "relative refs with absolute uris and defs", "schema": { "$id": "http://example.com/schema-refs-absolute-uris-defs1.json", "properties": { "foo": { "$id": "http://example.com/schema-refs-absolute-uris-defs2.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } }, "$ref": "schema-refs-absolute-uris-defs2.json" }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "$id must be resolved against nearest parent, not just immediate parent", "schema": { "$id": "http://example.com/a.json", "$defs": { "x": { "$id": "http://example.com/b/c.json", "not": { "$defs": { "y": { "$id": "d.json", "type": "number" } } } } }, "allOf": [ { "$ref": "http://example.com/b/d.json" } ] }, "tests": [ { "description": "number should pass", "data": 1, "valid": true }, { "description": "non-number should fail", "data": "a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/maximum.json000640 000766 000024 00000002704 14163671560 025371 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/minLength.json000640 000766 000024 00000001566 14163671560 025646 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/maxItems.json000640 000766 000024 00000001302 14163671560 025474 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/contains.json000640 000766 000024 00000010272 14163671560 025531 0ustar00etherstaff000000 000000 [ { "description": "contains keyword validation", "schema": { "contains": {"minimum": 5} }, "tests": [ { "description": "array with item matching schema (5) is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with item matching schema (6) is valid", "data": [3, 4, 6], "valid": true }, { "description": "array with two items matching schema (5, 6) is valid", "data": [3, 4, 5, 6], "valid": true }, { "description": "array without items matching schema is invalid", "data": [2, 3, 4], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "not array is valid", "data": {}, "valid": true } ] }, { "description": "contains keyword with const keyword", "schema": { "contains": { "const": 5 } }, "tests": [ { "description": "array with item 5 is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with two items 5 is valid", "data": [3, 4, 5, 5], "valid": true }, { "description": "array without item 5 is invalid", "data": [1, 2, 3, 4], "valid": false } ] }, { "description": "contains keyword with boolean schema true", "schema": {"contains": true}, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] }, { "description": "contains keyword with boolean schema false", "schema": {"contains": false}, "tests": [ { "description": "any non-empty array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "non-arrays are valid", "data": "contains does not apply to strings", "valid": true } ] }, { "description": "items + contains", "schema": { "items": { "multipleOf": 2 }, "contains": { "multipleOf": 3 } }, "tests": [ { "description": "matches items, does not match contains", "data": [ 2, 4, 8 ], "valid": false }, { "description": "does not match items, matches contains", "data": [ 3, 6, 9 ], "valid": false }, { "description": "matches both items and contains", "data": [ 6, 12 ], "valid": true }, { "description": "matches neither items nor contains", "data": [ 1, 5 ], "valid": false } ] }, { "description": "contains with false if subschema", "schema": { "contains": { "if": false, "else": true } }, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/content.json000644 000766 000024 00000000002 14163671560 027204 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/refOfUnknownKeyword.json000640 000766 000024 00000002214 14163671560 031523 0ustar00etherstaff000000 000000 [ { "description": "reference of a root arbitrary keyword ", "schema": { "unknown-keyword": {"type": "integer"}, "properties": { "bar": {"$ref": "#/unknown-keyword"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "reference of an arbitrary keyword of a sub-schema", "schema": { "properties": { "foo": {"unknown-keyword": {"type": "integer"}}, "bar": {"$ref": "#/properties/foo/unknown-keyword"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/bignum.json000640 000766 000024 00000005361 14163671560 027024 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": { "type": "integer" }, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true }, { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": { "type": "number" }, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true }, { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": { "type": "string" }, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": { "maximum": 18446744073709551615 }, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "exclusiveMaximum": 972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": { "minimum": -18446744073709551615 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "exclusiveMinimum": -972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/unicode.json000644 000766 000024 00000000002 14163671560 027160 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 030224 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/000770 000766 000024 00000000000 14163671560 026134 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/float-overflow.json000640 000766 000024 00000000551 14163671560 030505 0ustar00etherstaff000000 000000 [ { "description": "all integers are multiples of 0.5, if overflow is handled", "schema": {"type": "integer", "multipleOf": 0.5}, "tests": [ { "description": "valid if optional overflow handling is implemented", "data": 1e308, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/ecmascript-regex.json000640 000766 000024 00000044205 14163671560 031005 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { "type": "string", "pattern": "^abc$" }, "tests": [ { "description": "matches in Python, but should not in jsonschema", "data": "abc\\n", "valid": false }, { "description": "should match", "data": "abc", "valid": true } ] }, { "description": "ECMA 262 regex converts \\t to horizontal tab", "schema": { "type": "string", "pattern": "^\\t$" }, "tests": [ { "description": "does not match", "data": "\\t", "valid": false }, { "description": "matches", "data": "\u0009", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and upper letter", "schema": { "type": "string", "pattern": "^\\cC$" }, "tests": [ { "description": "does not match", "data": "\\cC", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and lower letter", "schema": { "type": "string", "pattern": "^\\cc$" }, "tests": [ { "description": "does not match", "data": "\\cc", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 \\d matches ascii digits only", "schema": { "type": "string", "pattern": "^\\d$" }, "tests": [ { "description": "ASCII zero matches", "data": "0", "valid": true }, { "description": "NKO DIGIT ZERO does not match (unlike e.g. Python)", "data": "߀", "valid": false }, { "description": "NKO DIGIT ZERO (as \\u escape) does not match", "data": "\u07c0", "valid": false } ] }, { "description": "ECMA 262 \\D matches everything but ascii digits", "schema": { "type": "string", "pattern": "^\\D$" }, "tests": [ { "description": "ASCII zero does not match", "data": "0", "valid": false }, { "description": "NKO DIGIT ZERO matches (unlike e.g. Python)", "data": "߀", "valid": true }, { "description": "NKO DIGIT ZERO (as \\u escape) matches", "data": "\u07c0", "valid": true } ] }, { "description": "ECMA 262 \\w matches ascii letters only", "schema": { "type": "string", "pattern": "^\\w$" }, "tests": [ { "description": "ASCII 'a' matches", "data": "a", "valid": true }, { "description": "latin-1 e-acute does not match (unlike e.g. Python)", "data": "é", "valid": false } ] }, { "description": "ECMA 262 \\W matches everything but ascii letters", "schema": { "type": "string", "pattern": "^\\W$" }, "tests": [ { "description": "ASCII 'a' does not match", "data": "a", "valid": false }, { "description": "latin-1 e-acute matches (unlike e.g. Python)", "data": "é", "valid": true } ] }, { "description": "ECMA 262 \\s matches whitespace", "schema": { "type": "string", "pattern": "^\\s$" }, "tests": [ { "description": "ASCII space matches", "data": " ", "valid": true }, { "description": "Character tabulation matches", "data": "\t", "valid": true }, { "description": "Line tabulation matches", "data": "\u000b", "valid": true }, { "description": "Form feed matches", "data": "\u000c", "valid": true }, { "description": "latin-1 non-breaking-space matches", "data": "\u00a0", "valid": true }, { "description": "zero-width whitespace matches", "data": "\ufeff", "valid": true }, { "description": "line feed matches (line terminator)", "data": "\u000a", "valid": true }, { "description": "paragraph separator matches (line terminator)", "data": "\u2029", "valid": true }, { "description": "EM SPACE matches (Space_Separator)", "data": "\u2003", "valid": true }, { "description": "Non-whitespace control does not match", "data": "\u0001", "valid": false }, { "description": "Non-whitespace does not match", "data": "\u2013", "valid": false } ] }, { "description": "ECMA 262 \\S matches everything but whitespace", "schema": { "type": "string", "pattern": "^\\S$" }, "tests": [ { "description": "ASCII space does not match", "data": " ", "valid": false }, { "description": "Character tabulation does not match", "data": "\t", "valid": false }, { "description": "Line tabulation does not match", "data": "\u000b", "valid": false }, { "description": "Form feed does not match", "data": "\u000c", "valid": false }, { "description": "latin-1 non-breaking-space does not match", "data": "\u00a0", "valid": false }, { "description": "zero-width whitespace does not match", "data": "\ufeff", "valid": false }, { "description": "line feed does not match (line terminator)", "data": "\u000a", "valid": false }, { "description": "paragraph separator does not match (line terminator)", "data": "\u2029", "valid": false }, { "description": "EM SPACE does not match (Space_Separator)", "data": "\u2003", "valid": false }, { "description": "Non-whitespace control matches", "data": "\u0001", "valid": true }, { "description": "Non-whitespace matches", "data": "\u2013", "valid": true } ] }, { "description": "unicode semantics should be used for all pattern matching", "schema": { "pattern": "\\p{Letter}cole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters", "schema": { "pattern": "\\wcole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "pattern": "[a-z]cole" }, "tests": [ { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "ascii characters match", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true } ] }, { "description": "\\d in pattern matches [0-9], not unicode digits", "schema": { "pattern": "^\\d+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "pattern": "^\\p{digit}+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": true } ] }, { "description": "unicode semantics should be used for all patternProperties matching", "schema": { "type": "object", "patternProperties": { "\\p{Letter}cole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": true }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": true }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters", "schema": { "type": "object", "patternProperties": { "\\wcole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "type": "object", "patternProperties": { "[a-z]cole": true }, "additionalProperties": false }, "tests": [ { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "ascii characters match", "data": { "l'ecole": "pas de vraie vie" }, "valid": true } ] }, { "description": "\\d in patternProperties matches [0-9], not unicode digits", "schema": { "type": "object", "patternProperties": { "^\\d+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "type": "object", "patternProperties": { "^\\p{digit}+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/date.json000640 000766 000024 00000016426 14163671560 027754 0ustar00etherstaff000000 000000 [ { "description": "validation of date strings", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date string", "data": "1963-06-19", "valid": true }, { "description": "a valid date string with 31 days in January", "data": "2020-01-31", "valid": true }, { "description": "a invalid date string with 32 days in January", "data": "2020-01-32", "valid": false }, { "description": "a valid date string with 28 days in February (normal)", "data": "2021-02-28", "valid": true }, { "description": "a invalid date string with 29 days in February (normal)", "data": "2021-02-29", "valid": false }, { "description": "a valid date string with 29 days in February (leap)", "data": "2020-02-29", "valid": true }, { "description": "a invalid date string with 30 days in February (leap)", "data": "2020-02-30", "valid": false }, { "description": "a valid date string with 31 days in March", "data": "2020-03-31", "valid": true }, { "description": "a invalid date string with 32 days in March", "data": "2020-03-32", "valid": false }, { "description": "a valid date string with 30 days in April", "data": "2020-04-30", "valid": true }, { "description": "a invalid date string with 31 days in April", "data": "2020-04-31", "valid": false }, { "description": "a valid date string with 31 days in May", "data": "2020-05-31", "valid": true }, { "description": "a invalid date string with 32 days in May", "data": "2020-05-32", "valid": false }, { "description": "a valid date string with 30 days in June", "data": "2020-06-30", "valid": true }, { "description": "a invalid date string with 31 days in June", "data": "2020-06-31", "valid": false }, { "description": "a valid date string with 31 days in July", "data": "2020-07-31", "valid": true }, { "description": "a invalid date string with 32 days in July", "data": "2020-07-32", "valid": false }, { "description": "a valid date string with 31 days in August", "data": "2020-08-31", "valid": true }, { "description": "a invalid date string with 32 days in August", "data": "2020-08-32", "valid": false }, { "description": "a valid date string with 30 days in September", "data": "2020-09-30", "valid": true }, { "description": "a invalid date string with 31 days in September", "data": "2020-09-31", "valid": false }, { "description": "a valid date string with 31 days in October", "data": "2020-10-31", "valid": true }, { "description": "a invalid date string with 32 days in October", "data": "2020-10-32", "valid": false }, { "description": "a valid date string with 30 days in November", "data": "2020-11-30", "valid": true }, { "description": "a invalid date string with 31 days in November", "data": "2020-11-31", "valid": false }, { "description": "a valid date string with 31 days in December", "data": "2020-12-31", "valid": true }, { "description": "a invalid date string with 32 days in December", "data": "2020-12-32", "valid": false }, { "description": "a invalid date string with invalid month", "data": "2020-13-01", "valid": false }, { "description": "an invalid date string", "data": "06/19/1963", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false }, { "description": "non-padded month dates are not valid", "data": "1998-1-20", "valid": false }, { "description": "non-padded day dates are not valid", "data": "1998-01-1", "valid": false }, { "description": "invalid month", "data": "1998-13-01", "valid": false }, { "description": "invalid month-day combination", "data": "1998-04-31", "valid": false }, { "description": "2021 is not a leap year", "data": "2021-02-29", "valid": false }, { "description": "2020 is a leap year", "data": "2020-02-29", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1963-06-1৪", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/json-pointer.json000640 000766 000024 00000015063 14163671560 031462 0ustar00etherstaff000000 000000 [ { "description": "validation of JSON-pointers (JSON String Representation)", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid JSON-pointer", "data": "/foo/bar~0/baz~1/%a", "valid": true }, { "description": "not a valid JSON-pointer (~ not escaped)", "data": "/foo/bar~", "valid": false }, { "description": "valid JSON-pointer with empty segment", "data": "/foo//bar", "valid": true }, { "description": "valid JSON-pointer with the last empty segment", "data": "/foo/bar/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #1", "data": "", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #2", "data": "/foo", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #3", "data": "/foo/0", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #4", "data": "/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #5", "data": "/a~1b", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #6", "data": "/c%d", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #7", "data": "/e^f", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #8", "data": "/g|h", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #9", "data": "/i\\j", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #10", "data": "/k\"l", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #11", "data": "/ ", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #12", "data": "/m~0n", "valid": true }, { "description": "valid JSON-pointer used adding to the last array position", "data": "/foo/-", "valid": true }, { "description": "valid JSON-pointer (- used as object member name)", "data": "/foo/-/bar", "valid": true }, { "description": "valid JSON-pointer (multiple escaped characters)", "data": "/~1~0~0~1~1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #1", "data": "/~1.1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #2", "data": "/~0.1", "valid": true }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #1", "data": "#", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #2", "data": "#/", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #3", "data": "#a", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #1", "data": "/~0~", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #2", "data": "/~0/~", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #1", "data": "/~2", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #2", "data": "/~-1", "valid": false }, { "description": "not a valid JSON-pointer (multiple characters not escaped)", "data": "/~~", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1", "data": "a", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2", "data": "0", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3", "data": "a/a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/idn-hostname.json000640 000766 000024 00000034641 14163671560 031424 0ustar00etherstaff000000 000000 [ { "description": "validation of internationalized host names", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name (example.test in Hangul)", "data": "실례.테스트", "valid": true }, { "description": "illegal first char U+302E Hangul single dot tone mark", "data": "〮실례.테스트", "valid": false }, { "description": "contains illegal char U+302E Hangul single dot tone mark", "data": "실〮례.테스트", "valid": false }, { "description": "a host name with a component too long", "data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트", "valid": false }, { "description": "invalid label, correct Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1", "data": "-> $1.00 <--", "valid": false }, { "description": "valid Chinese Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4", "data": "xn--ihqwcrb4cv8a8dqg056pqjye", "valid": true }, { "description": "invalid Punycode", "comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "xn--X", "valid": false }, { "description": "U-label contains \"--\" in the 3rd and 4th position", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "XN--aa---o47jg78q", "valid": false }, { "description": "U-label starts with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello", "valid": false }, { "description": "U-label ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "hello-", "valid": false }, { "description": "U-label starts and ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello-", "valid": false }, { "description": "Begins with a Spacing Combining Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0903hello", "valid": false }, { "description": "Begins with a Nonspacing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0300hello", "valid": false }, { "description": "Begins with an Enclosing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0488hello", "valid": false }, { "description": "Exceptions that are PVALID, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u00df\u03c2\u0f0b\u3007", "valid": true }, { "description": "Exceptions that are PVALID, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u06fd\u06fe", "valid": true }, { "description": "Exceptions that are DISALLOWED, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u0640\u07fa", "valid": false }, { "description": "Exceptions that are DISALLOWED, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start", "data": "\u3031\u3032\u3033\u3034\u3035\u302e\u302f\u303b", "valid": false }, { "description": "MIDDLE DOT with no preceding 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "a\u00b7l", "valid": false }, { "description": "MIDDLE DOT with nothing preceding", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "\u00b7l", "valid": false }, { "description": "MIDDLE DOT with no following 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7a", "valid": false }, { "description": "MIDDLE DOT with nothing following", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7", "valid": false }, { "description": "MIDDLE DOT with surrounding 'l's", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7l", "valid": true }, { "description": "Greek KERAIA not followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375S", "valid": false }, { "description": "Greek KERAIA not followed by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375", "valid": false }, { "description": "Greek KERAIA followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375\u03b2", "valid": true }, { "description": "Hebrew GERESH not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "A\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05d0\u05f3\u05d1", "valid": true }, { "description": "Hebrew GERSHAYIM not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "A\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05d0\u05f4\u05d1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "def\u30fbabc", "valid": false }, { "description": "KATAKANA MIDDLE DOT with no other characters", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb", "valid": false }, { "description": "KATAKANA MIDDLE DOT with Hiragana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u3041", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Katakana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u30a1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u4e08", "valid": true }, { "description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0660\u06f0", "valid": false }, { "description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0628\u0660\u0628", "valid": true }, { "description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9", "data": "\u06f00", "valid": true }, { "description": "ZERO WIDTH JOINER not preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u094d\u200d\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1", "data": "\u0915\u094d\u200c\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement", "data": "\u0628\u064a\u200c\u0628\u064a", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/uri.json000640 000766 000024 00000007165 14163671560 027636 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid URL with anchor tag and parentheses", "data": "http://foo.com/blah_(wikipedia)_blah#cite-1", "valid": true }, { "description": "a valid URL with URL-encoded stuff", "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid puny-coded URL ", "data": "http://xn--nw2a.xn--j6w193g/", "valid": true }, { "description": "a valid URL with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid URL based on IPv4", "data": "http://223.255.255.254", "valid": true }, { "description": "a valid URL with ftp scheme", "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt", "valid": true }, { "description": "a valid URL for a simple text file", "data": "http://www.ietf.org/rfc/rfc2396.txt", "valid": true }, { "description": "a valid URL ", "data": "ldap://[2001:db8::7]/c=GB?objectClass?one", "valid": true }, { "description": "a valid mailto URI", "data": "mailto:John.Doe@example.com", "valid": true }, { "description": "a valid newsgroup URI", "data": "news:comp.infosystems.www.servers.unix", "valid": true }, { "description": "a valid tel URI", "data": "tel:+1-816-555-1212", "valid": true }, { "description": "a valid URN", "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid relative URI Reference", "data": "/abc", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false }, { "description": "an invalid URI with spaces", "data": "http:// shouldfail.com", "valid": false }, { "description": "an invalid URI with spaces and missing scheme", "data": ":// should fail", "valid": false }, { "description": "an invalid URI with comma in scheme", "data": "bar,baz:foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/uri-template.json000640 000766 000024 00000003431 14163671560 031437 0ustar00etherstaff000000 000000 [ { "description": "format: uri-template", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid uri-template", "data": "http://example.com/dictionary/{term:1}/{term}", "valid": true }, { "description": "an invalid uri-template", "data": "http://example.com/dictionary/{term:1}/{term", "valid": false }, { "description": "a valid uri-template without variables", "data": "http://example.com/dictionary", "valid": true }, { "description": "a valid relative uri-template", "data": "dictionary/{term:1}/{term}", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/iri-reference.json000640 000766 000024 00000004312 14163671560 031545 0ustar00etherstaff000000 000000 [ { "description": "validation of IRI References", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid protocol-relative IRI Reference", "data": "//ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid relative IRI Reference", "data": "/âππ", "valid": true }, { "description": "an invalid IRI Reference", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "a valid IRI Reference", "data": "âππ", "valid": true }, { "description": "a valid IRI fragment", "data": "#ƒrägmênt", "valid": true }, { "description": "an invalid IRI fragment", "data": "#ƒräg\\mênt", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/iri.json000640 000766 000024 00000005324 14163671560 027615 0ustar00etherstaff000000 000000 [ { "description": "validation of IRIs", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI with anchor tag", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid IRI with anchor tag and parentheses", "data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1", "valid": true }, { "description": "a valid IRI with URL-encoded stuff", "data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid IRI with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid IRI based on IPv6", "data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]", "valid": true }, { "description": "an invalid IRI based on IPv6", "data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334", "valid": false }, { "description": "an invalid relative IRI Reference", "data": "/abc", "valid": false }, { "description": "an invalid IRI", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "an invalid IRI though valid IRI reference", "data": "âππ", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/ipv4.json000640 000766 000024 00000005415 14163671560 027715 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false }, { "description": "an IP address without 4 components", "data": "127.0", "valid": false }, { "description": "an IP address as an integer", "data": "0x7f000001", "valid": false }, { "description": "an IP address as an integer (decimal)", "data": "2130706433", "valid": false }, { "description": "leading zeroes should be rejected, as they are treated as octals", "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", "data": "087.10.0.1", "valid": false }, { "description": "value without leading zero is valid", "data": "87.10.0.1", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1২7.0.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/uri-reference.json000640 000766 000024 00000004237 14163671560 031567 0ustar00etherstaff000000 000000 [ { "description": "validation of URI References", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid relative URI Reference", "data": "/abc", "valid": true }, { "description": "an invalid URI Reference", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "a valid URI Reference", "data": "abc", "valid": true }, { "description": "a valid URI fragment", "data": "#fragment", "valid": true }, { "description": "an invalid URI fragment", "data": "#frag\\ment", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/time.json000640 000766 000024 00000015211 14163671560 027764 0ustar00etherstaff000000 000000 [ { "description": "validation of time strings", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid time string", "data": "08:30:06Z", "valid": true }, { "description": "a valid time string with leap second, Zulu", "data": "23:59:60Z", "valid": true }, { "description": "invalid leap second, Zulu (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "invalid leap second, Zulu (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "valid leap second, zero time-offset", "data": "23:59:60+00:00", "valid": true }, { "description": "invalid leap second, zero time-offset (wrong hour)", "data": "22:59:60+00:00", "valid": false }, { "description": "invalid leap second, zero time-offset (wrong minute)", "data": "23:58:60+00:00", "valid": false }, { "description": "valid leap second, positive time-offset", "data": "01:29:60+01:30", "valid": true }, { "description": "valid leap second, large positive time-offset", "data": "23:29:60+23:30", "valid": true }, { "description": "invalid leap second, positive time-offset (wrong hour)", "data": "23:59:60+01:00", "valid": false }, { "description": "invalid leap second, positive time-offset (wrong minute)", "data": "23:59:60+00:30", "valid": false }, { "description": "valid leap second, negative time-offset", "data": "15:59:60-08:00", "valid": true }, { "description": "valid leap second, large negative time-offset", "data": "00:29:60-23:30", "valid": true }, { "description": "invalid leap second, negative time-offset (wrong hour)", "data": "23:59:60-01:00", "valid": false }, { "description": "invalid leap second, negative time-offset (wrong minute)", "data": "23:59:60-00:30", "valid": false }, { "description": "a valid time string with second fraction", "data": "23:20:50.52Z", "valid": true }, { "description": "a valid time string with precise second fraction", "data": "08:30:06.283185Z", "valid": true }, { "description": "a valid time string with plus offset", "data": "08:30:06+00:20", "valid": true }, { "description": "a valid time string with minus offset", "data": "08:30:06-08:00", "valid": true }, { "description": "a valid time string with case-insensitive Z", "data": "08:30:06z", "valid": true }, { "description": "an invalid time string with invalid hour", "data": "24:00:00Z", "valid": false }, { "description": "an invalid time string with invalid minute", "data": "00:60:00Z", "valid": false }, { "description": "an invalid time string with invalid second", "data": "00:00:61Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "an invalid time string with invalid time numoffset hour", "data": "01:02:03+24:00", "valid": false }, { "description": "an invalid time string with invalid time numoffset minute", "data": "01:02:03+00:60", "valid": false }, { "description": "an invalid time string with invalid time with both Z and numoffset", "data": "01:02:03Z+00:30", "valid": false }, { "description": "an invalid offset indicator", "data": "08:30:06 PST", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "01:01:01,1111", "valid": false }, { "description": "no time offset", "data": "12:00:00", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1২:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/ipv6.json000640 000766 000024 00000015440 14163671560 027716 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "trailing 4 hex symbols is valid", "data": "::abef", "valid": true }, { "description": "trailing 5 hex symbols is invalid", "data": "::abcef", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::42:ff:1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "missing leading octet is invalid", "data": ":2:3:4:5:6:7:8", "valid": false }, { "description": "missing trailing octet is invalid", "data": "1:2:3:4:5:6:7:", "valid": false }, { "description": "missing leading octet with omitted octets later", "data": ":2:3:4::8", "valid": false }, { "description": "single set of double colons in the middle is valid", "data": "1:d6::42", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false }, { "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", "data": "::ffff:192.168.0.1", "valid": true }, { "description": "triple colons is invalid", "data": "1:2:3:4:5:::8", "valid": false }, { "description": "8 octets", "data": "1:2:3:4:5:6:7:8", "valid": true }, { "description": "insufficient octets without double colons", "data": "1:2:3:4:5:6:7", "valid": false }, { "description": "no colons is invalid", "data": "1", "valid": false }, { "description": "ipv4 is not ipv6", "data": "127.0.0.1", "valid": false }, { "description": "ipv4 segment must have 4 octets", "data": "1:2:3:4:1.2.3", "valid": false }, { "description": "leading whitespace is invalid", "data": " ::1", "valid": false }, { "description": "trailing whitespace is invalid", "data": "::1 ", "valid": false }, { "description": "netmask is not a part of ipv6 address", "data": "fe80::/64", "valid": false }, { "description": "zone id is not a part of ipv6 address", "data": "fe80::a%eth1", "valid": false }, { "description": "a long valid ipv6", "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", "valid": true }, { "description": "a long invalid ipv6, below length limit, first", "data": "100:100:100:100:100:100:255.255.255.255.255", "valid": false }, { "description": "a long invalid ipv6, below length limit, second", "data": "100:100:100:100:100:100:100:255.255.255.255", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1:2:3:4:5:6:7:৪", "valid": false }, { "description": "non-ascii digits should be rejected in the ipv4 portion also", "data": "1:2::192.16৪.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/hostname.json000640 000766 000024 00000006224 14163671560 030650 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a valid punycoded IDN hostname", "data": "xn--4gbwdl.xn--wgbh1c", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/uuid.json000640 000766 000024 00000005301 14163671560 027773 0ustar00etherstaff000000 000000 [ { "description": "uuid format", "schema": { "format": "uuid" }, "tests": [ { "description": "all upper-case", "data": "2EB8AA08-AA98-11EA-B4AA-73B441D16380", "valid": true }, { "description": "all lower-case", "data": "2eb8aa08-aa98-11ea-b4aa-73b441d16380", "valid": true }, { "description": "mixed case", "data": "2eb8aa08-AA98-11ea-B4Aa-73B441D16380", "valid": true }, { "description": "all zeroes is valid", "data": "00000000-0000-0000-0000-000000000000", "valid": true }, { "description": "wrong length", "data": "2eb8aa08-aa98-11ea-b4aa-73b441d1638", "valid": false }, { "description": "missing section", "data": "2eb8aa08-aa98-11ea-73b441d16380", "valid": false }, { "description": "bad characters (not hex)", "data": "2eb8aa08-aa98-11ea-b4ga-73b441d16380", "valid": false }, { "description": "no dashes", "data": "2eb8aa08aa9811eab4aa73b441d16380", "valid": false }, { "description": "too few dashes", "data": "2eb8aa08aa98-11ea-b4aa73b441d16380", "valid": false }, { "description": "too many dashes", "data": "2eb8-aa08-aa98-11ea-b4aa73b44-1d16380", "valid": false }, { "description": "dashes in the wrong spot", "data": "2eb8aa08aa9811eab4aa73b441d16380----", "valid": false }, { "description": "valid version 4", "data": "98d80576-482e-427f-8434-7f86890ab222", "valid": true }, { "description": "valid version 5", "data": "99c17cbb-656f-564a-940f-1a4568f03487", "valid": true }, { "description": "hypothetical version 6", "data": "99c17cbb-656f-664a-940f-1a4568f03487", "valid": true }, { "description": "hypothetical version 15", "data": "99c17cbb-656f-f64a-940f-1a4568f03487", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/email.json000640 000766 000024 00000005104 14163671560 030115 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/ecmascript-regex.json000644 000766 000024 00000000002 14163671560 032264 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/duration.json000640 000766 000024 00000007342 14163671560 030661 0ustar00etherstaff000000 000000 [ { "description": "validation of duration strings", "schema": { "format": "duration" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid duration string", "data": "P4DT12H30M5S", "valid": true }, { "description": "an invalid duration string", "data": "PT1D", "valid": false }, { "description": "no elements present", "data": "P", "valid": false }, { "description": "no time elements present", "data": "P1YT", "valid": false }, { "description": "no date or time elements present", "data": "PT", "valid": false }, { "description": "elements out of order", "data": "P2D1Y", "valid": false }, { "description": "missing time separator", "data": "P1D2H", "valid": false }, { "description": "time element in the date position", "data": "P2S", "valid": false }, { "description": "four years duration", "data": "P4Y", "valid": true }, { "description": "zero time, in seconds", "data": "PT0S", "valid": true }, { "description": "zero time, in days", "data": "P0D", "valid": true }, { "description": "one month duration", "data": "P1M", "valid": true }, { "description": "one minute duration", "data": "PT1M", "valid": true }, { "description": "one and a half days, in hours", "data": "PT36H", "valid": true }, { "description": "one and a half days, in days and hours", "data": "P1DT12H", "valid": true }, { "description": "two weeks", "data": "P2W", "valid": true }, { "description": "weeks cannot be combined with other units", "data": "P1Y2W", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "P২Y", "valid": false } ] } ] share/tests/draft2019-09/optional/format/relative-json-pointer.json000640 000766 000024 00000005040 14163671560 033206 0ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015[ { "description": "validation of Relative JSON Pointers (RJP)", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid upwards RJP", "data": "1", "valid": true }, { "description": "a valid downwards RJP", "data": "0/foo/bar", "valid": true }, { "description": "a valid up and then down RJP, with array index", "data": "2/0/baz/1/zip", "valid": true }, { "description": "a valid RJP taking the member or index name", "data": "0#", "valid": true }, { "description": "an invalid RJP that is a valid JSON Pointer", "data": "/foo/bar", "valid": false }, { "description": "negative prefix", "data": "-1/foo/bar", "valid": false }, { "description": "## is not a valid json-pointer", "data": "0##", "valid": false }, { "description": "zero cannot be followed by other digits, plus json-pointer", "data": "01/a", "valid": false }, { "description": "zero cannot be followed by other digits, plus octothorpe", "data": "01#", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/date-time.json000640 000766 000024 00000011064 14163671560 030701 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "a valid date-time string without second fraction", "data": "1963-06-19T08:30:06Z", "valid": true }, { "description": "a valid date-time string with plus offset", "data": "1937-01-01T12:00:27.87+00:20", "valid": true }, { "description": "a valid date-time string with minus offset", "data": "1990-12-31T15:59:50.123-08:00", "valid": true }, { "description": "a valid date-time with a leap second, UTC", "data": "1998-12-31T23:59:60Z", "valid": true }, { "description": "a valid date-time with a leap second, with minus offset", "data": "1998-12-31T15:59:60.123-08:00", "valid": true }, { "description": "an invalid date-time past leap second, UTC", "data": "1998-12-31T23:59:61Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong minute, UTC", "data": "1998-12-31T23:58:60Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong hour, UTC", "data": "1998-12-31T22:59:60Z", "valid": false }, { "description": "an invalid day in date-time string", "data": "1990-02-31T15:59:59.123-08:00", "valid": false }, { "description": "an invalid offset in date-time string", "data": "1990-12-31T15:59:59-24:00", "valid": false }, { "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false }, { "description": "non-ascii digits should be rejected in the date portion", "data": "1963-06-1৪T00:00:00Z", "valid": false }, { "description": "non-ascii digits should be rejected in the time portion", "data": "1963-06-11T0৪:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/regex.json000640 000766 000024 00000002616 14163671560 030145 0ustar00etherstaff000000 000000 [ { "description": "validation of regular expressions", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid regular expression", "data": "([abc])+\\s+$", "valid": true }, { "description": "a regular expression with unclosed parens is invalid", "data": "^(abc]", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2019-09/optional/format/idn-email.json000640 000766 000024 00000003354 14163671560 030672 0ustar00etherstaff000000 000000 [ { "description": "validation of an internationalized e-mail addresses", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid idn e-mail (example@example.test in Hangul)", "data": "실례@실례.테스트", "valid": true }, { "description": "an invalid idn e-mail address", "data": "2962", "valid": false }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/anchor.json000640 000766 000024 00000011617 14163671560 025403 0ustar00etherstaff000000 000000 [ { "description": "Location-independent identifier", "schema": { "$ref": "#foo", "$defs": { "A": { "$anchor": "foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with absolute URI", "schema": { "$ref": "http://localhost:1234/bar#foo", "$defs": { "A": { "$id": "http://localhost:1234/bar", "$anchor": "foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#foo", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$anchor": "foo", "type": "integer" } } } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "$anchor inside an enum is not a real identifier", "comment": "the implementation must not be confused by an $anchor buried in the enum", "schema": { "$defs": { "anchor_in_enum": { "enum": [ { "$anchor": "my_anchor", "type": "null" } ] }, "real_identifier_in_schema": { "$anchor": "my_anchor", "type": "string" }, "zzz_anchor_in_const": { "const": { "$anchor": "my_anchor", "type": "null" } } }, "anyOf": [ { "$ref": "#/$defs/anchor_in_enum" }, { "$ref": "#my_anchor" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$anchor": "my_anchor", "type": "null" }, "valid": true }, { "description": "in implementations that strip $anchor, this may match either $def", "data": { "type": "null" }, "valid": false }, { "description": "match $ref to $anchor", "data": "a string to match #/$defs/anchor_in_enum", "valid": true }, { "description": "no match on enum or $ref to $anchor", "data": 1, "valid": false } ] }, { "description": "same $anchor with different base uri", "schema": { "$id": "http://localhost:1234/foobar", "$defs": { "A": { "$id": "child1", "allOf": [ { "$id": "child2", "$anchor": "my_anchor", "type": "number" }, { "$anchor": "my_anchor", "type": "string" } ] } }, "$ref": "child1#my_anchor" }, "tests": [ { "description": "$ref should resolve to /$defs/A/allOf/1", "data": "a", "valid": true }, { "description": "$ref should not resolve to /$defs/A/allOf/0", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/content.json000640 000766 000024 00000007777 14163671560 025617 0ustar00etherstaff000000 000000 [ { "description": "validation of string-encoded content based on media type", "schema": { "contentMediaType": "application/json" }, "tests": [ { "description": "a valid JSON document", "data": "{\"foo\": \"bar\"}", "valid": true }, { "description": "an invalid JSON document; validates true", "data": "{:}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary string-encoding", "schema": { "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64 string", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "an invalid base64 string (% is not a valid character); validates true", "data": "eyJmb28iOi%iYmFyIn0K", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "a validly-encoded invalid JSON document; validates true", "data": "ezp9Cg==", "valid": true }, { "description": "an invalid base64 string that is valid JSON; validates true", "data": "{}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents with schema", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64", "contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "another valid base64-encoded JSON document", "data": "eyJib28iOiAyMCwgImZvbyI6ICJiYXoifQ==", "valid": true }, { "description": "an invalid base64-encoded JSON document; validates true", "data": "eyJib28iOiAyMH0=", "valid": true }, { "description": "an empty object as a base64-encoded JSON document; validates true", "data": "e30=", "valid": true }, { "description": "an empty array as a base64-encoded JSON document", "data": "W10=", "valid": true }, { "description": "a validly-encoded invalid JSON document; validates true", "data": "ezp9Cg==", "valid": true }, { "description": "an invalid base64 string that is valid JSON; validates true", "data": "{}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/uniqueItems.json000640 000766 000024 00000032744 14163671560 026445 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1, "{}"], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "different objects are unique", "data": [{"a": 1, "b": 2}, {"a": 2, "b": 1}], "valid": true }, { "description": "objects are non-unique despite key order", "data": [{"a": 1, "b": 2}, {"b": 2, "a": 1}], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "items": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "items": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/minItems.json000640 000766 000024 00000001265 14163671560 025714 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/additionalProperties.json000640 000766 000024 00000007754 14163671560 030325 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "allOf": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in allOf are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/exclusiveMinimum.json000640 000766 000024 00000001407 14163671560 027470 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMinimum validation", "schema": { "exclusiveMinimum": 1.1 }, "tests": [ { "description": "above the exclusiveMinimum is valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false }, { "description": "below the exclusiveMinimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/const.json000640 000766 000024 00000022564 14163671560 025262 0ustar00etherstaff000000 000000 [ { "description": "const validation", "schema": {"const": 2}, "tests": [ { "description": "same value is valid", "data": 2, "valid": true }, { "description": "another value is invalid", "data": 5, "valid": false }, { "description": "another type is invalid", "data": "a", "valid": false } ] }, { "description": "const with object", "schema": {"const": {"foo": "bar", "baz": "bax"}}, "tests": [ { "description": "same object is valid", "data": {"foo": "bar", "baz": "bax"}, "valid": true }, { "description": "same object with different property order is valid", "data": {"baz": "bax", "foo": "bar"}, "valid": true }, { "description": "another object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "another type is invalid", "data": [1, 2], "valid": false } ] }, { "description": "const with array", "schema": {"const": [{ "foo": "bar" }]}, "tests": [ { "description": "same array is valid", "data": [{"foo": "bar"}], "valid": true }, { "description": "another array item is invalid", "data": [2], "valid": false }, { "description": "array with additional items is invalid", "data": [1, 2, 3], "valid": false } ] }, { "description": "const with null", "schema": {"const": null}, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "not null is invalid", "data": 0, "valid": false } ] }, { "description": "const with false does not match 0", "schema": {"const": false}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "const with true does not match 1", "schema": {"const": true}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "const with [false] does not match [0]", "schema": {"const": [false]}, "tests": [ { "description": "[false] is valid", "data": [false], "valid": true }, { "description": "[0] is invalid", "data": [0], "valid": false }, { "description": "[0.0] is invalid", "data": [0.0], "valid": false } ] }, { "description": "const with [true] does not match [1]", "schema": {"const": [true]}, "tests": [ { "description": "[true] is valid", "data": [true], "valid": true }, { "description": "[1] is invalid", "data": [1], "valid": false }, { "description": "[1.0] is invalid", "data": [1.0], "valid": false } ] }, { "description": "const with {\"a\": false} does not match {\"a\": 0}", "schema": {"const": {"a": false}}, "tests": [ { "description": "{\"a\": false} is valid", "data": {"a": false}, "valid": true }, { "description": "{\"a\": 0} is invalid", "data": {"a": 0}, "valid": false }, { "description": "{\"a\": 0.0} is invalid", "data": {"a": 0.0}, "valid": false } ] }, { "description": "const with {\"a\": true} does not match {\"a\": 1}", "schema": {"const": {"a": true}}, "tests": [ { "description": "{\"a\": true} is valid", "data": {"a": true}, "valid": true }, { "description": "{\"a\": 1} is invalid", "data": {"a": 1}, "valid": false }, { "description": "{\"a\": 1.0} is invalid", "data": {"a": 1.0}, "valid": false } ] }, { "description": "const with 0 does not match other zero-like types", "schema": {"const": 0}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "empty string is invalid", "data": "", "valid": false } ] }, { "description": "const with 1 does not match true", "schema": {"const": 1}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "const with -2.0 matches integer and float types", "schema": {"const": -2.0}, "tests": [ { "description": "integer -2 is valid", "data": -2, "valid": true }, { "description": "integer 2 is invalid", "data": 2, "valid": false }, { "description": "float -2.0 is valid", "data": -2.0, "valid": true }, { "description": "float 2.0 is invalid", "data": 2.0, "valid": false }, { "description": "float -2.00001 is invalid", "data": -2.00001, "valid": false } ] }, { "description": "float and integers are equal up to 64-bit representation limits", "schema": {"const": 9007199254740992}, "tests": [ { "description": "integer is valid", "data": 9007199254740992, "valid": true }, { "description": "integer minus one is invalid", "data": 9007199254740991, "valid": false }, { "description": "float is valid", "data": 9007199254740992.0, "valid": true }, { "description": "float minus one is invalid", "data": 9007199254740991.0, "valid": false } ] }, { "description": "nul characters in strings", "schema": { "const": "hello\u0000there" }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/defs.json000640 000766 000024 00000001063 14163671560 025044 0ustar00etherstaff000000 000000 [ { "description": "validate definition against metaschema", "schema": { "$ref": "https://json-schema.org/draft/next/schema" }, "tests": [ { "description": "valid definition schema", "data": {"$defs": {"foo": {"type": "integer"}}}, "valid": true }, { "description": "invalid definition schema", "data": {"$defs": {"foo": {"type": 1}}}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/anyOf.json000640 000766 000024 00000011333 14163671560 025200 0ustar00etherstaff000000 000000 [ { "description": "anyOf", "schema": { "anyOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first anyOf valid", "data": 1, "valid": true }, { "description": "second anyOf valid", "data": 2.5, "valid": true }, { "description": "both anyOf valid", "data": 3, "valid": true }, { "description": "neither anyOf valid", "data": 1.5, "valid": false } ] }, { "description": "anyOf with base schema", "schema": { "type": "string", "anyOf" : [ { "maxLength": 2 }, { "minLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one anyOf valid", "data": "foobar", "valid": true }, { "description": "both anyOf invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf with boolean schemas, all true", "schema": {"anyOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, some true", "schema": {"anyOf": [true, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, all false", "schema": {"anyOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf complex types", "schema": { "anyOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first anyOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second anyOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both anyOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "neither anyOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "anyOf with one empty schema", "schema": { "anyOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is valid", "data": 123, "valid": true } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/propertyNames.json000640 000766 000024 00000004130 14163671560 026771 0ustar00etherstaff000000 000000 [ { "description": "propertyNames validation", "schema": { "propertyNames": {"maxLength": 3} }, "tests": [ { "description": "all property names valid", "data": { "f": {}, "foo": {} }, "valid": true }, { "description": "some property names invalid", "data": { "foo": {}, "foobar": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [1, 2, 3, 4], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "propertyNames with boolean schema true", "schema": {"propertyNames": true}, "tests": [ { "description": "object with any properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema false", "schema": {"propertyNames": false}, "tests": [ { "description": "object with any properties is invalid", "data": {"foo": 1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/unknownKeyword.json000640 000766 000024 00000003720 14163671560 027171 0ustar00etherstaff000000 000000 [ { "description": "$id inside an unknown keyword is not a real identifier", "comment": "the implementation must not be confused by an $id in locations we do not know how to parse", "schema": { "$defs": { "id_in_unknown0": { "not": { "array_of_schemas": [ { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "null" } ] } }, "real_id_in_schema": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "string" }, "id_in_unknown1": { "not": { "object_of_schemas": { "foo": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "integer" } } } } }, "anyOf": [ { "$ref": "#/$defs/id_in_unknown0" }, { "$ref": "#/$defs/id_in_unknown1" }, { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" } ] }, "tests": [ { "description": "type matches second anyOf, which has a real schema in it", "data": "a string", "valid": true }, { "description": "type matches non-schema in first anyOf", "data": null, "valid": false }, { "description": "type matches non-schema in third anyOf", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/unevaluatedItems.json000640 000766 000024 00000040454 14163671560 027451 0ustar00etherstaff000000 000000 [ { "description": "unevaluatedItems true", "schema": { "type": "array", "unevaluatedItems": true }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": true } ] }, { "description": "unevaluatedItems false", "schema": { "type": "array", "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": false } ] }, { "description": "unevaluatedItems as schema", "schema": { "type": "array", "unevaluatedItems": { "type": "string" } }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with valid unevaluated items", "data": ["foo"], "valid": true }, { "description": "with invalid unevaluated items", "data": [42], "valid": false } ] }, { "description": "unevaluatedItems with uniform items", "schema": { "type": "array", "items": { "type": "string" }, "unevaluatedItems": false }, "tests": [ { "description": "unevaluatedItems doesn't apply", "data": ["foo", "bar"], "valid": true } ] }, { "description": "unevaluatedItems with tuple", "schema": { "type": "array", "prefixItems": [ { "type": "string" } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar"], "valid": false } ] }, { "description": "unevaluatedItems with items", "schema": { "type": "array", "prefixItems": [ { "type": "string" } ], "items": true, "unevaluatedItems": false }, "tests": [ { "description": "unevaluatedItems doesn't apply", "data": ["foo", 42], "valid": true } ] }, { "description": "unevaluatedItems with nested tuple", "schema": { "type": "array", "prefixItems": [ { "type": "string" } ], "allOf": [ { "prefixItems": [ true, { "type": "number" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", 42], "valid": true }, { "description": "with unevaluated items", "data": ["foo", 42, true], "valid": false } ] }, { "description": "unevaluatedItems with nested items", "schema": { "type": "array", "allOf": [ { "prefixItems": [ { "type": "string" } ], "items": true } ], "unevaluatedItems": false }, "tests": [ { "description": "with no additional items", "data": ["foo"], "valid": true }, { "description": "with additional items", "data": ["foo", 42, true], "valid": true } ] }, { "description": "unevaluatedItems with nested unevaluatedItems", "schema": { "type": "array", "allOf": [ { "prefixItems": [ { "type": "string" } ] }, { "unevaluatedItems": true } ], "unevaluatedItems": false }, "tests": [ { "description": "with no additional items", "data": ["foo"], "valid": true }, { "description": "with additional items", "data": ["foo", 42, true], "valid": true } ] }, { "description": "unevaluatedItems with anyOf", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "anyOf": [ { "prefixItems": [ true, { "const": "bar" } ] }, { "prefixItems": [ true, true, { "const": "baz" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "when one schema matches and has no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "when one schema matches and has unevaluated items", "data": ["foo", "bar", 42], "valid": false }, { "description": "when two schemas match and has no unevaluated items", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "when two schemas match and has unevaluated items", "data": ["foo", "bar", "baz", 42], "valid": false } ] }, { "description": "unevaluatedItems with oneOf", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "oneOf": [ { "prefixItems": [ true, { "const": "bar" } ] }, { "prefixItems": [ true, { "const": "baz" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar", 42], "valid": false } ] }, { "description": "unevaluatedItems with not", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "not": { "not": { "prefixItems": [ true, { "const": "bar" } ] } }, "unevaluatedItems": false }, "tests": [ { "description": "with unevaluated items", "data": ["foo", "bar"], "valid": false } ] }, { "description": "unevaluatedItems with if/then/else", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "if": { "prefixItems": [ true, { "const": "bar" } ] }, "then": { "prefixItems": [ true, true, { "const": "then" } ] }, "else": { "prefixItems": [ true, true, true, { "const": "else" } ] }, "unevaluatedItems": false }, "tests": [ { "description": "when if matches and it has no unevaluated items", "data": ["foo", "bar", "then"], "valid": true }, { "description": "when if matches and it has unevaluated items", "data": ["foo", "bar", "then", "else"], "valid": false }, { "description": "when if doesn't match and it has no unevaluated items", "data": ["foo", 42, 42, "else"], "valid": true }, { "description": "when if doesn't match and it has unevaluated items", "data": ["foo", 42, 42, "else", 42], "valid": false } ] }, { "description": "unevaluatedItems with boolean schemas", "schema": { "type": "array", "allOf": [true], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": false } ] }, { "description": "unevaluatedItems with $ref", "schema": { "type": "array", "$ref": "#/$defs/bar", "prefixItems": [ { "type": "string" } ], "unevaluatedItems": false, "$defs": { "bar": { "prefixItems": [ true, { "type": "string" } ] } } }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar", "baz"], "valid": false } ] }, { "description": "unevaluatedItems can't see inside cousins", "schema": { "allOf": [ { "prefixItems": [ true ] }, { "unevaluatedItems": false } ] }, "tests": [ { "description": "always fails", "data": [ 1 ], "valid": false } ] }, { "description": "item is evaluated in an uncle schema to unevaluatedItems", "schema": { "type": "object", "properties": { "foo": { "type": "array", "prefixItems": [ { "type": "string" } ], "unevaluatedItems": false } }, "anyOf": [ { "properties": { "foo": { "prefixItems": [ true, { "type": "string" } ] } } } ] }, "tests": [ { "description": "no extra items", "data": { "foo": [ "test" ] }, "valid": true }, { "description": "uncle keyword evaluation is not significant", "data": { "foo": [ "test", "test" ] }, "valid": false } ] }, { "description": "unevaluatedItems depends on adjacent contains", "schema": { "prefixItems": [true], "contains": {"type": "string"}, "unevaluatedItems": false }, "tests": [ { "description": "second item is evaluated by contains", "data": [ 1, "foo" ], "valid": true }, { "description": "contains fails, second item is not evaluated", "data": [ 1, 2 ], "valid": false }, { "description": "contains passes, second item is not evaluated", "data": [ 1, 2, "foo" ], "valid": false } ] }, { "description": "unevaluatedItems depends on multiple nested contains", "schema": { "allOf": [ { "contains": { "multipleOf": 2 } }, { "contains": { "multipleOf": 3 } } ], "unevaluatedItems": { "multipleOf": 5 } }, "tests": [ { "description": "5 not evaluated, passes unevaluatedItems", "data": [ 2, 3, 4, 5, 6 ], "valid": true }, { "description": "7 not evaluated, fails unevaluatedItems", "data": [ 2, 3, 4, 7, 8 ], "valid": false } ] }, { "description": "unevaluatedItems and contains interact to control item dependency relationship", "schema": { "if": { "contains": {"const": "a"} }, "then": { "if": { "contains": {"const": "b"} }, "then": { "if": { "contains": {"const": "c"} } } }, "unevaluatedItems": false }, "tests": [ { "description": "empty array is valid", "data": [], "valid": true }, { "description": "only a's are valid", "data": [ "a", "a" ], "valid": true }, { "description": "a's and b's are valid", "data": [ "a", "b", "a", "b", "a" ], "valid": true }, { "description": "a's, b's and c's are valid", "data": [ "c", "a", "c", "c", "b", "a" ], "valid": true }, { "description": "only b's are invalid", "data": [ "b", "b" ], "valid": false }, { "description": "only c's are invalid", "data": [ "c", "c" ], "valid": false }, { "description": "only b's and c's are invalid", "data": [ "c", "b", "c", "b", "c" ], "valid": false }, { "description": "only a's and c's are invalid", "data": [ "c", "a", "c", "a", "c" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/vocabulary.json000640 000766 000024 00000002217 14163671560 026274 0ustar00etherstaff000000 000000 [ { "description": "schema that uses custom metaschema with with no validation vocabulary", "schema": { "$id": "https://schema/using/no/validation", "$schema": "http://localhost:1234/draft2020-12/metaschema-no-validation.json", "properties": { "badProperty": false, "numberProperty": { "minimum": 10 } } }, "tests": [ { "description": "applicator vocabulary still works", "data": { "badProperty": "this property should not exist" }, "valid": false }, { "description": "no validation: valid number", "data": { "numberProperty": 20 }, "valid": true }, { "description": "no validation: invalid number, but it still validates", "data": { "numberProperty": 1 }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/boolean_schema.json000640 000766 000024 00000005402 14163671560 027063 0ustar00etherstaff000000 000000 [ { "description": "boolean schema 'true'", "schema": true, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is valid", "data": "foo", "valid": true }, { "description": "boolean true is valid", "data": true, "valid": true }, { "description": "boolean false is valid", "data": false, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "object is valid", "data": {"foo": "bar"}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true }, { "description": "array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "boolean schema 'false'", "schema": false, "tests": [ { "description": "number is invalid", "data": 1, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "boolean true is invalid", "data": true, "valid": false }, { "description": "boolean false is invalid", "data": false, "valid": false }, { "description": "null is invalid", "data": null, "valid": false }, { "description": "object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/not.json000640 000766 000024 00000005376 14163671560 024736 0ustar00etherstaff000000 000000 [ { "description": "not", "schema": { "not": {"type": "integer"} }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "not multiple types", "schema": { "not": {"type": ["integer", "boolean"]} }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "not more complex schema", "schema": { "not": { "type": "object", "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "forbidden property", "schema": { "properties": { "foo": { "not": {} } } }, "tests": [ { "description": "property present", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "property absent", "data": {"bar": 1, "baz": 2}, "valid": true } ] }, { "description": "not with boolean schema true", "schema": {"not": true}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "not with boolean schema false", "schema": {"not": false}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/items.json000640 000766 000024 00000016673 14163671560 025261 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "length": 1 }, "valid": true } ] }, { "description": "items with boolean schema (true)", "schema": {"items": true}, "tests": [ { "description": "any array is valid", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schema (false)", "schema": {"items": false}, "tests": [ { "description": "any non-empty array is invalid", "data": [ 1, "foo", true ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items and subitems", "schema": { "$defs": { "item": { "type": "array", "items": false, "prefixItems": [ { "$ref": "#/$defs/sub-item" }, { "$ref": "#/$defs/sub-item" } ] }, "sub-item": { "type": "object", "required": ["foo"] } }, "type": "array", "items": false, "prefixItems": [ { "$ref": "#/$defs/item" }, { "$ref": "#/$defs/item" }, { "$ref": "#/$defs/item" } ] }, "tests": [ { "description": "valid items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": true }, { "description": "too many items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "too many sub-items", "data": [ [ {"foo": null}, {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong item", "data": [ {"foo": null}, [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong sub-item", "data": [ [ {}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "fewer items is valid", "data": [ [ {"foo": null} ], [ {"foo": null} ] ], "valid": true } ] }, { "description": "nested items", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } }, "tests": [ { "description": "valid nested array", "data": [[[[1]], [[2],[3]]], [[[4], [5], [6]]]], "valid": true }, { "description": "nested array with invalid type", "data": [[[["1"]], [[2],[3]]], [[[4], [5], [6]]]], "valid": false }, { "description": "not deep enough", "data": [[[1], [2],[3]], [[4], [5], [6]]], "valid": false } ] }, { "description": "prefixItems with no additional items allowed", "schema": { "prefixItems": [{}, {}, {}], "items": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "items should not look in applicators, valid case", "schema": { "allOf": [ { "prefixItems": [ { "minimum": 3 } ] } ], "items": { "minimum": 5 } }, "tests": [ { "description": "prefixItems in allOf should not constrain items, invalid case", "data": [ 3, 5 ], "valid": false }, { "description": "prefixItems in allOf should not constrain items, valid case", "data": [ 5, 5 ], "valid": true } ] }, { "description": "prefixItems validation adjusts the starting index for items", "schema": { "prefixItems": [ { "type": "string" } ], "items": { "type": "integer" } }, "tests": [ { "description": "valid items", "data": [ "x", 2, 3 ], "valid": true }, { "description": "wrong type of second item", "data": [ "x", "y" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/enum.json000640 000766 000024 00000014643 14163671560 025077 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false }, { "description": "valid object matches", "data": {"foo": 12}, "valid": true }, { "description": "extra properties in object is invalid", "data": {"foo": 12, "boo": 42}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"]} }, "required": ["bar"] }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "enum with escaped characters", "schema": { "enum": ["foo\nbar", "foo\rbar"] }, "tests": [ { "description": "member 1 is valid", "data": "foo\nbar", "valid": true }, { "description": "member 2 is valid", "data": "foo\rbar", "valid": true }, { "description": "another string is invalid", "data": "abc", "valid": false } ] }, { "description": "enum with false does not match 0", "schema": {"enum": [false]}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true } ] }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/minProperties.json000640 000766 000024 00000001754 14163671560 026772 0ustar00etherstaff000000 000000 [ { "description": "minProperties validation", "schema": {"minProperties": 1}, "tests": [ { "description": "longer is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1}, "valid": true }, { "description": "too short is invalid", "data": {}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/minContains.json000640 000766 000024 00000012523 14163671560 026410 0ustar00etherstaff000000 000000 [ { "description": "minContains without contains is ignored", "schema": { "minContains": 1 }, "tests": [ { "description": "one item valid against lone minContains", "data": [1], "valid": true }, { "description": "zero items still valid against lone minContains", "data": [], "valid": true } ] }, { "description": "minContains=1 with contains", "schema": { "contains": { "const": 1 }, "minContains": 1 }, "tests": [ { "description": "empty data", "data": [], "valid": false }, { "description": "no elements match", "data": [2], "valid": false }, { "description": "single element matches, valid minContains", "data": [1], "valid": true }, { "description": "some elements match, valid minContains", "data": [1, 2], "valid": true }, { "description": "all elements match, valid minContains", "data": [1, 1], "valid": true } ] }, { "description": "minContains=2 with contains", "schema": { "contains": { "const": 1 }, "minContains": 2 }, "tests": [ { "description": "empty data", "data": [], "valid": false }, { "description": "all elements match, invalid minContains", "data": [1], "valid": false }, { "description": "some elements match, invalid minContains", "data": [1, 2], "valid": false }, { "description": "all elements match, valid minContains (exactly as needed)", "data": [1, 1], "valid": true }, { "description": "all elements match, valid minContains (more than needed)", "data": [1, 1, 1], "valid": true }, { "description": "some elements match, valid minContains", "data": [1, 2, 1], "valid": true } ] }, { "description": "maxContains = minContains", "schema": { "contains": { "const": 1 }, "maxContains": 2, "minContains": 2 }, "tests": [ { "description": "empty data", "data": [], "valid": false }, { "description": "all elements match, invalid minContains", "data": [1], "valid": false }, { "description": "all elements match, invalid maxContains", "data": [1, 1, 1], "valid": false }, { "description": "all elements match, valid maxContains and minContains", "data": [1, 1], "valid": true } ] }, { "description": "maxContains < minContains", "schema": { "contains": { "const": 1 }, "maxContains": 1, "minContains": 3 }, "tests": [ { "description": "empty data", "data": [], "valid": false }, { "description": "invalid minContains", "data": [1], "valid": false }, { "description": "invalid maxContains", "data": [1, 1, 1], "valid": false }, { "description": "invalid maxContains and minContains", "data": [1, 1], "valid": false } ] }, { "description": "minContains = 0", "schema": { "contains": { "const": 1 }, "minContains": 0 }, "tests": [ { "description": "empty data", "data": [], "valid": true }, { "description": "minContains = 0 makes contains always pass", "data": [2], "valid": true } ] }, { "description": "minContains = 0 with maxContains", "schema": { "contains": {"const": 1}, "minContains": 0, "maxContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": true }, { "description": "not more than maxContains", "data": [ 1 ], "valid": true }, { "description": "too many", "data": [ 1, 1 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/properties.json000640 000766 000024 00000012034 14163671560 026317 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] }, { "description": "properties with boolean schema", "schema": { "properties": { "foo": true, "bar": false } }, "tests": [ { "description": "no property present is valid", "data": {}, "valid": true }, { "description": "only 'true' property present is valid", "data": {"foo": 1}, "valid": true }, { "description": "only 'false' property present is invalid", "data": {"bar": 2}, "valid": false }, { "description": "both properties present is invalid", "data": {"foo": 1, "bar": 2}, "valid": false } ] }, { "description": "properties with escaped characters", "schema": { "properties": { "foo\nbar": {"type": "number"}, "foo\"bar": {"type": "number"}, "foo\\bar": {"type": "number"}, "foo\rbar": {"type": "number"}, "foo\tbar": {"type": "number"}, "foo\fbar": {"type": "number"} } }, "tests": [ { "description": "object with all numbers is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1", "foo\\bar": "1", "foo\rbar": "1", "foo\tbar": "1", "foo\fbar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/maxContains.json000640 000766 000024 00000007636 14163671560 026423 0ustar00etherstaff000000 000000 [ { "description": "maxContains without contains is ignored", "schema": { "maxContains": 1 }, "tests": [ { "description": "one item valid against lone maxContains", "data": [1], "valid": true }, { "description": "two items still valid against lone maxContains", "data": [1, 2], "valid": true }, { "description": "one property valid against lone maxContains", "data": { "a": 1 }, "valid": true }, { "description": "two properties still valid against lone maxContains", "data": { "a": 1, "b": 2 }, "valid": true } ] }, { "description": "maxContains with contains", "schema": { "contains": { "const": 1 }, "maxContains": 1 }, "tests": [ { "description": "empty array", "data": [], "valid": false }, { "description": "all elements match, valid maxContains", "data": [1], "valid": true }, { "description": "all elements match, invalid maxContains", "data": [1, 1], "valid": false }, { "description": "some elements match, valid maxContains", "data": [1, 2], "valid": true }, { "description": "some elements match, invalid maxContains", "data": [1, 2, 1], "valid": false }, { "description": "empty object", "data": {}, "valid": false }, { "description": "all properties match, valid maxContains", "data": { "a": 1 }, "valid": true }, { "description": "all properties match, invalid maxContains", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "some properties match, valid maxContains", "data": { "a": 1, "b": 2 }, "valid": true }, { "description": "some properties match, invalid maxContains", "data": { "a": 1, "b": 2, "c": 1 }, "valid": false } ] }, { "description": "minContains < maxContains", "schema": { "contains": { "const": 1 }, "minContains": 1, "maxContains": 3 }, "tests": [ { "description": "array with actual < minContains < maxContains", "data": [], "valid": false }, { "description": "array with minContains < actual < maxContains", "data": [1, 1], "valid": true }, { "description": "array with minContains < maxContains < actual", "data": [1, 1, 1, 1], "valid": false }, { "description": "object with actual < minContains < maxContains", "data": {}, "valid": false }, { "description": "object with minContains < actual < maxContains", "data": { "a": 1, "b": 1 }, "valid": true }, { "description": "object with minContains < maxContains < actual", "data": { "a": 1, "b": 1, "c": 1, "d": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/maxLength.json000640 000766 000024 00000001600 14163671560 026047 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/dependentSchemas.json000640 000766 000024 00000007112 14163671560 027376 0ustar00etherstaff000000 000000 [ { "description": "single dependency", "schema": { "dependentSchemas": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "boolean subschemas", "schema": { "dependentSchemas": { "foo": true, "bar": false } }, "tests": [ { "description": "object with property having schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property having schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "dependencies with escaped characters", "schema": { "dependentSchemas": { "foo\tbar": {"minProperties": 4}, "foo'bar": {"required": ["foo\"bar"]} } }, "tests": [ { "description": "quoted tab", "data": { "foo\tbar": 1, "a": 2, "b": 3, "c": 4 }, "valid": true }, { "description": "quoted quote", "data": { "foo'bar": {"foo\"bar": 1} }, "valid": false }, { "description": "quoted tab invalid under dependent schema", "data": { "foo\tbar": 1, "a": 2 }, "valid": false }, { "description": "quoted quote invalid under dependent schema", "data": {"foo'bar": 1}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/infinite-loop-detection.json000640 000766 000024 00000001724 14163671560 030657 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "$defs": { "int": { "type": "integer" } }, "allOf": [ { "properties": { "foo": { "$ref": "#/$defs/int" } } }, { "additionalProperties": { "$ref": "#/$defs/int" } } ] }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/exclusiveMaximum.json000640 000766 000024 00000001407 14163671560 027472 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMaximum validation", "schema": { "exclusiveMaximum": 3.0 }, "tests": [ { "description": "below the exclusiveMaximum is valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false }, { "description": "above the exclusiveMaximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/prefixItems.json000640 000766 000024 00000004257 14163671560 026432 0ustar00etherstaff000000 000000 [ { "description": "a schema given for prefixItems", "schema": { "prefixItems": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false }, { "description": "incomplete array of items", "data": [ 1 ], "valid": true }, { "description": "array with additional items", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array", "data": [ ], "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "1": "valid", "length": 2 }, "valid": true } ] }, { "description": "prefixItems with boolean schemas", "schema": { "prefixItems": [true, false] }, "tests": [ { "description": "array with one item is valid", "data": [ 1 ], "valid": true }, { "description": "array with two items is invalid", "data": [ 1, "foo" ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "additional items are allowed by default", "schema": {"prefixItems": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/minimum.json000640 000766 000024 00000003612 14163671560 025600 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/000770 000766 000024 00000000000 14163671560 025056 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/oneOf.json000640 000766 000024 00000016123 14163671560 025174 0ustar00etherstaff000000 000000 [ { "description": "oneOf", "schema": { "oneOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first oneOf valid", "data": 1, "valid": true }, { "description": "second oneOf valid", "data": 2.5, "valid": true }, { "description": "both oneOf valid", "data": 3, "valid": false }, { "description": "neither oneOf valid", "data": 1.5, "valid": false } ] }, { "description": "oneOf with base schema", "schema": { "type": "string", "oneOf" : [ { "minLength": 2 }, { "maxLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one oneOf valid", "data": "foobar", "valid": true }, { "description": "both oneOf valid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all true", "schema": {"oneOf": [true, true, true]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, one true", "schema": {"oneOf": [true, false, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "oneOf with boolean schemas, more than one true", "schema": {"oneOf": [true, true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all false", "schema": {"oneOf": [false, false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf complex types", "schema": { "oneOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second oneOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both oneOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": false }, { "description": "neither oneOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "oneOf with empty schema", "schema": { "oneOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "one valid - valid", "data": "foo", "valid": true }, { "description": "both valid - invalid", "data": 123, "valid": false } ] }, { "description": "oneOf with required", "schema": { "type": "object", "oneOf": [ { "required": ["foo", "bar"] }, { "required": ["foo", "baz"] } ] }, "tests": [ { "description": "both invalid - invalid", "data": {"bar": 2}, "valid": false }, { "description": "first valid - valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "second valid - valid", "data": {"foo": 1, "baz": 3}, "valid": true }, { "description": "both valid - invalid", "data": {"foo": 1, "bar": 2, "baz" : 3}, "valid": false } ] }, { "description": "oneOf with missing optional property", "schema": { "oneOf": [ { "properties": { "bar": true, "baz": true }, "required": ["bar"] }, { "properties": { "foo": true }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid", "data": {"bar": 8}, "valid": true }, { "description": "second oneOf valid", "data": {"foo": "foo"}, "valid": true }, { "description": "both oneOf valid", "data": {"foo": "foo", "bar": 8}, "valid": false }, { "description": "neither oneOf valid", "data": {"baz": "quux"}, "valid": false } ] }, { "description": "nested oneOf, to check validation semantics", "schema": { "oneOf": [ { "oneOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/if-then-else.json000640 000766 000024 00000015322 14163671560 026406 0ustar00etherstaff000000 000000 [ { "description": "ignore if without then or else", "schema": { "if": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone if", "data": 0, "valid": true }, { "description": "valid when invalid against lone if", "data": "hello", "valid": true } ] }, { "description": "ignore then without if", "schema": { "then": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone then", "data": 0, "valid": true }, { "description": "valid when invalid against lone then", "data": "hello", "valid": true } ] }, { "description": "ignore else without if", "schema": { "else": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone else", "data": 0, "valid": true }, { "description": "valid when invalid against lone else", "data": "hello", "valid": true } ] }, { "description": "if and then without else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid when if test fails", "data": 3, "valid": true } ] }, { "description": "if and else without then", "schema": { "if": { "exclusiveMaximum": 0 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid when if test passes", "data": -1, "valid": true }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "validate against correct branch, then vs else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "non-interference across combined schemas", "schema": { "allOf": [ { "if": { "exclusiveMaximum": 0 } }, { "then": { "minimum": -10 } }, { "else": { "multipleOf": 2 } } ] }, "tests": [ { "description": "valid, but would have been invalid through then", "data": -100, "valid": true }, { "description": "valid, but would have been invalid through else", "data": 3, "valid": true } ] }, { "description": "if with boolean schema true", "schema": { "if": true, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema true in if always chooses the then path (valid)", "data": "then", "valid": true }, { "description": "boolean schema true in if always chooses the then path (invalid)", "data": "else", "valid": false } ] }, { "description": "if with boolean schema false", "schema": { "if": false, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema false in if always chooses the else path (invalid)", "data": "then", "valid": false }, { "description": "boolean schema false in if always chooses the else path (valid)", "data": "else", "valid": true } ] }, { "description": "if appears at the end when serialized (keyword processing sequence)", "schema": { "then": { "const": "yes" }, "else": { "const": "other" }, "if": { "maxLength": 4 } }, "tests": [ { "description": "yes redirects to then and passes", "data": "yes", "valid": true }, { "description": "other redirects to else and passes", "data": "other", "valid": true }, { "description": "no redirects to then and fails", "data": "no", "valid": false }, { "description": "invalid redirects to else and fails", "data": "invalid", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/pattern.json000640 000766 000024 00000003003 14163671560 025574 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/unevaluatedProperties.json000640 000766 000024 00000114765 14163671560 030533 0ustar00etherstaff000000 000000 [ { "description": "unevaluatedProperties true", "schema": { "type": "object", "unevaluatedProperties": true }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo" }, "valid": true } ] }, { "description": "unevaluatedProperties schema", "schema": { "type": "object", "unevaluatedProperties": { "type": "string", "minLength": 3 } }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with valid unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with invalid unevaluated properties", "data": { "foo": "fo" }, "valid": false } ] }, { "description": "unevaluatedProperties false", "schema": { "type": "object", "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent properties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent patternProperties", "schema": { "type": "object", "patternProperties": { "^foo": { "type": "string" } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent additionalProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "additionalProperties": true, "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with nested properties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "properties": { "bar": { "type": "string" } } } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with nested patternProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "patternProperties": { "^bar": { "type": "string" } } } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with nested additionalProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "additionalProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with nested unevaluatedProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": true } ], "unevaluatedProperties": { "type": "string", "maxLength": 2 } }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with anyOf", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "anyOf": [ { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] }, { "properties": { "baz": { "const": "baz" } }, "required": ["baz"] }, { "properties": { "quux": { "const": "quux" } }, "required": ["quux"] } ], "unevaluatedProperties": false }, "tests": [ { "description": "when one matches and has no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "when one matches and has unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "not-baz" }, "valid": false }, { "description": "when two match and has no unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": true }, { "description": "when two match and has unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz", "quux": "not-quux" }, "valid": false } ] }, { "description": "unevaluatedProperties with oneOf", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "oneOf": [ { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] }, { "properties": { "baz": { "const": "baz" } }, "required": ["baz"] } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar", "quux": "quux" }, "valid": false } ] }, { "description": "unevaluatedProperties with not", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "not": { "not": { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] } }, "unevaluatedProperties": false }, "tests": [ { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "then": { "properties": { "bar": { "type": "string" } }, "required": ["bar"] }, "else": { "properties": { "baz": { "type": "string" } }, "required": ["baz"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": true }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": true }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else, then not defined", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "else": { "properties": { "baz": { "type": "string" } }, "required": ["baz"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": false }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": true }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else, else not defined", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "then": { "properties": { "bar": { "type": "string" } }, "required": ["bar"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": true }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": false }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with dependentSchemas", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "dependentSchemas": { "foo": { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with boolean schemas", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [true], "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with $ref", "schema": { "type": "object", "$ref": "#/$defs/bar", "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false, "$defs": { "bar": { "properties": { "bar": { "type": "string" } } } } }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties can't see inside cousins", "schema": { "allOf": [ { "properties": { "foo": true } }, { "unevaluatedProperties": false } ] }, "tests": [ { "description": "always fails", "data": { "foo": 1 }, "valid": false } ] }, { "description": "nested unevaluatedProperties, outer false, inner true, properties outside", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "nested unevaluatedProperties, outer false, inner true, properties inside", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "nested unevaluatedProperties, outer true, inner false, properties outside", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": false } ], "unevaluatedProperties": true }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": false }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "nested unevaluatedProperties, outer true, inner false, properties inside", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false } ], "unevaluatedProperties": true }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "cousin unevaluatedProperties, true and false, true with properties", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": true }, { "unevaluatedProperties": false } ] }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": false }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "cousin unevaluatedProperties, true and false, false with properties", "schema": { "type": "object", "allOf": [ { "unevaluatedProperties": true }, { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false } ] }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "property is evaluated in an uncle schema to unevaluatedProperties", "comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations", "schema": { "type": "object", "properties": { "foo": { "type": "object", "properties": { "bar": { "type": "string" } }, "unevaluatedProperties": false } }, "anyOf": [ { "properties": { "foo": { "properties": { "faz": { "type": "string" } } } } } ] }, "tests": [ { "description": "no extra properties", "data": { "foo": { "bar": "test" } }, "valid": true }, { "description": "uncle keyword evaluation is not significant", "data": { "foo": { "bar": "test", "faz": "test" } }, "valid": false } ] }, { "description": "in-place applicator siblings, allOf has unevaluated", "schema": { "type": "object", "allOf": [ { "properties": { "foo": true }, "unevaluatedProperties": false } ], "anyOf": [ { "properties": { "bar": true } } ] }, "tests": [ { "description": "base case: both properties present", "data": { "foo": 1, "bar": 1 }, "valid": false }, { "description": "in place applicator siblings, bar is missing", "data": { "foo": 1 }, "valid": true }, { "description": "in place applicator siblings, foo is missing", "data": { "bar": 1 }, "valid": false } ] }, { "description": "in-place applicator siblings, anyOf has unevaluated", "schema": { "type": "object", "allOf": [ { "properties": { "foo": true } } ], "anyOf": [ { "properties": { "bar": true }, "unevaluatedProperties": false } ] }, "tests": [ { "description": "base case: both properties present", "data": { "foo": 1, "bar": 1 }, "valid": false }, { "description": "in place applicator siblings, bar is missing", "data": { "foo": 1 }, "valid": false }, { "description": "in place applicator siblings, foo is missing", "data": { "bar": 1 }, "valid": true } ] }, { "description": "unevaluatedProperties + single cyclic ref", "schema": { "type": "object", "properties": { "x": { "$ref": "#" } }, "unevaluatedProperties": false }, "tests": [ { "description": "Empty is valid", "data": {}, "valid": true }, { "description": "Single is valid", "data": { "x": {} }, "valid": true }, { "description": "Unevaluated on 1st level is invalid", "data": { "x": {}, "y": {} }, "valid": false }, { "description": "Nested is valid", "data": { "x": { "x": {} } }, "valid": true }, { "description": "Unevaluated on 2nd level is invalid", "data": { "x": { "x": {}, "y": {} } }, "valid": false }, { "description": "Deep nested is valid", "data": { "x": { "x": { "x": {} } } }, "valid": true }, { "description": "Unevaluated on 3rd level is invalid", "data": { "x": { "x": { "x": {}, "y": {} } } }, "valid": false } ] }, { "description": "unevaluatedProperties + ref inside allOf / oneOf", "schema": { "$defs": { "one": { "properties": { "a": true } }, "two": { "required": ["x"], "properties": { "x": true } } }, "allOf": [ { "$ref": "#/$defs/one" }, { "properties": { "b": true } }, { "oneOf": [ { "$ref": "#/$defs/two" }, { "required": ["y"], "properties": { "y": true } } ] } ], "unevaluatedProperties": false }, "tests": [ { "description": "Empty is invalid (no x or y)", "data": {}, "valid": false }, { "description": "a and b are invalid (no x or y)", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "x and y are invalid", "data": { "x": 1, "y": 1 }, "valid": false }, { "description": "a and x are valid", "data": { "a": 1, "x": 1 }, "valid": true }, { "description": "a and y are valid", "data": { "a": 1, "y": 1 }, "valid": true }, { "description": "a and b and x are valid", "data": { "a": 1, "b": 1, "x": 1 }, "valid": true }, { "description": "a and b and y are valid", "data": { "a": 1, "b": 1, "y": 1 }, "valid": true }, { "description": "a and b and x and y are invalid", "data": { "a": 1, "b": 1, "x": 1, "y": 1 }, "valid": false } ] }, { "description": "dynamic evalation inside nested refs", "schema": { "$defs": { "one": { "oneOf": [ { "$ref": "#/$defs/two" }, { "required": ["b"], "properties": { "b": true } }, { "required": ["xx"], "patternProperties": { "x": true } }, { "required": ["all"], "unevaluatedProperties": true } ] }, "two": { "oneOf": [ { "required": ["c"], "properties": { "c": true } }, { "required": ["d"], "properties": { "d": true } } ] } }, "oneOf": [ { "$ref": "#/$defs/one" }, { "required": ["a"], "properties": { "a": true } } ], "unevaluatedProperties": false }, "tests": [ { "description": "Empty is invalid", "data": {}, "valid": false }, { "description": "a is valid", "data": { "a": 1 }, "valid": true }, { "description": "b is valid", "data": { "b": 1 }, "valid": true }, { "description": "c is valid", "data": { "c": 1 }, "valid": true }, { "description": "d is valid", "data": { "d": 1 }, "valid": true }, { "description": "a + b is invalid", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "a + c is invalid", "data": { "a": 1, "c": 1 }, "valid": false }, { "description": "a + d is invalid", "data": { "a": 1, "d": 1 }, "valid": false }, { "description": "b + c is invalid", "data": { "b": 1, "c": 1 }, "valid": false }, { "description": "b + d is invalid", "data": { "b": 1, "d": 1 }, "valid": false }, { "description": "c + d is invalid", "data": { "c": 1, "d": 1 }, "valid": false }, { "description": "xx is valid", "data": { "xx": 1 }, "valid": true }, { "description": "xx + foox is valid", "data": { "xx": 1, "foox": 1 }, "valid": true }, { "description": "xx + foo is invalid", "data": { "xx": 1, "foo": 1 }, "valid": false }, { "description": "xx + a is invalid", "data": { "xx": 1, "a": 1 }, "valid": false }, { "description": "xx + b is invalid", "data": { "xx": 1, "b": 1 }, "valid": false }, { "description": "xx + c is invalid", "data": { "xx": 1, "c": 1 }, "valid": false }, { "description": "xx + d is invalid", "data": { "xx": 1, "d": 1 }, "valid": false }, { "description": "all is valid", "data": { "all": 1 }, "valid": true }, { "description": "all + foo is valid", "data": { "all": 1, "foo": 1 }, "valid": true }, { "description": "all + a is invalid", "data": { "all": 1, "a": 1 }, "valid": false } ] }, { "description": "unevaluatedProperties depends on adjacent contains", "schema": { "properties": { "foo": { "type": "number" } }, "contains": { "type": "string" }, "unevaluatedProperties": false }, "tests": [ { "description": "bar is evaluated by contains", "data": { "foo": 1, "bar": "foo" }, "valid": true }, { "description": "contains fails, bar is not evaluated", "data": { "foo": 1, "bar": 2 }, "valid": false }, { "description": "contains passes, bar is not evaluated", "data": { "foo": 1, "bar": 2, "baz": "foo" }, "valid": false } ] }, { "description": "unevaluatedProperties depends on multiple nested contains", "schema": { "allOf": [ { "contains": { "multipleOf": 2 } }, { "contains": { "multipleOf": 3 } } ], "unevaluatedProperties": { "multipleOf": 5 } }, "tests": [ { "description": "5 not evaluated, passes unevaluatedItems", "data": { "a": 2, "b": 3, "c": 4, "d": 5, "e": 6 }, "valid": true }, { "description": "7 not evaluated, fails unevaluatedItems", "data": { "a": 2, "b": 3, "c": 4, "d": 7, "e": 8 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/maxProperties.json000640 000766 000024 00000002732 14163671560 026771 0ustar00etherstaff000000 000000 [ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, "tests": [ { "description": "shorter is valid", "data": {"foo": 1}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "too long is invalid", "data": {"foo": 1, "bar": 2, "baz": 3}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "maxProperties = 0 means the object is empty", "schema": { "maxProperties": 0 }, "tests": [ { "description": "no properties is valid", "data": {}, "valid": true }, { "description": "one property is invalid", "data": { "foo": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/dependentRequired.json000640 000766 000024 00000007550 14163671560 027601 0ustar00etherstaff000000 000000 [ { "description": "single dependency", "schema": {"dependentRequired": {"bar": ["foo"]}}, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "empty dependents", "schema": {"dependentRequired": {"bar": []}}, "tests": [ { "description": "empty object", "data": {}, "valid": true }, { "description": "object with one property", "data": {"bar": 2}, "valid": true }, { "description": "non-object is valid", "data": 1, "valid": true } ] }, { "description": "multiple dependents required", "schema": {"dependentRequired": {"quux": ["foo", "bar"]}}, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "dependencies with escaped characters", "schema": { "dependentRequired": { "foo\nbar": ["foo\rbar"], "foo\"bar": ["foo'bar"] } }, "tests": [ { "description": "CRLF", "data": { "foo\nbar": 1, "foo\rbar": 2 }, "valid": true }, { "description": "quoted quotes", "data": { "foo'bar": 1, "foo\"bar": 2 }, "valid": true }, { "description": "CRLF missing dependent", "data": { "foo\nbar": 1, "foo": 2 }, "valid": false }, { "description": "quoted quotes missing dependent", "data": { "foo\"bar": 2 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/required.json000640 000766 000024 00000005206 14163671560 025746 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {}, "bar": {} }, "required": ["foo"] }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required with empty array", "schema": { "properties": { "foo": {} }, "required": [] }, "tests": [ { "description": "property not required", "data": {}, "valid": true } ] }, { "description": "required with escaped characters", "schema": { "required": [ "foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar" ] }, "tests": [ { "description": "object with all properties present is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with some properties missing is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/id.json000640 000766 000024 00000021074 14163671560 024523 0ustar00etherstaff000000 000000 [ { "description": "Invalid use of fragments in location-independent $id", "schema": { "$ref": "https://json-schema.org/draft/next/schema" }, "tests": [ { "description": "Identifier name", "data": { "$ref": "#foo", "$defs": { "A": { "$id": "#foo", "type": "integer" } } }, "valid": false }, { "description": "Identifier name and no ref", "data": { "$defs": { "A": { "$id": "#foo" } } }, "valid": false }, { "description": "Identifier path", "data": { "$ref": "#/a/b", "$defs": { "A": { "$id": "#/a/b", "type": "integer" } } }, "valid": false }, { "description": "Identifier name with absolute URI", "data": { "$ref": "http://localhost:1234/bar#foo", "$defs": { "A": { "$id": "http://localhost:1234/bar#foo", "type": "integer" } } }, "valid": false }, { "description": "Identifier path with absolute URI", "data": { "$ref": "http://localhost:1234/bar#/a/b", "$defs": { "A": { "$id": "http://localhost:1234/bar#/a/b", "type": "integer" } } }, "valid": false }, { "description": "Identifier name with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#foo", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#foo", "type": "integer" } } } } }, "valid": false }, { "description": "Identifier path with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#/a/b", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#/a/b", "type": "integer" } } } } }, "valid": false } ] }, { "description": "Valid use of empty fragments in location-independent $id", "comment": "These are allowed but discouraged", "schema": { "$ref": "https://json-schema.org/draft/next/schema" }, "tests": [ { "description": "Identifier name with absolute URI", "data": { "$ref": "http://localhost:1234/bar", "$defs": { "A": { "$id": "http://localhost:1234/bar#", "type": "integer" } } }, "valid": true }, { "description": "Identifier name with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#/$defs/B", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#", "type": "integer" } } } } }, "valid": true } ] }, { "description": "Unnormalized $ids are allowed but discouraged", "schema": { "$ref": "https://json-schema.org/draft/next/schema" }, "tests": [ { "description": "Unnormalized identifier", "data": { "$ref": "http://localhost:1234/foo/baz", "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier and no ref", "data": { "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier with empty fragment", "data": { "$ref": "http://localhost:1234/foo/baz", "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz#", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier with empty fragment and no ref", "data": { "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz#", "type": "integer" } } }, "valid": true } ] }, { "description": "$id inside an enum is not a real identifier", "comment": "the implementation must not be confused by an $id buried in the enum", "schema": { "$defs": { "id_in_enum": { "enum": [ { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } ] }, "real_id_in_schema": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "string" }, "zzz_id_in_const": { "const": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } } }, "anyOf": [ { "$ref": "#/$defs/id_in_enum" }, { "$ref": "https://localhost:1234/id/my_identifier.json" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" }, "valid": true }, { "description": "match $ref to $id", "data": "a string to match #/$defs/id_in_enum", "valid": true }, { "description": "no match on enum or $ref to $id", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/type.json000640 000766 000024 00000032140 14163671560 025104 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float with zero fractional part is an integer", "data": 1.0, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number (and an integer)", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an empty string is still a string", "data": "", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "zero is not a boolean", "data": 0, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an empty string is not a boolean", "data": "", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "true is a boolean", "data": true, "valid": true }, { "description": "false is a boolean", "data": false, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "zero is not null", "data": 0, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an empty string is not null", "data": "", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "true is not null", "data": true, "valid": false }, { "description": "false is not null", "data": false, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type as array with one item", "schema": { "type": ["string"] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is invalid", "data": 123, "valid": false } ] }, { "description": "type: array or object", "schema": { "type": ["array", "object"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type: array, object or null", "schema": { "type": ["array", "object", "null"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/default.json000640 000766 000024 00000004267 14163671560 025560 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/multipleOf.json000640 000766 000024 00000003577 14163671560 026257 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"multipleOf": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"multipleOf": 1.5}, "tests": [ { "description": "zero is multiple of anything", "data": 0, "valid": true }, { "description": "4.5 is multiple of 1.5", "data": 4.5, "valid": true }, { "description": "35 is not multiple of 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"multipleOf": 0.0001}, "tests": [ { "description": "0.0075 is multiple of 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not multiple of 0.0001", "data": 0.00751, "valid": false } ] }, { "description": "invalid instance should not raise error when float division = inf", "schema": {"type": "integer", "multipleOf": 0.123456789}, "tests": [ { "description": "always invalid, but naive implementations may raise an overflow error", "data": 1e308, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/patternProperties.json000640 000766 000024 00000011251 14163671560 027655 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": ["foo"], "valid": true }, { "description": "ignores strings", "data": "foo", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] }, { "description": "patternProperties with boolean schemas", "schema": { "patternProperties": { "f.*": true, "b.*": false } }, "tests": [ { "description": "object with property matching schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property matching schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "object with a property matching both true and false is invalid", "data": {"foobar":1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/refRemote.json000640 000766 000024 00000012334 14163671560 026056 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "base URI change", "schema": { "$id": "http://localhost:1234/", "items": { "$id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "base URI change ref valid", "data": [[1]], "valid": true }, { "description": "base URI change ref invalid", "data": [["a"]], "valid": false } ] }, { "description": "base URI change - change folder", "schema": { "$id": "http://localhost:1234/scope_change_defs1.json", "type" : "object", "properties": {"list": {"$ref": "baseUriChangeFolder/"}}, "$defs": { "baz": { "$id": "baseUriChangeFolder/", "type": "array", "items": {"$ref": "folderInteger.json"} } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "base URI change - change folder in subschema", "schema": { "$id": "http://localhost:1234/scope_change_defs2.json", "type" : "object", "properties": {"list": {"$ref": "baseUriChangeFolderInSubschema/#/$defs/bar"}}, "$defs": { "baz": { "$id": "baseUriChangeFolderInSubschema/", "$defs": { "bar": { "type": "array", "items": {"$ref": "folderInteger.json"} } } } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "root ref in remote ref", "schema": { "$id": "http://localhost:1234/object", "type": "object", "properties": { "name": {"$ref": "name-defs.json#/$defs/orNull"} } }, "tests": [ { "description": "string is valid", "data": { "name": "foo" }, "valid": true }, { "description": "null is valid", "data": { "name": null }, "valid": true }, { "description": "object is invalid", "data": { "name": { "name": null } }, "valid": false } ] }, { "description": "remote ref with ref to defs", "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "$ref": "ref-and-defs.json" }, "tests": [ { "description": "invalid", "data": { "bar": 1 }, "valid": false }, { "description": "valid", "data": { "bar": "a" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/allOf.json000640 000766 000024 00000017147 14163671560 025172 0ustar00etherstaff000000 000000 [ { "description": "allOf", "schema": { "allOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "allOf", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch second", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch first", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "allOf with base schema", "schema": { "properties": {"bar": {"type": "integer"}}, "required": ["bar"], "allOf" : [ { "properties": { "foo": {"type": "string"} }, "required": ["foo"] }, { "properties": { "baz": {"type": "null"} }, "required": ["baz"] } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch base schema", "data": {"foo": "quux", "baz": null}, "valid": false }, { "description": "mismatch first allOf", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second allOf", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "allOf simple types", "schema": { "allOf": [ {"maximum": 30}, {"minimum": 20} ] }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch one", "data": 35, "valid": false } ] }, { "description": "allOf with boolean schemas, all true", "schema": {"allOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "allOf with boolean schemas, some false", "schema": {"allOf": [true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with boolean schemas, all false", "schema": {"allOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with one empty schema", "schema": { "allOf": [ {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with two empty schemas", "schema": { "allOf": [ {}, {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with the first empty schema", "schema": { "allOf": [ {}, { "type": "number" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with the last empty schema", "schema": { "allOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "nested allOf, to check validation semantics", "schema": { "allOf": [ { "allOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "allOf combined with anyOf, oneOf", "schema": { "allOf": [ { "multipleOf": 2 } ], "anyOf": [ { "multipleOf": 3 } ], "oneOf": [ { "multipleOf": 5 } ] }, "tests": [ { "description": "allOf: false, anyOf: false, oneOf: false", "data": 1, "valid": false }, { "description": "allOf: false, anyOf: false, oneOf: true", "data": 5, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: false", "data": 3, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: true", "data": 15, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: false", "data": 2, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: true", "data": 10, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: false", "data": 6, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: true", "data": 30, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/format.json000640 000766 000024 00000047327 14163671560 025430 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-email format", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "regex format", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv4 format", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-hostname format", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "hostname format", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date format", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "time format", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "json-pointer format", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "relative-json-pointer format", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri format", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri-reference format", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-reference format", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-template format", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uuid format", "schema": { "format": "uuid" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "duration format", "schema": { "format": "duration" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/ref.json000640 000766 000024 00000040563 14163671560 024707 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "prefixItems": [ {"type": "integer"}, {"$ref": "#/prefixItems/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "$defs": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/$defs/tilde~0field"}, "slash": {"$ref": "#/$defs/slash~1field"}, "percent": {"$ref": "#/$defs/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "$defs": { "a": {"type": "integer"}, "b": {"$ref": "#/$defs/a"}, "c": {"$ref": "#/$defs/b"} }, "$ref": "#/$defs/c" }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref applies alongside sibling keywords", "schema": { "$defs": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/$defs/reffed", "maxItems": 2 } } }, "tests": [ { "description": "ref valid, maxItems valid", "data": { "foo": [] }, "valid": true }, { "description": "ref valid, maxItems invalid", "data": { "foo": [1, 2, 3] }, "valid": false }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "remote ref, containing refs itself", "schema": { "$ref": "https://json-schema.org/draft/next/schema" }, "tests": [ { "description": "remote ref valid", "data": {"minLength": 1}, "valid": true }, { "description": "remote ref invalid", "data": {"minLength": -1}, "valid": false } ] }, { "description": "property named $ref that is not a reference", "schema": { "properties": { "$ref": {"type": "string"} } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/$defs/is-string"} }, "$defs": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "$ref to boolean schema true", "schema": { "$ref": "#/$defs/bool", "$defs": { "bool": true } }, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "$ref to boolean schema false", "schema": { "$ref": "#/$defs/bool", "$defs": { "bool": false } }, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "Recursive references between schemas", "schema": { "$id": "http://localhost:1234/tree", "description": "tree of nodes", "type": "object", "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "required": ["meta", "nodes"], "$defs": { "node": { "$id": "http://localhost:1234/node", "description": "node", "type": "object", "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} }, "required": ["value"] } } }, "tests": [ { "description": "valid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": 1.1}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": true }, { "description": "invalid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": "string is invalid"}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": false } ] }, { "description": "refs with quote", "schema": { "properties": { "foo\"bar": {"$ref": "#/$defs/foo%22bar"} }, "$defs": { "foo\"bar": {"type": "number"} } }, "tests": [ { "description": "object with numbers is valid", "data": { "foo\"bar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\"bar": "1" }, "valid": false } ] }, { "description": "ref creates new scope when adjacent to keywords", "schema": { "$defs": { "A": { "unevaluatedProperties": false } }, "properties": { "prop1": { "type": "string" } }, "$ref": "#/$defs/A" }, "tests": [ { "description": "referenced subschema doesn't see annotations from properties", "data": { "prop1": "match" }, "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "$defs": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/$defs/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "do not evaluate the $ref inside the enum, definition exact match", "data": { "type": "string" }, "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/$defs/a_string" }, "valid": true } ] }, { "description": "refs with relative uris and defs", "schema": { "$id": "http://example.com/schema-relative-uri-defs1.json", "properties": { "foo": { "$id": "schema-relative-uri-defs2.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } }, "$ref": "schema-relative-uri-defs2.json" }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "relative refs with absolute uris and defs", "schema": { "$id": "http://example.com/schema-refs-absolute-uris-defs1.json", "properties": { "foo": { "$id": "http://example.com/schema-refs-absolute-uris-defs2.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } }, "$ref": "schema-refs-absolute-uris-defs2.json" }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "$id must be resolved against nearest parent, not just immediate parent", "schema": { "$id": "http://example.com/a.json", "$defs": { "x": { "$id": "http://example.com/b/c.json", "not": { "$defs": { "y": { "$id": "d.json", "type": "number" } } } } }, "allOf": [ { "$ref": "http://example.com/b/d.json" } ] }, "tests": [ { "description": "number should pass", "data": 1, "valid": true }, { "description": "non-number should fail", "data": "a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/maximum.json000640 000766 000024 00000002704 14163671560 025603 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/minLength.json000640 000766 000024 00000001566 14163671560 026060 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/maxItems.json000640 000766 000024 00000001302 14163671560 025706 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/contains.json000640 000766 000024 00000016605 14163671560 025751 0ustar00etherstaff000000 000000 [ { "description": "contains keyword validation", "schema": { "contains": { "minimum": 5 } }, "tests": [ { "description": "array with item matching schema (5) is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with item matching schema (6) is valid", "data": [3, 4, 6], "valid": true }, { "description": "array with two items matching schema (5, 6) is valid", "data": [3, 4, 5, 6], "valid": true }, { "description": "array without items matching schema is invalid", "data": [2, 3, 4], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "object with property matching schema (5) is valid", "data": { "a": 3, "b": 4, "c": 5 }, "valid": true }, { "description": "object with property matching schema (6) is valid", "data": { "a": 3, "b": 4, "c": 6 }, "valid": true }, { "description": "object with two properties matching schema (5, 6) is valid", "data": { "a": 3, "b": 4, "c": 5, "d": 6 }, "valid": true }, { "description": "object without properties matching schema is invalid", "data": { "a": 2, "b": 3, "c": 4 }, "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "not array or object is valid", "data": 42, "valid": true } ] }, { "description": "contains keyword with const keyword", "schema": { "contains": { "const": 5 } }, "tests": [ { "description": "array with item 5 is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with two items 5 is valid", "data": [3, 4, 5, 5], "valid": true }, { "description": "array without item 5 is invalid", "data": [1, 2, 3, 4], "valid": false }, { "description": "object with property 5 is valid", "data": { "a": 3, "b": 4, "c": 5 }, "valid": true }, { "description": "object with two properties 5 is valid", "data": { "a": 3, "b": 4, "c": 5, "d": 5 }, "valid": true }, { "description": "object without property 5 is invalid", "data": { "a": 1, "b": 2, "c": 3, "d": 4 }, "valid": false } ] }, { "description": "contains keyword with boolean schema true", "schema": { "contains": true }, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "any non-empty object is valid", "data": { "a": "foo" }, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false } ] }, { "description": "contains keyword with boolean schema false", "schema": { "contains": false }, "tests": [ { "description": "any non-empty array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "any non-empty object is invalid", "data": ["foo"], "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "non-arrays/objects are valid", "data": "contains does not apply to strings", "valid": true } ] }, { "description": "items + contains", "schema": { "additionalProperties": { "multipleOf": 2 }, "items": { "multipleOf": 2 }, "contains": { "multipleOf": 3 } }, "tests": [ { "description": "matches items, does not match contains", "data": [2, 4, 8], "valid": false }, { "description": "does not match items, matches contains", "data": [3, 6, 9], "valid": false }, { "description": "matches both items and contains", "data": [6, 12], "valid": true }, { "description": "matches neither items nor contains", "data": [1, 5], "valid": false }, { "description": "matches additionalProperties, does not match contains", "data": { "a": 2, "b": 4, "c": 8 }, "valid": false }, { "description": "does not match additionalProperties, matches contains", "data": { "a": 3, "b": 6, "c": 9 }, "valid": false }, { "description": "matches both additionalProperties and contains", "data": { "a": 6, "b": 12 }, "valid": true }, { "description": "matches neither additionalProperties nor contains", "data": { "a": 1, "b": 5 }, "valid": false } ] }, { "description": "contains with false if subschema", "schema": { "contains": { "if": false, "else": true } }, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "any non-empty object is valid", "data": { "a": "foo" }, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/dynamicRef.json000640 000766 000024 00000050137 14163671560 026212 0ustar00etherstaff000000 000000 [ { "description": "A $dynamicRef to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor", "schema": { "$id": "https://test.json-schema.org/dynamicRef-dynamicAnchor-same-schema/root", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $dynamicRef to an $anchor in the same schema resource should behave like a normal $ref to an $anchor", "schema": { "$id": "https://test.json-schema.org/dynamicRef-anchor-same-schema/root", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "foo": { "$anchor": "items", "type": "string" } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $ref to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor", "schema": { "$id": "https://test.json-schema.org/ref-dynamicAnchor-same-schema/root", "type": "array", "items": { "$ref": "#items" }, "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $dynamicRef should resolve to the first $dynamicAnchor still in scope that is encountered when the schema is evaluated", "schema": { "$id": "https://test.json-schema.org/typical-dynamic-resolution/root", "$ref": "list", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to satisfy the bookending requirement", "$dynamicAnchor": "items" } } } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $dynamicRef with intermediate scopes that don't include a matching $dynamicAnchor should not affect dynamic scope resolution", "schema": { "$id": "https://test.json-schema.org/dynamic-resolution-with-intermediate-scopes/root", "$ref": "intermediate-scope", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "intermediate-scope": { "$id": "intermediate-scope", "$ref": "list" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to satisfy the bookending requirement", "$dynamicAnchor": "items" } } } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "An $anchor with the same name as a $dynamicAnchor should not be used for dynamic scope resolution", "schema": { "$id": "https://test.json-schema.org/dynamic-resolution-ignores-anchors/root", "$ref": "list", "$defs": { "foo": { "$anchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to satisfy the bookending requirement", "$dynamicAnchor": "items" } } } } }, "tests": [ { "description": "Any array is valid", "data": ["foo", 42], "valid": true } ] }, { "description": "A $dynamicRef without a matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor", "schema": { "$id": "https://test.json-schema.org/dynamic-resolution-without-bookend/root", "$ref": "list", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to give the reference somewhere to resolve to when it behaves like $ref", "$anchor": "items" } } } } }, "tests": [ { "description": "Any array is valid", "data": ["foo", 42], "valid": true } ] }, { "description": "A $dynamicRef with a non-matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor", "schema": { "$id": "https://test.json-schema.org/unmatched-dynamic-anchor/root", "$ref": "list", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to give the reference somewhere to resolve to when it behaves like $ref", "$anchor": "items", "$dynamicAnchor": "foo" } } } } }, "tests": [ { "description": "Any array is valid", "data": ["foo", 42], "valid": true } ] }, { "description": "A $dynamicRef that initially resolves to a schema with a matching $dynamicAnchor should resolve to the first $dynamicAnchor in the dynamic scope", "schema": { "$id": "https://test.json-schema.org/relative-dynamic-reference/root", "$dynamicAnchor": "meta", "type": "object", "properties": { "foo": { "const": "pass" } }, "$ref": "extended", "$defs": { "extended": { "$id": "extended", "$dynamicAnchor": "meta", "type": "object", "properties": { "bar": { "$ref": "bar" } } }, "bar": { "$id": "bar", "type": "object", "properties": { "baz": { "$dynamicRef": "extended#meta" } } } } }, "tests": [ { "description": "The recursive part is valid against the root", "data": { "foo": "pass", "bar": { "baz": { "foo": "pass" } } }, "valid": true }, { "description": "The recursive part is not valid against the root", "data": { "foo": "pass", "bar": { "baz": { "foo": "fail" } } }, "valid": false } ] }, { "description": "A $dynamicRef that initially resolves to a schema without a matching $dynamicAnchor should behave like a normal $ref to $anchor", "schema": { "$id": "https://test.json-schema.org/relative-dynamic-reference-without-bookend/root", "$dynamicAnchor": "meta", "type": "object", "properties": { "foo": { "const": "pass" } }, "$ref": "extended", "$defs": { "extended": { "$id": "extended", "$anchor": "meta", "type": "object", "properties": { "bar": { "$ref": "bar" } } }, "bar": { "$id": "bar", "type": "object", "properties": { "baz": { "$dynamicRef": "extended#meta" } } } } }, "tests": [ { "description": "The recursive part doesn't need to validate against the root", "data": { "foo": "pass", "bar": { "baz": { "foo": "fail" } } }, "valid": true } ] }, { "description": "multiple dynamic paths to the $dynamicRef keyword", "schema": { "$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main", "$defs": { "inner": { "$id": "inner", "$dynamicAnchor": "foo", "title": "inner", "additionalProperties": { "$dynamicRef": "#foo" } } }, "if": { "propertyNames": { "pattern": "^[a-m]" } }, "then": { "title": "any type of node", "$id": "anyLeafNode", "$dynamicAnchor": "foo", "$ref": "inner" }, "else": { "title": "integer node", "$id": "integerNode", "$dynamicAnchor": "foo", "type": [ "object", "integer" ], "$ref": "inner" } }, "tests": [ { "description": "recurse to anyLeafNode - floats are allowed", "data": { "alpha": 1.1 }, "valid": true }, { "description": "recurse to integerNode - floats are not allowed", "data": { "november": 1.1 }, "valid": false } ] }, { "description": "after leaving a dynamic scope, it should not be used by a $dynamicRef", "schema": { "$id": "https://test.json-schema.org/dynamic-ref-leaving-dynamic-scope/main", "if": { "$id": "first_scope", "$defs": { "thingy": { "$comment": "this is first_scope#thingy", "$dynamicAnchor": "thingy", "type": "number" } } }, "then": { "$id": "second_scope", "$ref": "start", "$defs": { "thingy": { "$comment": "this is second_scope#thingy, the final destination of the $dynamicRef", "$dynamicAnchor": "thingy", "type": "null" } } }, "$defs": { "start": { "$comment": "this is the landing spot from $ref", "$id": "start", "$dynamicRef": "inner_scope#thingy" }, "thingy": { "$comment": "this is the first stop for the $dynamicRef", "$id": "inner_scope", "$dynamicAnchor": "thingy", "type": "string" } } }, "tests": [ { "description": "string matches /$defs/thingy, but the $dynamicRef does not stop here", "data": "a string", "valid": false }, { "description": "first_scope is not in dynamic scope for the $dynamicRef", "data": 42, "valid": false }, { "description": "/then/$defs/thingy is the final stop for the $dynamicRef", "data": null, "valid": true } ] }, { "description": "strict-tree schema, guards against misspelled properties", "schema": { "$id": "http://localhost:1234/strict-tree.json", "$dynamicAnchor": "node", "$ref": "tree.json", "unevaluatedProperties": false }, "tests": [ { "description": "instance with misspelled field", "data": { "children": [{ "daat": 1 }] }, "valid": false }, { "description": "instance with correct field", "data": { "children": [{ "data": 1 }] }, "valid": true } ] }, { "description": "tests for implementation dynamic anchor and reference link", "schema": { "$id": "http://localhost:1234/strict-extendible.json", "$ref": "extendible-dynamic-ref.json", "$defs": { "elements": { "$dynamicAnchor": "elements", "properties": { "a": true }, "required": ["a"], "additionalProperties": false } } }, "tests": [ { "description": "incorrect parent schema", "data": { "a": true }, "valid": false }, { "description": "incorrect extended schema", "data": { "elements": [ { "b": 1 } ] }, "valid": false }, { "description": "correct extended schema", "data": { "elements": [ { "a": 1 } ] }, "valid": true } ] }, { "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.", "schema": { "$id": "http://localhost:1234/strict-extendible-allof-defs-first.json", "allOf": [ { "$ref": "extendible-dynamic-ref.json" }, { "$defs": { "elements": { "$dynamicAnchor": "elements", "properties": { "a": true }, "required": ["a"], "additionalProperties": false } } } ] }, "tests": [ { "description": "incorrect parent schema", "data": { "a": true }, "valid": false }, { "description": "incorrect extended schema", "data": { "elements": [ { "b": 1 } ] }, "valid": false }, { "description": "correct extended schema", "data": { "elements": [ { "a": 1 } ] }, "valid": true } ] }, { "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.", "schema": { "$id": "http://localhost:1234/strict-extendible-allof-ref-first.json", "allOf": [ { "$defs": { "elements": { "$dynamicAnchor": "elements", "properties": { "a": true }, "required": ["a"], "additionalProperties": false } } }, { "$ref": "extendible-dynamic-ref.json" } ] }, "tests": [ { "description": "incorrect parent schema", "data": { "a": true }, "valid": false }, { "description": "incorrect extended schema", "data": { "elements": [ { "b": 1 } ] }, "valid": false }, { "description": "correct extended schema", "data": { "elements": [ { "a": 1 } ] }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/refOfUnknownKeyword.json000640 000766 000024 00000002214 14163671560 031735 0ustar00etherstaff000000 000000 [ { "description": "reference of a root arbitrary keyword ", "schema": { "unknown-keyword": {"type": "integer"}, "properties": { "bar": {"$ref": "#/unknown-keyword"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "reference of an arbitrary keyword of a sub-schema", "schema": { "properties": { "foo": {"unknown-keyword": {"type": "integer"}}, "bar": {"$ref": "#/properties/foo/unknown-keyword"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/bignum.json000640 000766 000024 00000005361 14163671560 027236 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": { "type": "integer" }, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true }, { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": { "type": "number" }, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true }, { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": { "type": "string" }, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": { "maximum": 18446744073709551615 }, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "exclusiveMaximum": 972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": { "minimum": -18446744073709551615 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "exclusiveMinimum": -972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format-assertion.json000640 000766 000024 00000002534 14163671560 031251 0ustar00etherstaff000000 000000 [ { "description": "schema that uses custom metaschema with format-assertion: false", "schema": { "$id": "https://schema/using/format-assertion/false", "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json", "format": "ipv4" }, "tests": [ { "description": "format-assertion: false: valid string", "data": "127.0.0.1", "valid": true }, { "description": "format-assertion: false: invalid string", "data": "not-an-ipv4", "valid": false } ] }, { "description": "schema that uses custom metaschema with format-assertion: true", "schema": { "$id": "https://schema/using/format-assertion/true", "$schema": "http://localhost:1234/draft2020-12/format-assertion-true.json", "format": "ipv4" }, "tests": [ { "description": "format-assertion: true: valid string", "data": "127.0.0.1", "valid": true }, { "description": "format-assertion: true: invalid string", "data": "not-an-ipv4", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 030436 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/000770 000766 000024 00000000000 14163671560 026346 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/float-overflow.json000640 000766 000024 00000000551 14163671560 030717 0ustar00etherstaff000000 000000 [ { "description": "all integers are multiples of 0.5, if overflow is handled", "schema": {"type": "integer", "multipleOf": 0.5}, "tests": [ { "description": "valid if optional overflow handling is implemented", "data": 1e308, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/ecmascript-regex.json000640 000766 000024 00000044205 14163671560 031217 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { "type": "string", "pattern": "^abc$" }, "tests": [ { "description": "matches in Python, but should not in jsonschema", "data": "abc\\n", "valid": false }, { "description": "should match", "data": "abc", "valid": true } ] }, { "description": "ECMA 262 regex converts \\t to horizontal tab", "schema": { "type": "string", "pattern": "^\\t$" }, "tests": [ { "description": "does not match", "data": "\\t", "valid": false }, { "description": "matches", "data": "\u0009", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and upper letter", "schema": { "type": "string", "pattern": "^\\cC$" }, "tests": [ { "description": "does not match", "data": "\\cC", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and lower letter", "schema": { "type": "string", "pattern": "^\\cc$" }, "tests": [ { "description": "does not match", "data": "\\cc", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 \\d matches ascii digits only", "schema": { "type": "string", "pattern": "^\\d$" }, "tests": [ { "description": "ASCII zero matches", "data": "0", "valid": true }, { "description": "NKO DIGIT ZERO does not match (unlike e.g. Python)", "data": "߀", "valid": false }, { "description": "NKO DIGIT ZERO (as \\u escape) does not match", "data": "\u07c0", "valid": false } ] }, { "description": "ECMA 262 \\D matches everything but ascii digits", "schema": { "type": "string", "pattern": "^\\D$" }, "tests": [ { "description": "ASCII zero does not match", "data": "0", "valid": false }, { "description": "NKO DIGIT ZERO matches (unlike e.g. Python)", "data": "߀", "valid": true }, { "description": "NKO DIGIT ZERO (as \\u escape) matches", "data": "\u07c0", "valid": true } ] }, { "description": "ECMA 262 \\w matches ascii letters only", "schema": { "type": "string", "pattern": "^\\w$" }, "tests": [ { "description": "ASCII 'a' matches", "data": "a", "valid": true }, { "description": "latin-1 e-acute does not match (unlike e.g. Python)", "data": "é", "valid": false } ] }, { "description": "ECMA 262 \\W matches everything but ascii letters", "schema": { "type": "string", "pattern": "^\\W$" }, "tests": [ { "description": "ASCII 'a' does not match", "data": "a", "valid": false }, { "description": "latin-1 e-acute matches (unlike e.g. Python)", "data": "é", "valid": true } ] }, { "description": "ECMA 262 \\s matches whitespace", "schema": { "type": "string", "pattern": "^\\s$" }, "tests": [ { "description": "ASCII space matches", "data": " ", "valid": true }, { "description": "Character tabulation matches", "data": "\t", "valid": true }, { "description": "Line tabulation matches", "data": "\u000b", "valid": true }, { "description": "Form feed matches", "data": "\u000c", "valid": true }, { "description": "latin-1 non-breaking-space matches", "data": "\u00a0", "valid": true }, { "description": "zero-width whitespace matches", "data": "\ufeff", "valid": true }, { "description": "line feed matches (line terminator)", "data": "\u000a", "valid": true }, { "description": "paragraph separator matches (line terminator)", "data": "\u2029", "valid": true }, { "description": "EM SPACE matches (Space_Separator)", "data": "\u2003", "valid": true }, { "description": "Non-whitespace control does not match", "data": "\u0001", "valid": false }, { "description": "Non-whitespace does not match", "data": "\u2013", "valid": false } ] }, { "description": "ECMA 262 \\S matches everything but whitespace", "schema": { "type": "string", "pattern": "^\\S$" }, "tests": [ { "description": "ASCII space does not match", "data": " ", "valid": false }, { "description": "Character tabulation does not match", "data": "\t", "valid": false }, { "description": "Line tabulation does not match", "data": "\u000b", "valid": false }, { "description": "Form feed does not match", "data": "\u000c", "valid": false }, { "description": "latin-1 non-breaking-space does not match", "data": "\u00a0", "valid": false }, { "description": "zero-width whitespace does not match", "data": "\ufeff", "valid": false }, { "description": "line feed does not match (line terminator)", "data": "\u000a", "valid": false }, { "description": "paragraph separator does not match (line terminator)", "data": "\u2029", "valid": false }, { "description": "EM SPACE does not match (Space_Separator)", "data": "\u2003", "valid": false }, { "description": "Non-whitespace control matches", "data": "\u0001", "valid": true }, { "description": "Non-whitespace matches", "data": "\u2013", "valid": true } ] }, { "description": "unicode semantics should be used for all pattern matching", "schema": { "pattern": "\\p{Letter}cole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters", "schema": { "pattern": "\\wcole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "pattern": "[a-z]cole" }, "tests": [ { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "ascii characters match", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true } ] }, { "description": "\\d in pattern matches [0-9], not unicode digits", "schema": { "pattern": "^\\d+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "pattern": "^\\p{digit}+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": true } ] }, { "description": "unicode semantics should be used for all patternProperties matching", "schema": { "type": "object", "patternProperties": { "\\p{Letter}cole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": true }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": true }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters", "schema": { "type": "object", "patternProperties": { "\\wcole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "type": "object", "patternProperties": { "[a-z]cole": true }, "additionalProperties": false }, "tests": [ { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "ascii characters match", "data": { "l'ecole": "pas de vraie vie" }, "valid": true } ] }, { "description": "\\d in patternProperties matches [0-9], not unicode digits", "schema": { "type": "object", "patternProperties": { "^\\d+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "type": "object", "patternProperties": { "^\\p{digit}+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/date.json000640 000766 000024 00000016426 14163671560 030166 0ustar00etherstaff000000 000000 [ { "description": "validation of date strings", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date string", "data": "1963-06-19", "valid": true }, { "description": "a valid date string with 31 days in January", "data": "2020-01-31", "valid": true }, { "description": "a invalid date string with 32 days in January", "data": "2020-01-32", "valid": false }, { "description": "a valid date string with 28 days in February (normal)", "data": "2021-02-28", "valid": true }, { "description": "a invalid date string with 29 days in February (normal)", "data": "2021-02-29", "valid": false }, { "description": "a valid date string with 29 days in February (leap)", "data": "2020-02-29", "valid": true }, { "description": "a invalid date string with 30 days in February (leap)", "data": "2020-02-30", "valid": false }, { "description": "a valid date string with 31 days in March", "data": "2020-03-31", "valid": true }, { "description": "a invalid date string with 32 days in March", "data": "2020-03-32", "valid": false }, { "description": "a valid date string with 30 days in April", "data": "2020-04-30", "valid": true }, { "description": "a invalid date string with 31 days in April", "data": "2020-04-31", "valid": false }, { "description": "a valid date string with 31 days in May", "data": "2020-05-31", "valid": true }, { "description": "a invalid date string with 32 days in May", "data": "2020-05-32", "valid": false }, { "description": "a valid date string with 30 days in June", "data": "2020-06-30", "valid": true }, { "description": "a invalid date string with 31 days in June", "data": "2020-06-31", "valid": false }, { "description": "a valid date string with 31 days in July", "data": "2020-07-31", "valid": true }, { "description": "a invalid date string with 32 days in July", "data": "2020-07-32", "valid": false }, { "description": "a valid date string with 31 days in August", "data": "2020-08-31", "valid": true }, { "description": "a invalid date string with 32 days in August", "data": "2020-08-32", "valid": false }, { "description": "a valid date string with 30 days in September", "data": "2020-09-30", "valid": true }, { "description": "a invalid date string with 31 days in September", "data": "2020-09-31", "valid": false }, { "description": "a valid date string with 31 days in October", "data": "2020-10-31", "valid": true }, { "description": "a invalid date string with 32 days in October", "data": "2020-10-32", "valid": false }, { "description": "a valid date string with 30 days in November", "data": "2020-11-30", "valid": true }, { "description": "a invalid date string with 31 days in November", "data": "2020-11-31", "valid": false }, { "description": "a valid date string with 31 days in December", "data": "2020-12-31", "valid": true }, { "description": "a invalid date string with 32 days in December", "data": "2020-12-32", "valid": false }, { "description": "a invalid date string with invalid month", "data": "2020-13-01", "valid": false }, { "description": "an invalid date string", "data": "06/19/1963", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false }, { "description": "non-padded month dates are not valid", "data": "1998-1-20", "valid": false }, { "description": "non-padded day dates are not valid", "data": "1998-01-1", "valid": false }, { "description": "invalid month", "data": "1998-13-01", "valid": false }, { "description": "invalid month-day combination", "data": "1998-04-31", "valid": false }, { "description": "2021 is not a leap year", "data": "2021-02-29", "valid": false }, { "description": "2020 is a leap year", "data": "2020-02-29", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1963-06-1৪", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/json-pointer.json000640 000766 000024 00000015063 14163671560 031674 0ustar00etherstaff000000 000000 [ { "description": "validation of JSON-pointers (JSON String Representation)", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid JSON-pointer", "data": "/foo/bar~0/baz~1/%a", "valid": true }, { "description": "not a valid JSON-pointer (~ not escaped)", "data": "/foo/bar~", "valid": false }, { "description": "valid JSON-pointer with empty segment", "data": "/foo//bar", "valid": true }, { "description": "valid JSON-pointer with the last empty segment", "data": "/foo/bar/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #1", "data": "", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #2", "data": "/foo", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #3", "data": "/foo/0", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #4", "data": "/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #5", "data": "/a~1b", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #6", "data": "/c%d", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #7", "data": "/e^f", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #8", "data": "/g|h", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #9", "data": "/i\\j", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #10", "data": "/k\"l", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #11", "data": "/ ", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #12", "data": "/m~0n", "valid": true }, { "description": "valid JSON-pointer used adding to the last array position", "data": "/foo/-", "valid": true }, { "description": "valid JSON-pointer (- used as object member name)", "data": "/foo/-/bar", "valid": true }, { "description": "valid JSON-pointer (multiple escaped characters)", "data": "/~1~0~0~1~1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #1", "data": "/~1.1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #2", "data": "/~0.1", "valid": true }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #1", "data": "#", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #2", "data": "#/", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #3", "data": "#a", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #1", "data": "/~0~", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #2", "data": "/~0/~", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #1", "data": "/~2", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #2", "data": "/~-1", "valid": false }, { "description": "not a valid JSON-pointer (multiple characters not escaped)", "data": "/~~", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1", "data": "a", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2", "data": "0", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3", "data": "a/a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/idn-hostname.json000640 000766 000024 00000034641 14163671560 031636 0ustar00etherstaff000000 000000 [ { "description": "validation of internationalized host names", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name (example.test in Hangul)", "data": "실례.테스트", "valid": true }, { "description": "illegal first char U+302E Hangul single dot tone mark", "data": "〮실례.테스트", "valid": false }, { "description": "contains illegal char U+302E Hangul single dot tone mark", "data": "실〮례.테스트", "valid": false }, { "description": "a host name with a component too long", "data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트", "valid": false }, { "description": "invalid label, correct Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1", "data": "-> $1.00 <--", "valid": false }, { "description": "valid Chinese Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4", "data": "xn--ihqwcrb4cv8a8dqg056pqjye", "valid": true }, { "description": "invalid Punycode", "comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "xn--X", "valid": false }, { "description": "U-label contains \"--\" in the 3rd and 4th position", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "XN--aa---o47jg78q", "valid": false }, { "description": "U-label starts with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello", "valid": false }, { "description": "U-label ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "hello-", "valid": false }, { "description": "U-label starts and ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello-", "valid": false }, { "description": "Begins with a Spacing Combining Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0903hello", "valid": false }, { "description": "Begins with a Nonspacing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0300hello", "valid": false }, { "description": "Begins with an Enclosing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0488hello", "valid": false }, { "description": "Exceptions that are PVALID, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u00df\u03c2\u0f0b\u3007", "valid": true }, { "description": "Exceptions that are PVALID, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u06fd\u06fe", "valid": true }, { "description": "Exceptions that are DISALLOWED, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u0640\u07fa", "valid": false }, { "description": "Exceptions that are DISALLOWED, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start", "data": "\u3031\u3032\u3033\u3034\u3035\u302e\u302f\u303b", "valid": false }, { "description": "MIDDLE DOT with no preceding 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "a\u00b7l", "valid": false }, { "description": "MIDDLE DOT with nothing preceding", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "\u00b7l", "valid": false }, { "description": "MIDDLE DOT with no following 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7a", "valid": false }, { "description": "MIDDLE DOT with nothing following", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7", "valid": false }, { "description": "MIDDLE DOT with surrounding 'l's", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7l", "valid": true }, { "description": "Greek KERAIA not followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375S", "valid": false }, { "description": "Greek KERAIA not followed by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375", "valid": false }, { "description": "Greek KERAIA followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375\u03b2", "valid": true }, { "description": "Hebrew GERESH not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "A\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05d0\u05f3\u05d1", "valid": true }, { "description": "Hebrew GERSHAYIM not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "A\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05d0\u05f4\u05d1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "def\u30fbabc", "valid": false }, { "description": "KATAKANA MIDDLE DOT with no other characters", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb", "valid": false }, { "description": "KATAKANA MIDDLE DOT with Hiragana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u3041", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Katakana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u30a1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u4e08", "valid": true }, { "description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0660\u06f0", "valid": false }, { "description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0628\u0660\u0628", "valid": true }, { "description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9", "data": "\u06f00", "valid": true }, { "description": "ZERO WIDTH JOINER not preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u094d\u200d\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1", "data": "\u0915\u094d\u200c\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement", "data": "\u0628\u064a\u200c\u0628\u064a", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/uri.json000640 000766 000024 00000007165 14163671560 030050 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid URL with anchor tag and parentheses", "data": "http://foo.com/blah_(wikipedia)_blah#cite-1", "valid": true }, { "description": "a valid URL with URL-encoded stuff", "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid puny-coded URL ", "data": "http://xn--nw2a.xn--j6w193g/", "valid": true }, { "description": "a valid URL with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid URL based on IPv4", "data": "http://223.255.255.254", "valid": true }, { "description": "a valid URL with ftp scheme", "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt", "valid": true }, { "description": "a valid URL for a simple text file", "data": "http://www.ietf.org/rfc/rfc2396.txt", "valid": true }, { "description": "a valid URL ", "data": "ldap://[2001:db8::7]/c=GB?objectClass?one", "valid": true }, { "description": "a valid mailto URI", "data": "mailto:John.Doe@example.com", "valid": true }, { "description": "a valid newsgroup URI", "data": "news:comp.infosystems.www.servers.unix", "valid": true }, { "description": "a valid tel URI", "data": "tel:+1-816-555-1212", "valid": true }, { "description": "a valid URN", "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid relative URI Reference", "data": "/abc", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false }, { "description": "an invalid URI with spaces", "data": "http:// shouldfail.com", "valid": false }, { "description": "an invalid URI with spaces and missing scheme", "data": ":// should fail", "valid": false }, { "description": "an invalid URI with comma in scheme", "data": "bar,baz:foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/uri-template.json000640 000766 000024 00000003431 14163671560 031651 0ustar00etherstaff000000 000000 [ { "description": "format: uri-template", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid uri-template", "data": "http://example.com/dictionary/{term:1}/{term}", "valid": true }, { "description": "an invalid uri-template", "data": "http://example.com/dictionary/{term:1}/{term", "valid": false }, { "description": "a valid uri-template without variables", "data": "http://example.com/dictionary", "valid": true }, { "description": "a valid relative uri-template", "data": "dictionary/{term:1}/{term}", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/iri-reference.json000640 000766 000024 00000004312 14163671560 031757 0ustar00etherstaff000000 000000 [ { "description": "validation of IRI References", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid protocol-relative IRI Reference", "data": "//ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid relative IRI Reference", "data": "/âππ", "valid": true }, { "description": "an invalid IRI Reference", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "a valid IRI Reference", "data": "âππ", "valid": true }, { "description": "a valid IRI fragment", "data": "#ƒrägmênt", "valid": true }, { "description": "an invalid IRI fragment", "data": "#ƒräg\\mênt", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/iri.json000640 000766 000024 00000005324 14163671560 030027 0ustar00etherstaff000000 000000 [ { "description": "validation of IRIs", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI with anchor tag", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid IRI with anchor tag and parentheses", "data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1", "valid": true }, { "description": "a valid IRI with URL-encoded stuff", "data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid IRI with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid IRI based on IPv6", "data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]", "valid": true }, { "description": "an invalid IRI based on IPv6", "data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334", "valid": false }, { "description": "an invalid relative IRI Reference", "data": "/abc", "valid": false }, { "description": "an invalid IRI", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "an invalid IRI though valid IRI reference", "data": "âππ", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/ipv4.json000640 000766 000024 00000005415 14163671560 030127 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false }, { "description": "an IP address without 4 components", "data": "127.0", "valid": false }, { "description": "an IP address as an integer", "data": "0x7f000001", "valid": false }, { "description": "an IP address as an integer (decimal)", "data": "2130706433", "valid": false }, { "description": "leading zeroes should be rejected, as they are treated as octals", "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", "data": "087.10.0.1", "valid": false }, { "description": "value without leading zero is valid", "data": "87.10.0.1", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1২7.0.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/uri-reference.json000640 000766 000024 00000004237 14163671560 032001 0ustar00etherstaff000000 000000 [ { "description": "validation of URI References", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid relative URI Reference", "data": "/abc", "valid": true }, { "description": "an invalid URI Reference", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "a valid URI Reference", "data": "abc", "valid": true }, { "description": "a valid URI fragment", "data": "#fragment", "valid": true }, { "description": "an invalid URI fragment", "data": "#frag\\ment", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/time.json000640 000766 000024 00000015211 14163671560 030176 0ustar00etherstaff000000 000000 [ { "description": "validation of time strings", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid time string", "data": "08:30:06Z", "valid": true }, { "description": "a valid time string with leap second, Zulu", "data": "23:59:60Z", "valid": true }, { "description": "invalid leap second, Zulu (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "invalid leap second, Zulu (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "valid leap second, zero time-offset", "data": "23:59:60+00:00", "valid": true }, { "description": "invalid leap second, zero time-offset (wrong hour)", "data": "22:59:60+00:00", "valid": false }, { "description": "invalid leap second, zero time-offset (wrong minute)", "data": "23:58:60+00:00", "valid": false }, { "description": "valid leap second, positive time-offset", "data": "01:29:60+01:30", "valid": true }, { "description": "valid leap second, large positive time-offset", "data": "23:29:60+23:30", "valid": true }, { "description": "invalid leap second, positive time-offset (wrong hour)", "data": "23:59:60+01:00", "valid": false }, { "description": "invalid leap second, positive time-offset (wrong minute)", "data": "23:59:60+00:30", "valid": false }, { "description": "valid leap second, negative time-offset", "data": "15:59:60-08:00", "valid": true }, { "description": "valid leap second, large negative time-offset", "data": "00:29:60-23:30", "valid": true }, { "description": "invalid leap second, negative time-offset (wrong hour)", "data": "23:59:60-01:00", "valid": false }, { "description": "invalid leap second, negative time-offset (wrong minute)", "data": "23:59:60-00:30", "valid": false }, { "description": "a valid time string with second fraction", "data": "23:20:50.52Z", "valid": true }, { "description": "a valid time string with precise second fraction", "data": "08:30:06.283185Z", "valid": true }, { "description": "a valid time string with plus offset", "data": "08:30:06+00:20", "valid": true }, { "description": "a valid time string with minus offset", "data": "08:30:06-08:00", "valid": true }, { "description": "a valid time string with case-insensitive Z", "data": "08:30:06z", "valid": true }, { "description": "an invalid time string with invalid hour", "data": "24:00:00Z", "valid": false }, { "description": "an invalid time string with invalid minute", "data": "00:60:00Z", "valid": false }, { "description": "an invalid time string with invalid second", "data": "00:00:61Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "an invalid time string with invalid time numoffset hour", "data": "01:02:03+24:00", "valid": false }, { "description": "an invalid time string with invalid time numoffset minute", "data": "01:02:03+00:60", "valid": false }, { "description": "an invalid time string with invalid time with both Z and numoffset", "data": "01:02:03Z+00:30", "valid": false }, { "description": "an invalid offset indicator", "data": "08:30:06 PST", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "01:01:01,1111", "valid": false }, { "description": "no time offset", "data": "12:00:00", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1২:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/ipv6.json000640 000766 000024 00000015440 14163671560 030130 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "trailing 4 hex symbols is valid", "data": "::abef", "valid": true }, { "description": "trailing 5 hex symbols is invalid", "data": "::abcef", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::42:ff:1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "missing leading octet is invalid", "data": ":2:3:4:5:6:7:8", "valid": false }, { "description": "missing trailing octet is invalid", "data": "1:2:3:4:5:6:7:", "valid": false }, { "description": "missing leading octet with omitted octets later", "data": ":2:3:4::8", "valid": false }, { "description": "single set of double colons in the middle is valid", "data": "1:d6::42", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false }, { "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", "data": "::ffff:192.168.0.1", "valid": true }, { "description": "triple colons is invalid", "data": "1:2:3:4:5:::8", "valid": false }, { "description": "8 octets", "data": "1:2:3:4:5:6:7:8", "valid": true }, { "description": "insufficient octets without double colons", "data": "1:2:3:4:5:6:7", "valid": false }, { "description": "no colons is invalid", "data": "1", "valid": false }, { "description": "ipv4 is not ipv6", "data": "127.0.0.1", "valid": false }, { "description": "ipv4 segment must have 4 octets", "data": "1:2:3:4:1.2.3", "valid": false }, { "description": "leading whitespace is invalid", "data": " ::1", "valid": false }, { "description": "trailing whitespace is invalid", "data": "::1 ", "valid": false }, { "description": "netmask is not a part of ipv6 address", "data": "fe80::/64", "valid": false }, { "description": "zone id is not a part of ipv6 address", "data": "fe80::a%eth1", "valid": false }, { "description": "a long valid ipv6", "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", "valid": true }, { "description": "a long invalid ipv6, below length limit, first", "data": "100:100:100:100:100:100:255.255.255.255.255", "valid": false }, { "description": "a long invalid ipv6, below length limit, second", "data": "100:100:100:100:100:100:100:255.255.255.255", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1:2:3:4:5:6:7:৪", "valid": false }, { "description": "non-ascii digits should be rejected in the ipv4 portion also", "data": "1:2::192.16৪.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/hostname.json000640 000766 000024 00000006224 14163671560 031062 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a valid punycoded IDN hostname", "data": "xn--4gbwdl.xn--wgbh1c", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/uuid.json000640 000766 000024 00000005301 14163671560 030205 0ustar00etherstaff000000 000000 [ { "description": "uuid format", "schema": { "format": "uuid" }, "tests": [ { "description": "all upper-case", "data": "2EB8AA08-AA98-11EA-B4AA-73B441D16380", "valid": true }, { "description": "all lower-case", "data": "2eb8aa08-aa98-11ea-b4aa-73b441d16380", "valid": true }, { "description": "mixed case", "data": "2eb8aa08-AA98-11ea-B4Aa-73B441D16380", "valid": true }, { "description": "all zeroes is valid", "data": "00000000-0000-0000-0000-000000000000", "valid": true }, { "description": "wrong length", "data": "2eb8aa08-aa98-11ea-b4aa-73b441d1638", "valid": false }, { "description": "missing section", "data": "2eb8aa08-aa98-11ea-73b441d16380", "valid": false }, { "description": "bad characters (not hex)", "data": "2eb8aa08-aa98-11ea-b4ga-73b441d16380", "valid": false }, { "description": "no dashes", "data": "2eb8aa08aa9811eab4aa73b441d16380", "valid": false }, { "description": "too few dashes", "data": "2eb8aa08aa98-11ea-b4aa73b441d16380", "valid": false }, { "description": "too many dashes", "data": "2eb8-aa08-aa98-11ea-b4aa73b44-1d16380", "valid": false }, { "description": "dashes in the wrong spot", "data": "2eb8aa08aa9811eab4aa73b441d16380----", "valid": false }, { "description": "valid version 4", "data": "98d80576-482e-427f-8434-7f86890ab222", "valid": true }, { "description": "valid version 5", "data": "99c17cbb-656f-564a-940f-1a4568f03487", "valid": true }, { "description": "hypothetical version 6", "data": "99c17cbb-656f-664a-940f-1a4568f03487", "valid": true }, { "description": "hypothetical version 15", "data": "99c17cbb-656f-f64a-940f-1a4568f03487", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/email.json000640 000766 000024 00000005104 14163671560 030327 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/duration.json000640 000766 000024 00000007342 14163671560 031073 0ustar00etherstaff000000 000000 [ { "description": "validation of duration strings", "schema": { "format": "duration" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid duration string", "data": "P4DT12H30M5S", "valid": true }, { "description": "an invalid duration string", "data": "PT1D", "valid": false }, { "description": "no elements present", "data": "P", "valid": false }, { "description": "no time elements present", "data": "P1YT", "valid": false }, { "description": "no date or time elements present", "data": "PT", "valid": false }, { "description": "elements out of order", "data": "P2D1Y", "valid": false }, { "description": "missing time separator", "data": "P1D2H", "valid": false }, { "description": "time element in the date position", "data": "P2S", "valid": false }, { "description": "four years duration", "data": "P4Y", "valid": true }, { "description": "zero time, in seconds", "data": "PT0S", "valid": true }, { "description": "zero time, in days", "data": "P0D", "valid": true }, { "description": "one month duration", "data": "P1M", "valid": true }, { "description": "one minute duration", "data": "PT1M", "valid": true }, { "description": "one and a half days, in hours", "data": "PT36H", "valid": true }, { "description": "one and a half days, in days and hours", "data": "P1DT12H", "valid": true }, { "description": "two weeks", "data": "P2W", "valid": true }, { "description": "weeks cannot be combined with other units", "data": "P1Y2W", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "P২Y", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/relative-json-pointer.json000640 000766 000024 00000005040 14163671560 033477 0ustar00etherstaff000000 000000 [ { "description": "validation of Relative JSON Pointers (RJP)", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid upwards RJP", "data": "1", "valid": true }, { "description": "a valid downwards RJP", "data": "0/foo/bar", "valid": true }, { "description": "a valid up and then down RJP, with array index", "data": "2/0/baz/1/zip", "valid": true }, { "description": "a valid RJP taking the member or index name", "data": "0#", "valid": true }, { "description": "an invalid RJP that is a valid JSON Pointer", "data": "/foo/bar", "valid": false }, { "description": "negative prefix", "data": "-1/foo/bar", "valid": false }, { "description": "## is not a valid json-pointer", "data": "0##", "valid": false }, { "description": "zero cannot be followed by other digits, plus json-pointer", "data": "01/a", "valid": false }, { "description": "zero cannot be followed by other digits, plus octothorpe", "data": "01#", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/date-time.json000640 000766 000024 00000011064 14163671560 031113 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "a valid date-time string without second fraction", "data": "1963-06-19T08:30:06Z", "valid": true }, { "description": "a valid date-time string with plus offset", "data": "1937-01-01T12:00:27.87+00:20", "valid": true }, { "description": "a valid date-time string with minus offset", "data": "1990-12-31T15:59:50.123-08:00", "valid": true }, { "description": "a valid date-time with a leap second, UTC", "data": "1998-12-31T23:59:60Z", "valid": true }, { "description": "a valid date-time with a leap second, with minus offset", "data": "1998-12-31T15:59:60.123-08:00", "valid": true }, { "description": "an invalid date-time past leap second, UTC", "data": "1998-12-31T23:59:61Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong minute, UTC", "data": "1998-12-31T23:58:60Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong hour, UTC", "data": "1998-12-31T22:59:60Z", "valid": false }, { "description": "an invalid day in date-time string", "data": "1990-02-31T15:59:59.123-08:00", "valid": false }, { "description": "an invalid offset in date-time string", "data": "1990-12-31T15:59:59-24:00", "valid": false }, { "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false }, { "description": "non-ascii digits should be rejected in the date portion", "data": "1963-06-1৪T00:00:00Z", "valid": false }, { "description": "non-ascii digits should be rejected in the time portion", "data": "1963-06-11T0৪:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/regex.json000640 000766 000024 00000002616 14163671560 030357 0ustar00etherstaff000000 000000 [ { "description": "validation of regular expressions", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid regular expression", "data": "([abc])+\\s+$", "valid": true }, { "description": "a regular expression with unclosed parens is invalid", "data": "^(abc]", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft-next/optional/format/idn-email.json000640 000766 000024 00000003354 14163671560 031104 0ustar00etherstaff000000 000000 [ { "description": "validation of an internationalized e-mail addresses", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid idn e-mail (example@example.test in Hangul)", "data": "실례@실례.테스트", "valid": true }, { "description": "an invalid idn e-mail address", "data": "2962", "valid": false }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/uniqueItems.json000640 000766 000024 00000032740 14163671560 025554 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1, "{}"], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "different objects are unique", "data": [{"a": 1, "b": 2}, {"a": 2, "b": 1}], "valid": true }, { "description": "objects are non-unique despite key order", "data": [{"a": 1, "b": 2}, {"b": 2, "a": 1}], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/minItems.json000640 000766 000024 00000001265 14163671560 025027 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/additionalProperties.json000640 000766 000024 00000007754 14163671560 027440 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "allOf": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in allOf are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/dependencies.json000640 000766 000024 00000015334 14163671560 025672 0ustar00etherstaff000000 000000 [ { "description": "dependencies", "schema": { "dependencies": {"bar": ["foo"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "dependencies with empty array", "schema": { "dependencies": {"bar": []} }, "tests": [ { "description": "empty object", "data": {}, "valid": true }, { "description": "object with one property", "data": {"bar": 2}, "valid": true }, { "description": "non-object is valid", "data": 1, "valid": true } ] }, { "description": "multiple dependencies", "schema": { "dependencies": {"quux": ["foo", "bar"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "multiple dependencies subschema", "schema": { "dependencies": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false } ] }, { "description": "dependencies with boolean subschemas", "schema": { "dependencies": { "foo": true, "bar": false } }, "tests": [ { "description": "object with property having schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property having schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "dependencies with escaped characters", "schema": { "dependencies": { "foo\nbar": ["foo\rbar"], "foo\tbar": { "minProperties": 4 }, "foo'bar": {"required": ["foo\"bar"]}, "foo\"bar": ["foo'bar"] } }, "tests": [ { "description": "valid object 1", "data": { "foo\nbar": 1, "foo\rbar": 2 }, "valid": true }, { "description": "valid object 2", "data": { "foo\tbar": 1, "a": 2, "b": 3, "c": 4 }, "valid": true }, { "description": "valid object 3", "data": { "foo'bar": 1, "foo\"bar": 2 }, "valid": true }, { "description": "invalid object 1", "data": { "foo\nbar": 1, "foo": 2 }, "valid": false }, { "description": "invalid object 2", "data": { "foo\tbar": 1, "a": 2 }, "valid": false }, { "description": "invalid object 3", "data": { "foo'bar": 1 }, "valid": false }, { "description": "invalid object 4", "data": { "foo\"bar": 2 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/exclusiveMinimum.json000640 000766 000024 00000001407 14163671560 026603 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMinimum validation", "schema": { "exclusiveMinimum": 1.1 }, "tests": [ { "description": "above the exclusiveMinimum is valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false }, { "description": "below the exclusiveMinimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/const.json000640 000766 000024 00000022564 14163671560 024375 0ustar00etherstaff000000 000000 [ { "description": "const validation", "schema": {"const": 2}, "tests": [ { "description": "same value is valid", "data": 2, "valid": true }, { "description": "another value is invalid", "data": 5, "valid": false }, { "description": "another type is invalid", "data": "a", "valid": false } ] }, { "description": "const with object", "schema": {"const": {"foo": "bar", "baz": "bax"}}, "tests": [ { "description": "same object is valid", "data": {"foo": "bar", "baz": "bax"}, "valid": true }, { "description": "same object with different property order is valid", "data": {"baz": "bax", "foo": "bar"}, "valid": true }, { "description": "another object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "another type is invalid", "data": [1, 2], "valid": false } ] }, { "description": "const with array", "schema": {"const": [{ "foo": "bar" }]}, "tests": [ { "description": "same array is valid", "data": [{"foo": "bar"}], "valid": true }, { "description": "another array item is invalid", "data": [2], "valid": false }, { "description": "array with additional items is invalid", "data": [1, 2, 3], "valid": false } ] }, { "description": "const with null", "schema": {"const": null}, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "not null is invalid", "data": 0, "valid": false } ] }, { "description": "const with false does not match 0", "schema": {"const": false}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "const with true does not match 1", "schema": {"const": true}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "const with [false] does not match [0]", "schema": {"const": [false]}, "tests": [ { "description": "[false] is valid", "data": [false], "valid": true }, { "description": "[0] is invalid", "data": [0], "valid": false }, { "description": "[0.0] is invalid", "data": [0.0], "valid": false } ] }, { "description": "const with [true] does not match [1]", "schema": {"const": [true]}, "tests": [ { "description": "[true] is valid", "data": [true], "valid": true }, { "description": "[1] is invalid", "data": [1], "valid": false }, { "description": "[1.0] is invalid", "data": [1.0], "valid": false } ] }, { "description": "const with {\"a\": false} does not match {\"a\": 0}", "schema": {"const": {"a": false}}, "tests": [ { "description": "{\"a\": false} is valid", "data": {"a": false}, "valid": true }, { "description": "{\"a\": 0} is invalid", "data": {"a": 0}, "valid": false }, { "description": "{\"a\": 0.0} is invalid", "data": {"a": 0.0}, "valid": false } ] }, { "description": "const with {\"a\": true} does not match {\"a\": 1}", "schema": {"const": {"a": true}}, "tests": [ { "description": "{\"a\": true} is valid", "data": {"a": true}, "valid": true }, { "description": "{\"a\": 1} is invalid", "data": {"a": 1}, "valid": false }, { "description": "{\"a\": 1.0} is invalid", "data": {"a": 1.0}, "valid": false } ] }, { "description": "const with 0 does not match other zero-like types", "schema": {"const": 0}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "empty string is invalid", "data": "", "valid": false } ] }, { "description": "const with 1 does not match true", "schema": {"const": 1}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "const with -2.0 matches integer and float types", "schema": {"const": -2.0}, "tests": [ { "description": "integer -2 is valid", "data": -2, "valid": true }, { "description": "integer 2 is invalid", "data": 2, "valid": false }, { "description": "float -2.0 is valid", "data": -2.0, "valid": true }, { "description": "float 2.0 is invalid", "data": 2.0, "valid": false }, { "description": "float -2.00001 is invalid", "data": -2.00001, "valid": false } ] }, { "description": "float and integers are equal up to 64-bit representation limits", "schema": {"const": 9007199254740992}, "tests": [ { "description": "integer is valid", "data": 9007199254740992, "valid": true }, { "description": "integer minus one is invalid", "data": 9007199254740991, "valid": false }, { "description": "float is valid", "data": 9007199254740992.0, "valid": true }, { "description": "float minus one is invalid", "data": 9007199254740991.0, "valid": false } ] }, { "description": "nul characters in strings", "schema": { "const": "hello\u0000there" }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/anyOf.json000640 000766 000024 00000012547 14163671560 024323 0ustar00etherstaff000000 000000 [ { "description": "anyOf", "schema": { "anyOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first anyOf valid", "data": 1, "valid": true }, { "description": "second anyOf valid", "data": 2.5, "valid": true }, { "description": "both anyOf valid", "data": 3, "valid": true }, { "description": "neither anyOf valid", "data": 1.5, "valid": false } ] }, { "description": "anyOf with base schema", "schema": { "type": "string", "anyOf" : [ { "maxLength": 2 }, { "minLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one anyOf valid", "data": "foobar", "valid": true }, { "description": "both anyOf invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf with boolean schemas, all true", "schema": {"anyOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, some true", "schema": {"anyOf": [true, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, all false", "schema": {"anyOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf complex types", "schema": { "anyOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first anyOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second anyOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both anyOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "neither anyOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "anyOf with one empty schema", "schema": { "anyOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is valid", "data": 123, "valid": true } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/propertyNames.json000640 000766 000024 00000005577 14163671560 026124 0ustar00etherstaff000000 000000 [ { "description": "propertyNames validation", "schema": { "propertyNames": {"maxLength": 3} }, "tests": [ { "description": "all property names valid", "data": { "f": {}, "foo": {} }, "valid": true }, { "description": "some property names invalid", "data": { "foo": {}, "foobar": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [1, 2, 3, 4], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "propertyNames validation with pattern", "schema": { "propertyNames": { "pattern": "^a+$" } }, "tests": [ { "description": "matching property names valid", "data": { "a": {}, "aa": {}, "aaa": {} }, "valid": true }, { "description": "non-matching property name is invalid", "data": { "aaA": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema true", "schema": {"propertyNames": true}, "tests": [ { "description": "object with any properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema false", "schema": {"propertyNames": false}, "tests": [ { "description": "object with any properties is invalid", "data": {"foo": 1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/unknownKeyword.json000640 000766 000024 00000003742 14163671560 026310 0ustar00etherstaff000000 000000 [ { "description": "$id inside an unknown keyword is not a real identifier", "comment": "the implementation must not be confused by an $id in locations we do not know how to parse", "schema": { "definitions": { "id_in_unknown0": { "not": { "array_of_schemas": [ { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "null" } ] } }, "real_id_in_schema": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "string" }, "id_in_unknown1": { "not": { "object_of_schemas": { "foo": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "integer" } } } } }, "anyOf": [ { "$ref": "#/definitions/id_in_unknown0" }, { "$ref": "#/definitions/id_in_unknown1" }, { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" } ] }, "tests": [ { "description": "type matches second anyOf, which has a real schema in it", "data": "a string", "valid": true }, { "description": "type matches non-schema in first anyOf", "data": null, "valid": false }, { "description": "type matches non-schema in third anyOf", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/boolean_schema.json000640 000766 000024 00000005402 14163671560 026176 0ustar00etherstaff000000 000000 [ { "description": "boolean schema 'true'", "schema": true, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is valid", "data": "foo", "valid": true }, { "description": "boolean true is valid", "data": true, "valid": true }, { "description": "boolean false is valid", "data": false, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "object is valid", "data": {"foo": "bar"}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true }, { "description": "array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "boolean schema 'false'", "schema": false, "tests": [ { "description": "number is invalid", "data": 1, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "boolean true is invalid", "data": true, "valid": false }, { "description": "boolean false is invalid", "data": false, "valid": false }, { "description": "null is invalid", "data": null, "valid": false }, { "description": "object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/not.json000640 000766 000024 00000005376 14163671560 024051 0ustar00etherstaff000000 000000 [ { "description": "not", "schema": { "not": {"type": "integer"} }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "not multiple types", "schema": { "not": {"type": ["integer", "boolean"]} }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "not more complex schema", "schema": { "not": { "type": "object", "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "forbidden property", "schema": { "properties": { "foo": { "not": {} } } }, "tests": [ { "description": "property present", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "property absent", "data": {"bar": 1, "baz": 2}, "valid": true } ] }, { "description": "not with boolean schema true", "schema": {"not": true}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "not with boolean schema false", "schema": {"not": false}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/items.json000640 000766 000024 00000016225 14163671560 024365 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "length": 1 }, "valid": true } ] }, { "description": "an array of schemas for items", "schema": { "items": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false }, { "description": "incomplete array of items", "data": [ 1 ], "valid": true }, { "description": "array with additional items", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array", "data": [ ], "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "1": "valid", "length": 2 }, "valid": true } ] }, { "description": "items with boolean schema (true)", "schema": {"items": true}, "tests": [ { "description": "any array is valid", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schema (false)", "schema": {"items": false}, "tests": [ { "description": "any non-empty array is invalid", "data": [ 1, "foo", true ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schemas", "schema": { "items": [true, false] }, "tests": [ { "description": "array with one item is valid", "data": [ 1 ], "valid": true }, { "description": "array with two items is invalid", "data": [ 1, "foo" ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items and subitems", "schema": { "definitions": { "item": { "type": "array", "additionalItems": false, "items": [ { "$ref": "#/definitions/sub-item" }, { "$ref": "#/definitions/sub-item" } ] }, "sub-item": { "type": "object", "required": ["foo"] } }, "type": "array", "additionalItems": false, "items": [ { "$ref": "#/definitions/item" }, { "$ref": "#/definitions/item" }, { "$ref": "#/definitions/item" } ] }, "tests": [ { "description": "valid items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": true }, { "description": "too many items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "too many sub-items", "data": [ [ {"foo": null}, {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong item", "data": [ {"foo": null}, [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong sub-item", "data": [ [ {}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "fewer items is valid", "data": [ [ {"foo": null} ], [ {"foo": null} ] ], "valid": true } ] }, { "description": "nested items", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } }, "tests": [ { "description": "valid nested array", "data": [[[[1]], [[2],[3]]], [[[4], [5], [6]]]], "valid": true }, { "description": "nested array with invalid type", "data": [[[["1"]], [[2],[3]]], [[[4], [5], [6]]]], "valid": false }, { "description": "not deep enough", "data": [[[1], [2],[3]], [[4], [5], [6]]], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/enum.json000640 000766 000024 00000014643 14163671560 024212 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false }, { "description": "valid object matches", "data": {"foo": 12}, "valid": true }, { "description": "extra properties in object is invalid", "data": {"foo": 12, "boo": 42}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"]} }, "required": ["bar"] }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "enum with escaped characters", "schema": { "enum": ["foo\nbar", "foo\rbar"] }, "tests": [ { "description": "member 1 is valid", "data": "foo\nbar", "valid": true }, { "description": "member 2 is valid", "data": "foo\rbar", "valid": true }, { "description": "another string is invalid", "data": "abc", "valid": false } ] }, { "description": "enum with false does not match 0", "schema": {"enum": [false]}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true } ] }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/minProperties.json000640 000766 000024 00000001754 14163671560 026105 0ustar00etherstaff000000 000000 [ { "description": "minProperties validation", "schema": {"minProperties": 1}, "tests": [ { "description": "longer is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1}, "valid": true }, { "description": "too short is invalid", "data": {}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/properties.json000640 000766 000024 00000012034 14163671560 025432 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] }, { "description": "properties with boolean schema", "schema": { "properties": { "foo": true, "bar": false } }, "tests": [ { "description": "no property present is valid", "data": {}, "valid": true }, { "description": "only 'true' property present is valid", "data": {"foo": 1}, "valid": true }, { "description": "only 'false' property present is invalid", "data": {"bar": 2}, "valid": false }, { "description": "both properties present is invalid", "data": {"foo": 1, "bar": 2}, "valid": false } ] }, { "description": "properties with escaped characters", "schema": { "properties": { "foo\nbar": {"type": "number"}, "foo\"bar": {"type": "number"}, "foo\\bar": {"type": "number"}, "foo\rbar": {"type": "number"}, "foo\tbar": {"type": "number"}, "foo\fbar": {"type": "number"} } }, "tests": [ { "description": "object with all numbers is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1", "foo\\bar": "1", "foo\rbar": "1", "foo\tbar": "1", "foo\fbar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/maxLength.json000640 000766 000024 00000001600 14163671560 025162 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/infinite-loop-detection.json000640 000766 000024 00000001746 14163671560 027776 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "definitions": { "int": { "type": "integer" } }, "allOf": [ { "properties": { "foo": { "$ref": "#/definitions/int" } } }, { "additionalProperties": { "$ref": "#/definitions/int" } } ] }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/exclusiveMaximum.json000640 000766 000024 00000001407 14163671560 026605 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMaximum validation", "schema": { "exclusiveMaximum": 3.0 }, "tests": [ { "description": "below the exclusiveMaximum is valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false }, { "description": "above the exclusiveMaximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/minimum.json000640 000766 000024 00000003612 14163671560 024713 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/000770 000766 000024 00000000000 14163671560 024171 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/oneOf.json000640 000766 000024 00000016123 14163671560 024307 0ustar00etherstaff000000 000000 [ { "description": "oneOf", "schema": { "oneOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first oneOf valid", "data": 1, "valid": true }, { "description": "second oneOf valid", "data": 2.5, "valid": true }, { "description": "both oneOf valid", "data": 3, "valid": false }, { "description": "neither oneOf valid", "data": 1.5, "valid": false } ] }, { "description": "oneOf with base schema", "schema": { "type": "string", "oneOf" : [ { "minLength": 2 }, { "maxLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one oneOf valid", "data": "foobar", "valid": true }, { "description": "both oneOf valid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all true", "schema": {"oneOf": [true, true, true]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, one true", "schema": {"oneOf": [true, false, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "oneOf with boolean schemas, more than one true", "schema": {"oneOf": [true, true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all false", "schema": {"oneOf": [false, false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf complex types", "schema": { "oneOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second oneOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both oneOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": false }, { "description": "neither oneOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "oneOf with empty schema", "schema": { "oneOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "one valid - valid", "data": "foo", "valid": true }, { "description": "both valid - invalid", "data": 123, "valid": false } ] }, { "description": "oneOf with required", "schema": { "type": "object", "oneOf": [ { "required": ["foo", "bar"] }, { "required": ["foo", "baz"] } ] }, "tests": [ { "description": "both invalid - invalid", "data": {"bar": 2}, "valid": false }, { "description": "first valid - valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "second valid - valid", "data": {"foo": 1, "baz": 3}, "valid": true }, { "description": "both valid - invalid", "data": {"foo": 1, "bar": 2, "baz" : 3}, "valid": false } ] }, { "description": "oneOf with missing optional property", "schema": { "oneOf": [ { "properties": { "bar": true, "baz": true }, "required": ["bar"] }, { "properties": { "foo": true }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid", "data": {"bar": 8}, "valid": true }, { "description": "second oneOf valid", "data": {"foo": "foo"}, "valid": true }, { "description": "both oneOf valid", "data": {"foo": "foo", "bar": 8}, "valid": false }, { "description": "neither oneOf valid", "data": {"baz": "quux"}, "valid": false } ] }, { "description": "nested oneOf, to check validation semantics", "schema": { "oneOf": [ { "oneOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/if-then-else.json000640 000766 000024 00000015322 14163671560 025521 0ustar00etherstaff000000 000000 [ { "description": "ignore if without then or else", "schema": { "if": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone if", "data": 0, "valid": true }, { "description": "valid when invalid against lone if", "data": "hello", "valid": true } ] }, { "description": "ignore then without if", "schema": { "then": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone then", "data": 0, "valid": true }, { "description": "valid when invalid against lone then", "data": "hello", "valid": true } ] }, { "description": "ignore else without if", "schema": { "else": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone else", "data": 0, "valid": true }, { "description": "valid when invalid against lone else", "data": "hello", "valid": true } ] }, { "description": "if and then without else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid when if test fails", "data": 3, "valid": true } ] }, { "description": "if and else without then", "schema": { "if": { "exclusiveMaximum": 0 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid when if test passes", "data": -1, "valid": true }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "validate against correct branch, then vs else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "non-interference across combined schemas", "schema": { "allOf": [ { "if": { "exclusiveMaximum": 0 } }, { "then": { "minimum": -10 } }, { "else": { "multipleOf": 2 } } ] }, "tests": [ { "description": "valid, but would have been invalid through then", "data": -100, "valid": true }, { "description": "valid, but would have been invalid through else", "data": 3, "valid": true } ] }, { "description": "if with boolean schema true", "schema": { "if": true, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema true in if always chooses the then path (valid)", "data": "then", "valid": true }, { "description": "boolean schema true in if always chooses the then path (invalid)", "data": "else", "valid": false } ] }, { "description": "if with boolean schema false", "schema": { "if": false, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema false in if always chooses the else path (invalid)", "data": "then", "valid": false }, { "description": "boolean schema false in if always chooses the else path (valid)", "data": "else", "valid": true } ] }, { "description": "if appears at the end when serialized (keyword processing sequence)", "schema": { "then": { "const": "yes" }, "else": { "const": "other" }, "if": { "maxLength": 4 } }, "tests": [ { "description": "yes redirects to then and passes", "data": "yes", "valid": true }, { "description": "other redirects to else and passes", "data": "other", "valid": true }, { "description": "no redirects to then and fails", "data": "no", "valid": false }, { "description": "invalid redirects to else and fails", "data": "invalid", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/additionalItems.json000640 000766 000024 00000010373 14163671560 026354 0ustar00etherstaff000000 000000 [ { "description": "additionalItems as schema", "schema": { "items": [{}], "additionalItems": {"type": "integer"} }, "tests": [ { "description": "additional items match schema", "data": [ null, 2, 3, 4 ], "valid": true }, { "description": "additional items do not match schema", "data": [ null, 2, 3, "foo" ], "valid": false } ] }, { "description": "when items is schema, additionalItems does nothing", "schema": { "items": {}, "additionalItems": false }, "tests": [ { "description": "all items match schema", "data": [ 1, 2, 3, 4, 5 ], "valid": true } ] }, { "description": "array of items with no additionalItems permitted", "schema": { "items": [{}, {}, {}], "additionalItems": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "additionalItems as false without items", "schema": {"additionalItems": false}, "tests": [ { "description": "items defaults to empty schema so everything is valid", "data": [ 1, 2, 3, 4, 5 ], "valid": true }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true } ] }, { "description": "additionalItems are allowed by default", "schema": {"items": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] }, { "description": "additionalItems should not look in applicators, valid case", "schema": { "allOf": [ { "items": [ { "type": "integer" } ] } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, null ], "valid": true } ] }, { "description": "additionalItems should not look in applicators, invalid case", "schema": { "allOf": [ { "items": [ { "type": "integer" }, { "type": "string" } ] } ], "items": [ {"type": "integer" } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, "hello" ], "valid": false } ] }, { "description": "items validation adjusts the starting index for additionalItems", "schema": { "items": [ { "type": "string" } ], "additionalItems": { "type": "integer" } }, "tests": [ { "description": "valid items", "data": [ "x", 2, 3 ], "valid": true }, { "description": "wrong type of second item", "data": [ "x", "y" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/pattern.json000640 000766 000024 00000003003 14163671560 024707 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/definitions.json000640 000766 000024 00000001317 14163671560 025553 0ustar00etherstaff000000 000000 [ { "description": "validate definition against metaschema", "schema": {"$ref": "http://json-schema.org/draft-07/schema#"}, "tests": [ { "description": "valid definition schema", "data": { "definitions": { "foo": {"type": "integer"} } }, "valid": true }, { "description": "invalid definition schema", "data": { "definitions": { "foo": {"type": 1} } }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/maxProperties.json000640 000766 000024 00000002732 14163671560 026104 0ustar00etherstaff000000 000000 [ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, "tests": [ { "description": "shorter is valid", "data": {"foo": 1}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "too long is invalid", "data": {"foo": 1, "bar": 2, "baz": 3}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "maxProperties = 0 means the object is empty", "schema": { "maxProperties": 0 }, "tests": [ { "description": "no properties is valid", "data": {}, "valid": true }, { "description": "one property is invalid", "data": { "foo": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/required.json000640 000766 000024 00000005206 14163671560 025061 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {}, "bar": {} }, "required": ["foo"] }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required with empty array", "schema": { "properties": { "foo": {} }, "required": [] }, "tests": [ { "description": "property not required", "data": {}, "valid": true } ] }, { "description": "required with escaped characters", "schema": { "required": [ "foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar" ] }, "tests": [ { "description": "object with all properties present is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with some properties missing is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/id.json000640 000766 000024 00000003312 14163671560 023631 0ustar00etherstaff000000 000000 [ { "description": "id inside an enum is not a real identifier", "comment": "the implementation must not be confused by an id buried in the enum", "schema": { "definitions": { "id_in_enum": { "enum": [ { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } ] }, "real_id_in_schema": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "string" }, "zzz_id_in_const": { "const": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } } }, "anyOf": [ { "$ref": "#/definitions/id_in_enum" }, { "$ref": "https://localhost:1234/id/my_identifier.json" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" }, "valid": true }, { "description": "match $ref to id", "data": "a string to match #/definitions/id_in_enum", "valid": true }, { "description": "no match on enum or $ref to id", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/type.json000640 000766 000024 00000032140 14163671560 024217 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float with zero fractional part is an integer", "data": 1.0, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number (and an integer)", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an empty string is still a string", "data": "", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "zero is not a boolean", "data": 0, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an empty string is not a boolean", "data": "", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "true is a boolean", "data": true, "valid": true }, { "description": "false is a boolean", "data": false, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "zero is not null", "data": 0, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an empty string is not null", "data": "", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "true is not null", "data": true, "valid": false }, { "description": "false is not null", "data": false, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type as array with one item", "schema": { "type": ["string"] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is invalid", "data": 123, "valid": false } ] }, { "description": "type: array or object", "schema": { "type": ["array", "object"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type: array, object or null", "schema": { "type": ["array", "object", "null"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/default.json000640 000766 000024 00000004267 14163671560 024673 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/multipleOf.json000640 000766 000024 00000003577 14163671560 025372 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"multipleOf": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"multipleOf": 1.5}, "tests": [ { "description": "zero is multiple of anything", "data": 0, "valid": true }, { "description": "4.5 is multiple of 1.5", "data": 4.5, "valid": true }, { "description": "35 is not multiple of 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"multipleOf": 0.0001}, "tests": [ { "description": "0.0075 is multiple of 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not multiple of 0.0001", "data": 0.00751, "valid": false } ] }, { "description": "invalid instance should not raise error when float division = inf", "schema": {"type": "integer", "multipleOf": 0.123456789}, "tests": [ { "description": "always invalid, but naive implementations may raise an overflow error", "data": 1e308, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/patternProperties.json000640 000766 000024 00000011251 14163671560 026770 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": ["foo"], "valid": true }, { "description": "ignores strings", "data": "foo", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] }, { "description": "patternProperties with boolean schemas", "schema": { "patternProperties": { "f.*": true, "b.*": false } }, "tests": [ { "description": "object with property matching schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property matching schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "object with a property matching both true and false is invalid", "data": {"foobar":1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/refRemote.json000640 000766 000024 00000012504 14163671560 025170 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "base URI change", "schema": { "$id": "http://localhost:1234/", "items": { "$id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "base URI change ref valid", "data": [[1]], "valid": true }, { "description": "base URI change ref invalid", "data": [["a"]], "valid": false } ] }, { "description": "base URI change - change folder", "schema": { "$id": "http://localhost:1234/scope_change_defs1.json", "type" : "object", "properties": { "list": {"$ref": "#/definitions/baz"} }, "definitions": { "baz": { "$id": "baseUriChangeFolder/", "type": "array", "items": {"$ref": "folderInteger.json"} } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "base URI change - change folder in subschema", "schema": { "$id": "http://localhost:1234/scope_change_defs2.json", "type" : "object", "properties": { "list": {"$ref": "#/definitions/baz/definitions/bar"} }, "definitions": { "baz": { "$id": "baseUriChangeFolderInSubschema/", "definitions": { "bar": { "type": "array", "items": {"$ref": "folderInteger.json"} } } } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "root ref in remote ref", "schema": { "$id": "http://localhost:1234/object", "type": "object", "properties": { "name": {"$ref": "name.json#/definitions/orNull"} } }, "tests": [ { "description": "string is valid", "data": { "name": "foo" }, "valid": true }, { "description": "null is valid", "data": { "name": null }, "valid": true }, { "description": "object is invalid", "data": { "name": { "name": null } }, "valid": false } ] }, { "description": "remote ref with ref to definitions", "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "allOf": [ { "$ref": "ref-and-definitions.json" } ] }, "tests": [ { "description": "invalid", "data": { "bar": 1 }, "valid": false }, { "description": "valid", "data": { "bar": "a" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/allOf.json000640 000766 000024 00000017147 14163671560 024305 0ustar00etherstaff000000 000000 [ { "description": "allOf", "schema": { "allOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "allOf", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch second", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch first", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "allOf with base schema", "schema": { "properties": {"bar": {"type": "integer"}}, "required": ["bar"], "allOf" : [ { "properties": { "foo": {"type": "string"} }, "required": ["foo"] }, { "properties": { "baz": {"type": "null"} }, "required": ["baz"] } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch base schema", "data": {"foo": "quux", "baz": null}, "valid": false }, { "description": "mismatch first allOf", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second allOf", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "allOf simple types", "schema": { "allOf": [ {"maximum": 30}, {"minimum": 20} ] }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch one", "data": 35, "valid": false } ] }, { "description": "allOf with boolean schemas, all true", "schema": {"allOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "allOf with boolean schemas, some false", "schema": {"allOf": [true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with boolean schemas, all false", "schema": {"allOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with one empty schema", "schema": { "allOf": [ {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with two empty schemas", "schema": { "allOf": [ {}, {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with the first empty schema", "schema": { "allOf": [ {}, { "type": "number" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with the last empty schema", "schema": { "allOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "nested allOf, to check validation semantics", "schema": { "allOf": [ { "allOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "allOf combined with anyOf, oneOf", "schema": { "allOf": [ { "multipleOf": 2 } ], "anyOf": [ { "multipleOf": 3 } ], "oneOf": [ { "multipleOf": 5 } ] }, "tests": [ { "description": "allOf: false, anyOf: false, oneOf: false", "data": 1, "valid": false }, { "description": "allOf: false, anyOf: false, oneOf: true", "data": 5, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: false", "data": 3, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: true", "data": 15, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: false", "data": 2, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: true", "data": 10, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: false", "data": 6, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: true", "data": 30, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/format.json000640 000766 000024 00000043223 14163671560 024532 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-email format", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "regex format", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv4 format", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-hostname format", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "hostname format", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date format", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "time format", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "json-pointer format", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "relative-json-pointer format", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri format", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri-reference format", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-reference format", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-template format", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/ref.json000640 000766 000024 00000045324 14163671560 024022 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "items": [ {"type": "integer"}, {"$ref": "#/items/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "definitions": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/definitions/tilde~0field"}, "slash": {"$ref": "#/definitions/slash~1field"}, "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "definitions": { "a": {"type": "integer"}, "b": {"$ref": "#/definitions/a"}, "c": {"$ref": "#/definitions/b"} }, "allOf": [{ "$ref": "#/definitions/c" }] }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref overrides any sibling keywords", "schema": { "definitions": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/definitions/reffed", "maxItems": 2 } } }, "tests": [ { "description": "ref valid", "data": { "foo": [] }, "valid": true }, { "description": "ref valid, maxItems ignored", "data": { "foo": [ 1, 2, 3] }, "valid": true }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "$ref prevents a sibling $id from changing the base uri", "schema": { "$id": "http://localhost:1234/sibling_id/base/", "definitions": { "foo": { "$id": "http://localhost:1234/sibling_id/foo.json", "type": "string" }, "base_foo": { "$comment": "this canonical uri is http://localhost:1234/sibling_id/base/foo.json", "$id": "foo.json", "type": "number" } }, "allOf": [ { "$comment": "$ref resolves to http://localhost:1234/sibling_id/base/foo.json, not http://localhost:1234/sibling_id/foo.json", "$id": "http://localhost:1234/sibling_id/", "$ref": "foo.json" } ] }, "tests": [ { "description": "$ref resolves to /definitions/base_foo, data does not validate", "data": "a", "valid": false }, { "description": "$ref resolves to /definitions/base_foo, data validates", "data": 1, "valid": true } ] }, { "description": "remote ref, containing refs itself", "schema": {"$ref": "http://json-schema.org/draft-07/schema#"}, "tests": [ { "description": "remote ref valid", "data": {"minLength": 1}, "valid": true }, { "description": "remote ref invalid", "data": {"minLength": -1}, "valid": false } ] }, { "description": "property named $ref that is not a reference", "schema": { "properties": { "$ref": {"type": "string"} } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/definitions/is-string"} }, "definitions": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "$ref to boolean schema true", "schema": { "allOf": [{ "$ref": "#/definitions/bool" }], "definitions": { "bool": true } }, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "$ref to boolean schema false", "schema": { "allOf": [{ "$ref": "#/definitions/bool" }], "definitions": { "bool": false } }, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "Recursive references between schemas", "schema": { "$id": "http://localhost:1234/tree", "description": "tree of nodes", "type": "object", "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "required": ["meta", "nodes"], "definitions": { "node": { "$id": "http://localhost:1234/node", "description": "node", "type": "object", "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} }, "required": ["value"] } } }, "tests": [ { "description": "valid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": 1.1}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": true }, { "description": "invalid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": "string is invalid"}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": false } ] }, { "description": "refs with quote", "schema": { "properties": { "foo\"bar": {"$ref": "#/definitions/foo%22bar"} }, "definitions": { "foo\"bar": {"type": "number"} } }, "tests": [ { "description": "object with numbers is valid", "data": { "foo\"bar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\"bar": "1" }, "valid": false } ] }, { "description": "Location-independent identifier", "schema": { "allOf": [{ "$ref": "#foo" }], "definitions": { "A": { "$id": "#foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { "$id": "http://localhost:1234/root", "allOf": [{ "$ref": "http://localhost:1234/nested.json#foo" }], "definitions": { "A": { "$id": "nested.json", "definitions": { "B": { "$id": "#foo", "type": "integer" } } } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "definitions": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/definitions/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "do not evaluate the $ref inside the enum, definition exact match", "data": { "type": "string" }, "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/definitions/a_string" }, "valid": true } ] }, { "description": "refs with relative uris and defs", "schema": { "$id": "http://example.com/schema-relative-uri-defs1.json", "properties": { "foo": { "$id": "schema-relative-uri-defs2.json", "definitions": { "inner": { "properties": { "bar": { "type": "string" } } } }, "allOf": [ { "$ref": "#/definitions/inner" } ] } }, "allOf": [ { "$ref": "schema-relative-uri-defs2.json" } ] }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "relative refs with absolute uris and defs", "schema": { "$id": "http://example.com/schema-refs-absolute-uris-defs1.json", "properties": { "foo": { "$id": "http://example.com/schema-refs-absolute-uris-defs2.json", "definitions": { "inner": { "properties": { "bar": { "type": "string" } } } }, "allOf": [ { "$ref": "#/definitions/inner" } ] } }, "allOf": [ { "$ref": "schema-refs-absolute-uris-defs2.json" } ] }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "$id must be resolved against nearest parent, not just immediate parent", "schema": { "$id": "http://example.com/a.json", "definitions": { "x": { "$id": "http://example.com/b/c.json", "not": { "definitions": { "y": { "$id": "d.json", "type": "number" } } } } }, "allOf": [ { "$ref": "http://example.com/b/d.json" } ] }, "tests": [ { "description": "number should pass", "data": 1, "valid": true }, { "description": "non-number should fail", "data": "a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/maximum.json000640 000766 000024 00000002704 14163671560 024716 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/minLength.json000640 000766 000024 00000001566 14163671560 025173 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/maxItems.json000640 000766 000024 00000001302 14163671560 025021 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/contains.json000640 000766 000024 00000010272 14163671560 025056 0ustar00etherstaff000000 000000 [ { "description": "contains keyword validation", "schema": { "contains": {"minimum": 5} }, "tests": [ { "description": "array with item matching schema (5) is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with item matching schema (6) is valid", "data": [3, 4, 6], "valid": true }, { "description": "array with two items matching schema (5, 6) is valid", "data": [3, 4, 5, 6], "valid": true }, { "description": "array without items matching schema is invalid", "data": [2, 3, 4], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "not array is valid", "data": {}, "valid": true } ] }, { "description": "contains keyword with const keyword", "schema": { "contains": { "const": 5 } }, "tests": [ { "description": "array with item 5 is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with two items 5 is valid", "data": [3, 4, 5, 5], "valid": true }, { "description": "array without item 5 is invalid", "data": [1, 2, 3, 4], "valid": false } ] }, { "description": "contains keyword with boolean schema true", "schema": {"contains": true}, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] }, { "description": "contains keyword with boolean schema false", "schema": {"contains": false}, "tests": [ { "description": "any non-empty array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "non-arrays are valid", "data": "contains does not apply to strings", "valid": true } ] }, { "description": "items + contains", "schema": { "items": { "multipleOf": 2 }, "contains": { "multipleOf": 3 } }, "tests": [ { "description": "matches items, does not match contains", "data": [ 2, 4, 8 ], "valid": false }, { "description": "does not match items, matches contains", "data": [ 3, 6, 9 ], "valid": false }, { "description": "matches both items and contains", "data": [ 6, 12 ], "valid": true }, { "description": "matches neither items nor contains", "data": [ 1, 5 ], "valid": false } ] }, { "description": "contains with false if subschema", "schema": { "contains": { "if": false, "else": true } }, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/content.json000640 000766 000024 00000004274 14163671560 026544 0ustar00etherstaff000000 000000 [ { "description": "validation of string-encoded content based on media type", "schema": { "contentMediaType": "application/json" }, "tests": [ { "description": "a valid JSON document", "data": "{\"foo\": \"bar\"}", "valid": true }, { "description": "an invalid JSON document", "data": "{:}", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary string-encoding", "schema": { "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64 string", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "an invalid base64 string (% is not a valid character)", "data": "eyJmb28iOi%iYmFyIn0K", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "a validly-encoded invalid JSON document", "data": "ezp9Cg==", "valid": false }, { "description": "an invalid base64 string that is valid JSON", "data": "{}", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/bignum.json000640 000766 000024 00000005361 14163671560 026351 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": { "type": "integer" }, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true }, { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": { "type": "number" }, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true }, { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": { "type": "string" }, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": { "maximum": 18446744073709551615 }, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "exclusiveMaximum": 972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": { "minimum": -18446744073709551615 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "exclusiveMinimum": -972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/unicode.json000644 000766 000024 00000000002 14163671560 026505 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 027551 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/000770 000766 000024 00000000000 14163671560 025461 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/float-overflow.json000640 000766 000024 00000000551 14163671560 030032 0ustar00etherstaff000000 000000 [ { "description": "all integers are multiples of 0.5, if overflow is handled", "schema": {"type": "integer", "multipleOf": 0.5}, "tests": [ { "description": "valid if optional overflow handling is implemented", "data": 1e308, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/ecmascript-regex.json000640 000766 000024 00000044205 14163671560 030332 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { "type": "string", "pattern": "^abc$" }, "tests": [ { "description": "matches in Python, but should not in jsonschema", "data": "abc\\n", "valid": false }, { "description": "should match", "data": "abc", "valid": true } ] }, { "description": "ECMA 262 regex converts \\t to horizontal tab", "schema": { "type": "string", "pattern": "^\\t$" }, "tests": [ { "description": "does not match", "data": "\\t", "valid": false }, { "description": "matches", "data": "\u0009", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and upper letter", "schema": { "type": "string", "pattern": "^\\cC$" }, "tests": [ { "description": "does not match", "data": "\\cC", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and lower letter", "schema": { "type": "string", "pattern": "^\\cc$" }, "tests": [ { "description": "does not match", "data": "\\cc", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 \\d matches ascii digits only", "schema": { "type": "string", "pattern": "^\\d$" }, "tests": [ { "description": "ASCII zero matches", "data": "0", "valid": true }, { "description": "NKO DIGIT ZERO does not match (unlike e.g. Python)", "data": "߀", "valid": false }, { "description": "NKO DIGIT ZERO (as \\u escape) does not match", "data": "\u07c0", "valid": false } ] }, { "description": "ECMA 262 \\D matches everything but ascii digits", "schema": { "type": "string", "pattern": "^\\D$" }, "tests": [ { "description": "ASCII zero does not match", "data": "0", "valid": false }, { "description": "NKO DIGIT ZERO matches (unlike e.g. Python)", "data": "߀", "valid": true }, { "description": "NKO DIGIT ZERO (as \\u escape) matches", "data": "\u07c0", "valid": true } ] }, { "description": "ECMA 262 \\w matches ascii letters only", "schema": { "type": "string", "pattern": "^\\w$" }, "tests": [ { "description": "ASCII 'a' matches", "data": "a", "valid": true }, { "description": "latin-1 e-acute does not match (unlike e.g. Python)", "data": "é", "valid": false } ] }, { "description": "ECMA 262 \\W matches everything but ascii letters", "schema": { "type": "string", "pattern": "^\\W$" }, "tests": [ { "description": "ASCII 'a' does not match", "data": "a", "valid": false }, { "description": "latin-1 e-acute matches (unlike e.g. Python)", "data": "é", "valid": true } ] }, { "description": "ECMA 262 \\s matches whitespace", "schema": { "type": "string", "pattern": "^\\s$" }, "tests": [ { "description": "ASCII space matches", "data": " ", "valid": true }, { "description": "Character tabulation matches", "data": "\t", "valid": true }, { "description": "Line tabulation matches", "data": "\u000b", "valid": true }, { "description": "Form feed matches", "data": "\u000c", "valid": true }, { "description": "latin-1 non-breaking-space matches", "data": "\u00a0", "valid": true }, { "description": "zero-width whitespace matches", "data": "\ufeff", "valid": true }, { "description": "line feed matches (line terminator)", "data": "\u000a", "valid": true }, { "description": "paragraph separator matches (line terminator)", "data": "\u2029", "valid": true }, { "description": "EM SPACE matches (Space_Separator)", "data": "\u2003", "valid": true }, { "description": "Non-whitespace control does not match", "data": "\u0001", "valid": false }, { "description": "Non-whitespace does not match", "data": "\u2013", "valid": false } ] }, { "description": "ECMA 262 \\S matches everything but whitespace", "schema": { "type": "string", "pattern": "^\\S$" }, "tests": [ { "description": "ASCII space does not match", "data": " ", "valid": false }, { "description": "Character tabulation does not match", "data": "\t", "valid": false }, { "description": "Line tabulation does not match", "data": "\u000b", "valid": false }, { "description": "Form feed does not match", "data": "\u000c", "valid": false }, { "description": "latin-1 non-breaking-space does not match", "data": "\u00a0", "valid": false }, { "description": "zero-width whitespace does not match", "data": "\ufeff", "valid": false }, { "description": "line feed does not match (line terminator)", "data": "\u000a", "valid": false }, { "description": "paragraph separator does not match (line terminator)", "data": "\u2029", "valid": false }, { "description": "EM SPACE does not match (Space_Separator)", "data": "\u2003", "valid": false }, { "description": "Non-whitespace control matches", "data": "\u0001", "valid": true }, { "description": "Non-whitespace matches", "data": "\u2013", "valid": true } ] }, { "description": "unicode semantics should be used for all pattern matching", "schema": { "pattern": "\\p{Letter}cole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters", "schema": { "pattern": "\\wcole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "pattern": "[a-z]cole" }, "tests": [ { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "ascii characters match", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true } ] }, { "description": "\\d in pattern matches [0-9], not unicode digits", "schema": { "pattern": "^\\d+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "pattern": "^\\p{digit}+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": true } ] }, { "description": "unicode semantics should be used for all patternProperties matching", "schema": { "type": "object", "patternProperties": { "\\p{Letter}cole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": true }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": true }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters", "schema": { "type": "object", "patternProperties": { "\\wcole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "type": "object", "patternProperties": { "[a-z]cole": true }, "additionalProperties": false }, "tests": [ { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "ascii characters match", "data": { "l'ecole": "pas de vraie vie" }, "valid": true } ] }, { "description": "\\d in patternProperties matches [0-9], not unicode digits", "schema": { "type": "object", "patternProperties": { "^\\d+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "type": "object", "patternProperties": { "^\\p{digit}+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/date.json000640 000766 000024 00000016426 14163671560 027301 0ustar00etherstaff000000 000000 [ { "description": "validation of date strings", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date string", "data": "1963-06-19", "valid": true }, { "description": "a valid date string with 31 days in January", "data": "2020-01-31", "valid": true }, { "description": "a invalid date string with 32 days in January", "data": "2020-01-32", "valid": false }, { "description": "a valid date string with 28 days in February (normal)", "data": "2021-02-28", "valid": true }, { "description": "a invalid date string with 29 days in February (normal)", "data": "2021-02-29", "valid": false }, { "description": "a valid date string with 29 days in February (leap)", "data": "2020-02-29", "valid": true }, { "description": "a invalid date string with 30 days in February (leap)", "data": "2020-02-30", "valid": false }, { "description": "a valid date string with 31 days in March", "data": "2020-03-31", "valid": true }, { "description": "a invalid date string with 32 days in March", "data": "2020-03-32", "valid": false }, { "description": "a valid date string with 30 days in April", "data": "2020-04-30", "valid": true }, { "description": "a invalid date string with 31 days in April", "data": "2020-04-31", "valid": false }, { "description": "a valid date string with 31 days in May", "data": "2020-05-31", "valid": true }, { "description": "a invalid date string with 32 days in May", "data": "2020-05-32", "valid": false }, { "description": "a valid date string with 30 days in June", "data": "2020-06-30", "valid": true }, { "description": "a invalid date string with 31 days in June", "data": "2020-06-31", "valid": false }, { "description": "a valid date string with 31 days in July", "data": "2020-07-31", "valid": true }, { "description": "a invalid date string with 32 days in July", "data": "2020-07-32", "valid": false }, { "description": "a valid date string with 31 days in August", "data": "2020-08-31", "valid": true }, { "description": "a invalid date string with 32 days in August", "data": "2020-08-32", "valid": false }, { "description": "a valid date string with 30 days in September", "data": "2020-09-30", "valid": true }, { "description": "a invalid date string with 31 days in September", "data": "2020-09-31", "valid": false }, { "description": "a valid date string with 31 days in October", "data": "2020-10-31", "valid": true }, { "description": "a invalid date string with 32 days in October", "data": "2020-10-32", "valid": false }, { "description": "a valid date string with 30 days in November", "data": "2020-11-30", "valid": true }, { "description": "a invalid date string with 31 days in November", "data": "2020-11-31", "valid": false }, { "description": "a valid date string with 31 days in December", "data": "2020-12-31", "valid": true }, { "description": "a invalid date string with 32 days in December", "data": "2020-12-32", "valid": false }, { "description": "a invalid date string with invalid month", "data": "2020-13-01", "valid": false }, { "description": "an invalid date string", "data": "06/19/1963", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false }, { "description": "non-padded month dates are not valid", "data": "1998-1-20", "valid": false }, { "description": "non-padded day dates are not valid", "data": "1998-01-1", "valid": false }, { "description": "invalid month", "data": "1998-13-01", "valid": false }, { "description": "invalid month-day combination", "data": "1998-04-31", "valid": false }, { "description": "2021 is not a leap year", "data": "2021-02-29", "valid": false }, { "description": "2020 is a leap year", "data": "2020-02-29", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1963-06-1৪", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/json-pointer.json000640 000766 000024 00000015063 14163671560 031007 0ustar00etherstaff000000 000000 [ { "description": "validation of JSON-pointers (JSON String Representation)", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid JSON-pointer", "data": "/foo/bar~0/baz~1/%a", "valid": true }, { "description": "not a valid JSON-pointer (~ not escaped)", "data": "/foo/bar~", "valid": false }, { "description": "valid JSON-pointer with empty segment", "data": "/foo//bar", "valid": true }, { "description": "valid JSON-pointer with the last empty segment", "data": "/foo/bar/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #1", "data": "", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #2", "data": "/foo", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #3", "data": "/foo/0", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #4", "data": "/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #5", "data": "/a~1b", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #6", "data": "/c%d", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #7", "data": "/e^f", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #8", "data": "/g|h", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #9", "data": "/i\\j", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #10", "data": "/k\"l", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #11", "data": "/ ", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #12", "data": "/m~0n", "valid": true }, { "description": "valid JSON-pointer used adding to the last array position", "data": "/foo/-", "valid": true }, { "description": "valid JSON-pointer (- used as object member name)", "data": "/foo/-/bar", "valid": true }, { "description": "valid JSON-pointer (multiple escaped characters)", "data": "/~1~0~0~1~1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #1", "data": "/~1.1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #2", "data": "/~0.1", "valid": true }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #1", "data": "#", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #2", "data": "#/", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #3", "data": "#a", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #1", "data": "/~0~", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #2", "data": "/~0/~", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #1", "data": "/~2", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #2", "data": "/~-1", "valid": false }, { "description": "not a valid JSON-pointer (multiple characters not escaped)", "data": "/~~", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1", "data": "a", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2", "data": "0", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3", "data": "a/a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/idn-hostname.json000640 000766 000024 00000034641 14163671560 030751 0ustar00etherstaff000000 000000 [ { "description": "validation of internationalized host names", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name (example.test in Hangul)", "data": "실례.테스트", "valid": true }, { "description": "illegal first char U+302E Hangul single dot tone mark", "data": "〮실례.테스트", "valid": false }, { "description": "contains illegal char U+302E Hangul single dot tone mark", "data": "실〮례.테스트", "valid": false }, { "description": "a host name with a component too long", "data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트", "valid": false }, { "description": "invalid label, correct Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1", "data": "-> $1.00 <--", "valid": false }, { "description": "valid Chinese Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4", "data": "xn--ihqwcrb4cv8a8dqg056pqjye", "valid": true }, { "description": "invalid Punycode", "comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "xn--X", "valid": false }, { "description": "U-label contains \"--\" in the 3rd and 4th position", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "XN--aa---o47jg78q", "valid": false }, { "description": "U-label starts with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello", "valid": false }, { "description": "U-label ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "hello-", "valid": false }, { "description": "U-label starts and ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello-", "valid": false }, { "description": "Begins with a Spacing Combining Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0903hello", "valid": false }, { "description": "Begins with a Nonspacing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0300hello", "valid": false }, { "description": "Begins with an Enclosing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0488hello", "valid": false }, { "description": "Exceptions that are PVALID, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u00df\u03c2\u0f0b\u3007", "valid": true }, { "description": "Exceptions that are PVALID, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u06fd\u06fe", "valid": true }, { "description": "Exceptions that are DISALLOWED, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u0640\u07fa", "valid": false }, { "description": "Exceptions that are DISALLOWED, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start", "data": "\u3031\u3032\u3033\u3034\u3035\u302e\u302f\u303b", "valid": false }, { "description": "MIDDLE DOT with no preceding 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "a\u00b7l", "valid": false }, { "description": "MIDDLE DOT with nothing preceding", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "\u00b7l", "valid": false }, { "description": "MIDDLE DOT with no following 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7a", "valid": false }, { "description": "MIDDLE DOT with nothing following", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7", "valid": false }, { "description": "MIDDLE DOT with surrounding 'l's", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7l", "valid": true }, { "description": "Greek KERAIA not followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375S", "valid": false }, { "description": "Greek KERAIA not followed by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375", "valid": false }, { "description": "Greek KERAIA followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375\u03b2", "valid": true }, { "description": "Hebrew GERESH not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "A\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05d0\u05f3\u05d1", "valid": true }, { "description": "Hebrew GERSHAYIM not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "A\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05d0\u05f4\u05d1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "def\u30fbabc", "valid": false }, { "description": "KATAKANA MIDDLE DOT with no other characters", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb", "valid": false }, { "description": "KATAKANA MIDDLE DOT with Hiragana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u3041", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Katakana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u30a1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u4e08", "valid": true }, { "description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0660\u06f0", "valid": false }, { "description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0628\u0660\u0628", "valid": true }, { "description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9", "data": "\u06f00", "valid": true }, { "description": "ZERO WIDTH JOINER not preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u094d\u200d\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1", "data": "\u0915\u094d\u200c\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement", "data": "\u0628\u064a\u200c\u0628\u064a", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/uri.json000640 000766 000024 00000007165 14163671560 027163 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid URL with anchor tag and parentheses", "data": "http://foo.com/blah_(wikipedia)_blah#cite-1", "valid": true }, { "description": "a valid URL with URL-encoded stuff", "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid puny-coded URL ", "data": "http://xn--nw2a.xn--j6w193g/", "valid": true }, { "description": "a valid URL with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid URL based on IPv4", "data": "http://223.255.255.254", "valid": true }, { "description": "a valid URL with ftp scheme", "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt", "valid": true }, { "description": "a valid URL for a simple text file", "data": "http://www.ietf.org/rfc/rfc2396.txt", "valid": true }, { "description": "a valid URL ", "data": "ldap://[2001:db8::7]/c=GB?objectClass?one", "valid": true }, { "description": "a valid mailto URI", "data": "mailto:John.Doe@example.com", "valid": true }, { "description": "a valid newsgroup URI", "data": "news:comp.infosystems.www.servers.unix", "valid": true }, { "description": "a valid tel URI", "data": "tel:+1-816-555-1212", "valid": true }, { "description": "a valid URN", "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid relative URI Reference", "data": "/abc", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false }, { "description": "an invalid URI with spaces", "data": "http:// shouldfail.com", "valid": false }, { "description": "an invalid URI with spaces and missing scheme", "data": ":// should fail", "valid": false }, { "description": "an invalid URI with comma in scheme", "data": "bar,baz:foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/uri-template.json000640 000766 000024 00000003431 14163671560 030764 0ustar00etherstaff000000 000000 [ { "description": "format: uri-template", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid uri-template", "data": "http://example.com/dictionary/{term:1}/{term}", "valid": true }, { "description": "an invalid uri-template", "data": "http://example.com/dictionary/{term:1}/{term", "valid": false }, { "description": "a valid uri-template without variables", "data": "http://example.com/dictionary", "valid": true }, { "description": "a valid relative uri-template", "data": "dictionary/{term:1}/{term}", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/iri-reference.json000640 000766 000024 00000004312 14163671560 031072 0ustar00etherstaff000000 000000 [ { "description": "validation of IRI References", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid protocol-relative IRI Reference", "data": "//ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid relative IRI Reference", "data": "/âππ", "valid": true }, { "description": "an invalid IRI Reference", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "a valid IRI Reference", "data": "âππ", "valid": true }, { "description": "a valid IRI fragment", "data": "#ƒrägmênt", "valid": true }, { "description": "an invalid IRI fragment", "data": "#ƒräg\\mênt", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/iri.json000640 000766 000024 00000005324 14163671560 027142 0ustar00etherstaff000000 000000 [ { "description": "validation of IRIs", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI with anchor tag", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid IRI with anchor tag and parentheses", "data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1", "valid": true }, { "description": "a valid IRI with URL-encoded stuff", "data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid IRI with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid IRI based on IPv6", "data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]", "valid": true }, { "description": "an invalid IRI based on IPv6", "data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334", "valid": false }, { "description": "an invalid relative IRI Reference", "data": "/abc", "valid": false }, { "description": "an invalid IRI", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "an invalid IRI though valid IRI reference", "data": "âππ", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/ipv4.json000640 000766 000024 00000005415 14163671560 027242 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false }, { "description": "an IP address without 4 components", "data": "127.0", "valid": false }, { "description": "an IP address as an integer", "data": "0x7f000001", "valid": false }, { "description": "an IP address as an integer (decimal)", "data": "2130706433", "valid": false }, { "description": "leading zeroes should be rejected, as they are treated as octals", "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", "data": "087.10.0.1", "valid": false }, { "description": "value without leading zero is valid", "data": "87.10.0.1", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1২7.0.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/uri-reference.json000640 000766 000024 00000004237 14163671560 031114 0ustar00etherstaff000000 000000 [ { "description": "validation of URI References", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid relative URI Reference", "data": "/abc", "valid": true }, { "description": "an invalid URI Reference", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "a valid URI Reference", "data": "abc", "valid": true }, { "description": "a valid URI fragment", "data": "#fragment", "valid": true }, { "description": "an invalid URI fragment", "data": "#frag\\ment", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/time.json000640 000766 000024 00000015211 14163671560 027311 0ustar00etherstaff000000 000000 [ { "description": "validation of time strings", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid time string", "data": "08:30:06Z", "valid": true }, { "description": "a valid time string with leap second, Zulu", "data": "23:59:60Z", "valid": true }, { "description": "invalid leap second, Zulu (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "invalid leap second, Zulu (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "valid leap second, zero time-offset", "data": "23:59:60+00:00", "valid": true }, { "description": "invalid leap second, zero time-offset (wrong hour)", "data": "22:59:60+00:00", "valid": false }, { "description": "invalid leap second, zero time-offset (wrong minute)", "data": "23:58:60+00:00", "valid": false }, { "description": "valid leap second, positive time-offset", "data": "01:29:60+01:30", "valid": true }, { "description": "valid leap second, large positive time-offset", "data": "23:29:60+23:30", "valid": true }, { "description": "invalid leap second, positive time-offset (wrong hour)", "data": "23:59:60+01:00", "valid": false }, { "description": "invalid leap second, positive time-offset (wrong minute)", "data": "23:59:60+00:30", "valid": false }, { "description": "valid leap second, negative time-offset", "data": "15:59:60-08:00", "valid": true }, { "description": "valid leap second, large negative time-offset", "data": "00:29:60-23:30", "valid": true }, { "description": "invalid leap second, negative time-offset (wrong hour)", "data": "23:59:60-01:00", "valid": false }, { "description": "invalid leap second, negative time-offset (wrong minute)", "data": "23:59:60-00:30", "valid": false }, { "description": "a valid time string with second fraction", "data": "23:20:50.52Z", "valid": true }, { "description": "a valid time string with precise second fraction", "data": "08:30:06.283185Z", "valid": true }, { "description": "a valid time string with plus offset", "data": "08:30:06+00:20", "valid": true }, { "description": "a valid time string with minus offset", "data": "08:30:06-08:00", "valid": true }, { "description": "a valid time string with case-insensitive Z", "data": "08:30:06z", "valid": true }, { "description": "an invalid time string with invalid hour", "data": "24:00:00Z", "valid": false }, { "description": "an invalid time string with invalid minute", "data": "00:60:00Z", "valid": false }, { "description": "an invalid time string with invalid second", "data": "00:00:61Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "an invalid time string with invalid time numoffset hour", "data": "01:02:03+24:00", "valid": false }, { "description": "an invalid time string with invalid time numoffset minute", "data": "01:02:03+00:60", "valid": false }, { "description": "an invalid time string with invalid time with both Z and numoffset", "data": "01:02:03Z+00:30", "valid": false }, { "description": "an invalid offset indicator", "data": "08:30:06 PST", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "01:01:01,1111", "valid": false }, { "description": "no time offset", "data": "12:00:00", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1২:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/ipv6.json000640 000766 000024 00000015440 14163671560 027243 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "trailing 4 hex symbols is valid", "data": "::abef", "valid": true }, { "description": "trailing 5 hex symbols is invalid", "data": "::abcef", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::42:ff:1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "missing leading octet is invalid", "data": ":2:3:4:5:6:7:8", "valid": false }, { "description": "missing trailing octet is invalid", "data": "1:2:3:4:5:6:7:", "valid": false }, { "description": "missing leading octet with omitted octets later", "data": ":2:3:4::8", "valid": false }, { "description": "single set of double colons in the middle is valid", "data": "1:d6::42", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false }, { "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", "data": "::ffff:192.168.0.1", "valid": true }, { "description": "triple colons is invalid", "data": "1:2:3:4:5:::8", "valid": false }, { "description": "8 octets", "data": "1:2:3:4:5:6:7:8", "valid": true }, { "description": "insufficient octets without double colons", "data": "1:2:3:4:5:6:7", "valid": false }, { "description": "no colons is invalid", "data": "1", "valid": false }, { "description": "ipv4 is not ipv6", "data": "127.0.0.1", "valid": false }, { "description": "ipv4 segment must have 4 octets", "data": "1:2:3:4:1.2.3", "valid": false }, { "description": "leading whitespace is invalid", "data": " ::1", "valid": false }, { "description": "trailing whitespace is invalid", "data": "::1 ", "valid": false }, { "description": "netmask is not a part of ipv6 address", "data": "fe80::/64", "valid": false }, { "description": "zone id is not a part of ipv6 address", "data": "fe80::a%eth1", "valid": false }, { "description": "a long valid ipv6", "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", "valid": true }, { "description": "a long invalid ipv6, below length limit, first", "data": "100:100:100:100:100:100:255.255.255.255.255", "valid": false }, { "description": "a long invalid ipv6, below length limit, second", "data": "100:100:100:100:100:100:100:255.255.255.255", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1:2:3:4:5:6:7:৪", "valid": false }, { "description": "non-ascii digits should be rejected in the ipv4 portion also", "data": "1:2::192.16৪.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/hostname.json000640 000766 000024 00000006224 14163671560 030175 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a valid punycoded IDN hostname", "data": "xn--4gbwdl.xn--wgbh1c", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/email.json000640 000766 000024 00000005104 14163671560 027442 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/ecmascript-regex.json000644 000766 000024 00000000002 14163671560 031611 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/relative-json-pointer.json000640 000766 000024 00000005040 14163671560 032612 0ustar00etherstaff000000 000000 [ { "description": "validation of Relative JSON Pointers (RJP)", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid upwards RJP", "data": "1", "valid": true }, { "description": "a valid downwards RJP", "data": "0/foo/bar", "valid": true }, { "description": "a valid up and then down RJP, with array index", "data": "2/0/baz/1/zip", "valid": true }, { "description": "a valid RJP taking the member or index name", "data": "0#", "valid": true }, { "description": "an invalid RJP that is a valid JSON Pointer", "data": "/foo/bar", "valid": false }, { "description": "negative prefix", "data": "-1/foo/bar", "valid": false }, { "description": "## is not a valid json-pointer", "data": "0##", "valid": false }, { "description": "zero cannot be followed by other digits, plus json-pointer", "data": "01/a", "valid": false }, { "description": "zero cannot be followed by other digits, plus octothorpe", "data": "01#", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/date-time.json000640 000766 000024 00000011064 14163671560 030226 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "a valid date-time string without second fraction", "data": "1963-06-19T08:30:06Z", "valid": true }, { "description": "a valid date-time string with plus offset", "data": "1937-01-01T12:00:27.87+00:20", "valid": true }, { "description": "a valid date-time string with minus offset", "data": "1990-12-31T15:59:50.123-08:00", "valid": true }, { "description": "a valid date-time with a leap second, UTC", "data": "1998-12-31T23:59:60Z", "valid": true }, { "description": "a valid date-time with a leap second, with minus offset", "data": "1998-12-31T15:59:60.123-08:00", "valid": true }, { "description": "an invalid date-time past leap second, UTC", "data": "1998-12-31T23:59:61Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong minute, UTC", "data": "1998-12-31T23:58:60Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong hour, UTC", "data": "1998-12-31T22:59:60Z", "valid": false }, { "description": "an invalid day in date-time string", "data": "1990-02-31T15:59:59.123-08:00", "valid": false }, { "description": "an invalid offset in date-time string", "data": "1990-12-31T15:59:59-24:00", "valid": false }, { "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false }, { "description": "non-ascii digits should be rejected in the date portion", "data": "1963-06-1৪T00:00:00Z", "valid": false }, { "description": "non-ascii digits should be rejected in the time portion", "data": "1963-06-11T0৪:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/regex.json000640 000766 000024 00000002616 14163671560 027472 0ustar00etherstaff000000 000000 [ { "description": "validation of regular expressions", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid regular expression", "data": "([abc])+\\s+$", "valid": true }, { "description": "a regular expression with unclosed parens is invalid", "data": "^(abc]", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft7/optional/format/idn-email.json000640 000766 000024 00000003354 14163671560 030217 0ustar00etherstaff000000 000000 [ { "description": "validation of an internationalized e-mail addresses", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid idn e-mail (example@example.test in Hangul)", "data": "실례@실례.테스트", "valid": true }, { "description": "an invalid idn e-mail address", "data": "2962", "valid": false }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/anchor.json000640 000766 000024 00000011617 14163671560 025153 0ustar00etherstaff000000 000000 [ { "description": "Location-independent identifier", "schema": { "$ref": "#foo", "$defs": { "A": { "$anchor": "foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with absolute URI", "schema": { "$ref": "http://localhost:1234/bar#foo", "$defs": { "A": { "$id": "http://localhost:1234/bar", "$anchor": "foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#foo", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$anchor": "foo", "type": "integer" } } } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "$anchor inside an enum is not a real identifier", "comment": "the implementation must not be confused by an $anchor buried in the enum", "schema": { "$defs": { "anchor_in_enum": { "enum": [ { "$anchor": "my_anchor", "type": "null" } ] }, "real_identifier_in_schema": { "$anchor": "my_anchor", "type": "string" }, "zzz_anchor_in_const": { "const": { "$anchor": "my_anchor", "type": "null" } } }, "anyOf": [ { "$ref": "#/$defs/anchor_in_enum" }, { "$ref": "#my_anchor" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$anchor": "my_anchor", "type": "null" }, "valid": true }, { "description": "in implementations that strip $anchor, this may match either $def", "data": { "type": "null" }, "valid": false }, { "description": "match $ref to $anchor", "data": "a string to match #/$defs/anchor_in_enum", "valid": true }, { "description": "no match on enum or $ref to $anchor", "data": 1, "valid": false } ] }, { "description": "same $anchor with different base uri", "schema": { "$id": "http://localhost:1234/foobar", "$defs": { "A": { "$id": "child1", "allOf": [ { "$id": "child2", "$anchor": "my_anchor", "type": "number" }, { "$anchor": "my_anchor", "type": "string" } ] } }, "$ref": "child1#my_anchor" }, "tests": [ { "description": "$ref should resolve to /$defs/A/allOf/1", "data": "a", "valid": true }, { "description": "$ref should not resolve to /$defs/A/allOf/0", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/content.json000640 000766 000024 00000007777 14163671560 025367 0ustar00etherstaff000000 000000 [ { "description": "validation of string-encoded content based on media type", "schema": { "contentMediaType": "application/json" }, "tests": [ { "description": "a valid JSON document", "data": "{\"foo\": \"bar\"}", "valid": true }, { "description": "an invalid JSON document; validates true", "data": "{:}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary string-encoding", "schema": { "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64 string", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "an invalid base64 string (% is not a valid character); validates true", "data": "eyJmb28iOi%iYmFyIn0K", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64" }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "a validly-encoded invalid JSON document; validates true", "data": "ezp9Cg==", "valid": true }, { "description": "an invalid base64 string that is valid JSON; validates true", "data": "{}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] }, { "description": "validation of binary-encoded media type documents with schema", "schema": { "contentMediaType": "application/json", "contentEncoding": "base64", "contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "a valid base64-encoded JSON document", "data": "eyJmb28iOiAiYmFyIn0K", "valid": true }, { "description": "another valid base64-encoded JSON document", "data": "eyJib28iOiAyMCwgImZvbyI6ICJiYXoifQ==", "valid": true }, { "description": "an invalid base64-encoded JSON document; validates true", "data": "eyJib28iOiAyMH0=", "valid": true }, { "description": "an empty object as a base64-encoded JSON document; validates true", "data": "e30=", "valid": true }, { "description": "an empty array as a base64-encoded JSON document", "data": "W10=", "valid": true }, { "description": "a validly-encoded invalid JSON document; validates true", "data": "ezp9Cg==", "valid": true }, { "description": "an invalid base64 string that is valid JSON; validates true", "data": "{}", "valid": true }, { "description": "ignores non-strings", "data": 100, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/uniqueItems.json000640 000766 000024 00000032744 14163671560 026215 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1, "{}"], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "different objects are unique", "data": [{"a": 1, "b": 2}, {"a": 2, "b": 1}], "valid": true }, { "description": "objects are non-unique despite key order", "data": [{"a": 1, "b": 2}, {"b": 2, "a": 1}], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "items": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "prefixItems": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "items": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/minItems.json000640 000766 000024 00000001265 14163671560 025464 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/additionalProperties.json000640 000766 000024 00000007754 14163671560 030075 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "allOf": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in allOf are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/exclusiveMinimum.json000640 000766 000024 00000001407 14163671560 027240 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMinimum validation", "schema": { "exclusiveMinimum": 1.1 }, "tests": [ { "description": "above the exclusiveMinimum is valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false }, { "description": "below the exclusiveMinimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/const.json000640 000766 000024 00000022564 14163671560 025032 0ustar00etherstaff000000 000000 [ { "description": "const validation", "schema": {"const": 2}, "tests": [ { "description": "same value is valid", "data": 2, "valid": true }, { "description": "another value is invalid", "data": 5, "valid": false }, { "description": "another type is invalid", "data": "a", "valid": false } ] }, { "description": "const with object", "schema": {"const": {"foo": "bar", "baz": "bax"}}, "tests": [ { "description": "same object is valid", "data": {"foo": "bar", "baz": "bax"}, "valid": true }, { "description": "same object with different property order is valid", "data": {"baz": "bax", "foo": "bar"}, "valid": true }, { "description": "another object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "another type is invalid", "data": [1, 2], "valid": false } ] }, { "description": "const with array", "schema": {"const": [{ "foo": "bar" }]}, "tests": [ { "description": "same array is valid", "data": [{"foo": "bar"}], "valid": true }, { "description": "another array item is invalid", "data": [2], "valid": false }, { "description": "array with additional items is invalid", "data": [1, 2, 3], "valid": false } ] }, { "description": "const with null", "schema": {"const": null}, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "not null is invalid", "data": 0, "valid": false } ] }, { "description": "const with false does not match 0", "schema": {"const": false}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "const with true does not match 1", "schema": {"const": true}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "const with [false] does not match [0]", "schema": {"const": [false]}, "tests": [ { "description": "[false] is valid", "data": [false], "valid": true }, { "description": "[0] is invalid", "data": [0], "valid": false }, { "description": "[0.0] is invalid", "data": [0.0], "valid": false } ] }, { "description": "const with [true] does not match [1]", "schema": {"const": [true]}, "tests": [ { "description": "[true] is valid", "data": [true], "valid": true }, { "description": "[1] is invalid", "data": [1], "valid": false }, { "description": "[1.0] is invalid", "data": [1.0], "valid": false } ] }, { "description": "const with {\"a\": false} does not match {\"a\": 0}", "schema": {"const": {"a": false}}, "tests": [ { "description": "{\"a\": false} is valid", "data": {"a": false}, "valid": true }, { "description": "{\"a\": 0} is invalid", "data": {"a": 0}, "valid": false }, { "description": "{\"a\": 0.0} is invalid", "data": {"a": 0.0}, "valid": false } ] }, { "description": "const with {\"a\": true} does not match {\"a\": 1}", "schema": {"const": {"a": true}}, "tests": [ { "description": "{\"a\": true} is valid", "data": {"a": true}, "valid": true }, { "description": "{\"a\": 1} is invalid", "data": {"a": 1}, "valid": false }, { "description": "{\"a\": 1.0} is invalid", "data": {"a": 1.0}, "valid": false } ] }, { "description": "const with 0 does not match other zero-like types", "schema": {"const": 0}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "empty string is invalid", "data": "", "valid": false } ] }, { "description": "const with 1 does not match true", "schema": {"const": 1}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "const with -2.0 matches integer and float types", "schema": {"const": -2.0}, "tests": [ { "description": "integer -2 is valid", "data": -2, "valid": true }, { "description": "integer 2 is invalid", "data": 2, "valid": false }, { "description": "float -2.0 is valid", "data": -2.0, "valid": true }, { "description": "float 2.0 is invalid", "data": 2.0, "valid": false }, { "description": "float -2.00001 is invalid", "data": -2.00001, "valid": false } ] }, { "description": "float and integers are equal up to 64-bit representation limits", "schema": {"const": 9007199254740992}, "tests": [ { "description": "integer is valid", "data": 9007199254740992, "valid": true }, { "description": "integer minus one is invalid", "data": 9007199254740991, "valid": false }, { "description": "float is valid", "data": 9007199254740992.0, "valid": true }, { "description": "float minus one is invalid", "data": 9007199254740991.0, "valid": false } ] }, { "description": "nul characters in strings", "schema": { "const": "hello\u0000there" }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/defs.json000640 000766 000024 00000001066 14163671560 024617 0ustar00etherstaff000000 000000 [ { "description": "validate definition against metaschema", "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" }, "tests": [ { "description": "valid definition schema", "data": {"$defs": {"foo": {"type": "integer"}}}, "valid": true }, { "description": "invalid definition schema", "data": {"$defs": {"foo": {"type": 1}}}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/anyOf.json000640 000766 000024 00000011333 14163671560 024750 0ustar00etherstaff000000 000000 [ { "description": "anyOf", "schema": { "anyOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first anyOf valid", "data": 1, "valid": true }, { "description": "second anyOf valid", "data": 2.5, "valid": true }, { "description": "both anyOf valid", "data": 3, "valid": true }, { "description": "neither anyOf valid", "data": 1.5, "valid": false } ] }, { "description": "anyOf with base schema", "schema": { "type": "string", "anyOf" : [ { "maxLength": 2 }, { "minLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one anyOf valid", "data": "foobar", "valid": true }, { "description": "both anyOf invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf with boolean schemas, all true", "schema": {"anyOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, some true", "schema": {"anyOf": [true, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, all false", "schema": {"anyOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf complex types", "schema": { "anyOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first anyOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second anyOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both anyOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "neither anyOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "anyOf with one empty schema", "schema": { "anyOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is valid", "data": 123, "valid": true } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/propertyNames.json000640 000766 000024 00000004130 14163671560 026541 0ustar00etherstaff000000 000000 [ { "description": "propertyNames validation", "schema": { "propertyNames": {"maxLength": 3} }, "tests": [ { "description": "all property names valid", "data": { "f": {}, "foo": {} }, "valid": true }, { "description": "some property names invalid", "data": { "foo": {}, "foobar": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [1, 2, 3, 4], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "propertyNames with boolean schema true", "schema": {"propertyNames": true}, "tests": [ { "description": "object with any properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema false", "schema": {"propertyNames": false}, "tests": [ { "description": "object with any properties is invalid", "data": {"foo": 1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/unknownKeyword.json000640 000766 000024 00000003720 14163671560 026741 0ustar00etherstaff000000 000000 [ { "description": "$id inside an unknown keyword is not a real identifier", "comment": "the implementation must not be confused by an $id in locations we do not know how to parse", "schema": { "$defs": { "id_in_unknown0": { "not": { "array_of_schemas": [ { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "null" } ] } }, "real_id_in_schema": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "string" }, "id_in_unknown1": { "not": { "object_of_schemas": { "foo": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "integer" } } } } }, "anyOf": [ { "$ref": "#/$defs/id_in_unknown0" }, { "$ref": "#/$defs/id_in_unknown1" }, { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" } ] }, "tests": [ { "description": "type matches second anyOf, which has a real schema in it", "data": "a string", "valid": true }, { "description": "type matches non-schema in first anyOf", "data": null, "valid": false }, { "description": "type matches non-schema in third anyOf", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/unevaluatedItems.json000640 000766 000024 00000040454 14163671560 027221 0ustar00etherstaff000000 000000 [ { "description": "unevaluatedItems true", "schema": { "type": "array", "unevaluatedItems": true }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": true } ] }, { "description": "unevaluatedItems false", "schema": { "type": "array", "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": false } ] }, { "description": "unevaluatedItems as schema", "schema": { "type": "array", "unevaluatedItems": { "type": "string" } }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with valid unevaluated items", "data": ["foo"], "valid": true }, { "description": "with invalid unevaluated items", "data": [42], "valid": false } ] }, { "description": "unevaluatedItems with uniform items", "schema": { "type": "array", "items": { "type": "string" }, "unevaluatedItems": false }, "tests": [ { "description": "unevaluatedItems doesn't apply", "data": ["foo", "bar"], "valid": true } ] }, { "description": "unevaluatedItems with tuple", "schema": { "type": "array", "prefixItems": [ { "type": "string" } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar"], "valid": false } ] }, { "description": "unevaluatedItems with items", "schema": { "type": "array", "prefixItems": [ { "type": "string" } ], "items": true, "unevaluatedItems": false }, "tests": [ { "description": "unevaluatedItems doesn't apply", "data": ["foo", 42], "valid": true } ] }, { "description": "unevaluatedItems with nested tuple", "schema": { "type": "array", "prefixItems": [ { "type": "string" } ], "allOf": [ { "prefixItems": [ true, { "type": "number" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", 42], "valid": true }, { "description": "with unevaluated items", "data": ["foo", 42, true], "valid": false } ] }, { "description": "unevaluatedItems with nested items", "schema": { "type": "array", "allOf": [ { "prefixItems": [ { "type": "string" } ], "items": true } ], "unevaluatedItems": false }, "tests": [ { "description": "with no additional items", "data": ["foo"], "valid": true }, { "description": "with additional items", "data": ["foo", 42, true], "valid": true } ] }, { "description": "unevaluatedItems with nested unevaluatedItems", "schema": { "type": "array", "allOf": [ { "prefixItems": [ { "type": "string" } ] }, { "unevaluatedItems": true } ], "unevaluatedItems": false }, "tests": [ { "description": "with no additional items", "data": ["foo"], "valid": true }, { "description": "with additional items", "data": ["foo", 42, true], "valid": true } ] }, { "description": "unevaluatedItems with anyOf", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "anyOf": [ { "prefixItems": [ true, { "const": "bar" } ] }, { "prefixItems": [ true, true, { "const": "baz" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "when one schema matches and has no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "when one schema matches and has unevaluated items", "data": ["foo", "bar", 42], "valid": false }, { "description": "when two schemas match and has no unevaluated items", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "when two schemas match and has unevaluated items", "data": ["foo", "bar", "baz", 42], "valid": false } ] }, { "description": "unevaluatedItems with oneOf", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "oneOf": [ { "prefixItems": [ true, { "const": "bar" } ] }, { "prefixItems": [ true, { "const": "baz" } ] } ], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar", 42], "valid": false } ] }, { "description": "unevaluatedItems with not", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "not": { "not": { "prefixItems": [ true, { "const": "bar" } ] } }, "unevaluatedItems": false }, "tests": [ { "description": "with unevaluated items", "data": ["foo", "bar"], "valid": false } ] }, { "description": "unevaluatedItems with if/then/else", "schema": { "type": "array", "prefixItems": [ { "const": "foo" } ], "if": { "prefixItems": [ true, { "const": "bar" } ] }, "then": { "prefixItems": [ true, true, { "const": "then" } ] }, "else": { "prefixItems": [ true, true, true, { "const": "else" } ] }, "unevaluatedItems": false }, "tests": [ { "description": "when if matches and it has no unevaluated items", "data": ["foo", "bar", "then"], "valid": true }, { "description": "when if matches and it has unevaluated items", "data": ["foo", "bar", "then", "else"], "valid": false }, { "description": "when if doesn't match and it has no unevaluated items", "data": ["foo", 42, 42, "else"], "valid": true }, { "description": "when if doesn't match and it has unevaluated items", "data": ["foo", 42, 42, "else", 42], "valid": false } ] }, { "description": "unevaluatedItems with boolean schemas", "schema": { "type": "array", "allOf": [true], "unevaluatedItems": false }, "tests": [ { "description": "with no unevaluated items", "data": [], "valid": true }, { "description": "with unevaluated items", "data": ["foo"], "valid": false } ] }, { "description": "unevaluatedItems with $ref", "schema": { "type": "array", "$ref": "#/$defs/bar", "prefixItems": [ { "type": "string" } ], "unevaluatedItems": false, "$defs": { "bar": { "prefixItems": [ true, { "type": "string" } ] } } }, "tests": [ { "description": "with no unevaluated items", "data": ["foo", "bar"], "valid": true }, { "description": "with unevaluated items", "data": ["foo", "bar", "baz"], "valid": false } ] }, { "description": "unevaluatedItems can't see inside cousins", "schema": { "allOf": [ { "prefixItems": [ true ] }, { "unevaluatedItems": false } ] }, "tests": [ { "description": "always fails", "data": [ 1 ], "valid": false } ] }, { "description": "item is evaluated in an uncle schema to unevaluatedItems", "schema": { "type": "object", "properties": { "foo": { "type": "array", "prefixItems": [ { "type": "string" } ], "unevaluatedItems": false } }, "anyOf": [ { "properties": { "foo": { "prefixItems": [ true, { "type": "string" } ] } } } ] }, "tests": [ { "description": "no extra items", "data": { "foo": [ "test" ] }, "valid": true }, { "description": "uncle keyword evaluation is not significant", "data": { "foo": [ "test", "test" ] }, "valid": false } ] }, { "description": "unevaluatedItems depends on adjacent contains", "schema": { "prefixItems": [true], "contains": {"type": "string"}, "unevaluatedItems": false }, "tests": [ { "description": "second item is evaluated by contains", "data": [ 1, "foo" ], "valid": true }, { "description": "contains fails, second item is not evaluated", "data": [ 1, 2 ], "valid": false }, { "description": "contains passes, second item is not evaluated", "data": [ 1, 2, "foo" ], "valid": false } ] }, { "description": "unevaluatedItems depends on multiple nested contains", "schema": { "allOf": [ { "contains": { "multipleOf": 2 } }, { "contains": { "multipleOf": 3 } } ], "unevaluatedItems": { "multipleOf": 5 } }, "tests": [ { "description": "5 not evaluated, passes unevaluatedItems", "data": [ 2, 3, 4, 5, 6 ], "valid": true }, { "description": "7 not evaluated, fails unevaluatedItems", "data": [ 2, 3, 4, 7, 8 ], "valid": false } ] }, { "description": "unevaluatedItems and contains interact to control item dependency relationship", "schema": { "if": { "contains": {"const": "a"} }, "then": { "if": { "contains": {"const": "b"} }, "then": { "if": { "contains": {"const": "c"} } } }, "unevaluatedItems": false }, "tests": [ { "description": "empty array is valid", "data": [], "valid": true }, { "description": "only a's are valid", "data": [ "a", "a" ], "valid": true }, { "description": "a's and b's are valid", "data": [ "a", "b", "a", "b", "a" ], "valid": true }, { "description": "a's, b's and c's are valid", "data": [ "c", "a", "c", "c", "b", "a" ], "valid": true }, { "description": "only b's are invalid", "data": [ "b", "b" ], "valid": false }, { "description": "only c's are invalid", "data": [ "c", "c" ], "valid": false }, { "description": "only b's and c's are invalid", "data": [ "c", "b", "c", "b", "c" ], "valid": false }, { "description": "only a's and c's are invalid", "data": [ "c", "a", "c", "a", "c" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/vocabulary.json000640 000766 000024 00000002217 14163671560 026044 0ustar00etherstaff000000 000000 [ { "description": "schema that uses custom metaschema with with no validation vocabulary", "schema": { "$id": "https://schema/using/no/validation", "$schema": "http://localhost:1234/draft2020-12/metaschema-no-validation.json", "properties": { "badProperty": false, "numberProperty": { "minimum": 10 } } }, "tests": [ { "description": "applicator vocabulary still works", "data": { "badProperty": "this property should not exist" }, "valid": false }, { "description": "no validation: valid number", "data": { "numberProperty": 20 }, "valid": true }, { "description": "no validation: invalid number, but it still validates", "data": { "numberProperty": 1 }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/boolean_schema.json000640 000766 000024 00000005402 14163671560 026633 0ustar00etherstaff000000 000000 [ { "description": "boolean schema 'true'", "schema": true, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is valid", "data": "foo", "valid": true }, { "description": "boolean true is valid", "data": true, "valid": true }, { "description": "boolean false is valid", "data": false, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "object is valid", "data": {"foo": "bar"}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true }, { "description": "array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "boolean schema 'false'", "schema": false, "tests": [ { "description": "number is invalid", "data": 1, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "boolean true is invalid", "data": true, "valid": false }, { "description": "boolean false is invalid", "data": false, "valid": false }, { "description": "null is invalid", "data": null, "valid": false }, { "description": "object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/not.json000640 000766 000024 00000005376 14163671560 024506 0ustar00etherstaff000000 000000 [ { "description": "not", "schema": { "not": {"type": "integer"} }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "not multiple types", "schema": { "not": {"type": ["integer", "boolean"]} }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "not more complex schema", "schema": { "not": { "type": "object", "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "forbidden property", "schema": { "properties": { "foo": { "not": {} } } }, "tests": [ { "description": "property present", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "property absent", "data": {"bar": 1, "baz": 2}, "valid": true } ] }, { "description": "not with boolean schema true", "schema": {"not": true}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "not with boolean schema false", "schema": {"not": false}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/items.json000640 000766 000024 00000016673 14163671560 025031 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "length": 1 }, "valid": true } ] }, { "description": "items with boolean schema (true)", "schema": {"items": true}, "tests": [ { "description": "any array is valid", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schema (false)", "schema": {"items": false}, "tests": [ { "description": "any non-empty array is invalid", "data": [ 1, "foo", true ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items and subitems", "schema": { "$defs": { "item": { "type": "array", "items": false, "prefixItems": [ { "$ref": "#/$defs/sub-item" }, { "$ref": "#/$defs/sub-item" } ] }, "sub-item": { "type": "object", "required": ["foo"] } }, "type": "array", "items": false, "prefixItems": [ { "$ref": "#/$defs/item" }, { "$ref": "#/$defs/item" }, { "$ref": "#/$defs/item" } ] }, "tests": [ { "description": "valid items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": true }, { "description": "too many items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "too many sub-items", "data": [ [ {"foo": null}, {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong item", "data": [ {"foo": null}, [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong sub-item", "data": [ [ {}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "fewer items is valid", "data": [ [ {"foo": null} ], [ {"foo": null} ] ], "valid": true } ] }, { "description": "nested items", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } }, "tests": [ { "description": "valid nested array", "data": [[[[1]], [[2],[3]]], [[[4], [5], [6]]]], "valid": true }, { "description": "nested array with invalid type", "data": [[[["1"]], [[2],[3]]], [[[4], [5], [6]]]], "valid": false }, { "description": "not deep enough", "data": [[[1], [2],[3]], [[4], [5], [6]]], "valid": false } ] }, { "description": "prefixItems with no additional items allowed", "schema": { "prefixItems": [{}, {}, {}], "items": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "items should not look in applicators, valid case", "schema": { "allOf": [ { "prefixItems": [ { "minimum": 3 } ] } ], "items": { "minimum": 5 } }, "tests": [ { "description": "prefixItems in allOf should not constrain items, invalid case", "data": [ 3, 5 ], "valid": false }, { "description": "prefixItems in allOf should not constrain items, valid case", "data": [ 5, 5 ], "valid": true } ] }, { "description": "prefixItems validation adjusts the starting index for items", "schema": { "prefixItems": [ { "type": "string" } ], "items": { "type": "integer" } }, "tests": [ { "description": "valid items", "data": [ "x", 2, 3 ], "valid": true }, { "description": "wrong type of second item", "data": [ "x", "y" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/enum.json000640 000766 000024 00000014643 14163671560 024647 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false }, { "description": "valid object matches", "data": {"foo": 12}, "valid": true }, { "description": "extra properties in object is invalid", "data": {"foo": 12, "boo": 42}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"]} }, "required": ["bar"] }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "enum with escaped characters", "schema": { "enum": ["foo\nbar", "foo\rbar"] }, "tests": [ { "description": "member 1 is valid", "data": "foo\nbar", "valid": true }, { "description": "member 2 is valid", "data": "foo\rbar", "valid": true }, { "description": "another string is invalid", "data": "abc", "valid": false } ] }, { "description": "enum with false does not match 0", "schema": {"enum": [false]}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true } ] }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/minProperties.json000640 000766 000024 00000001754 14163671560 026542 0ustar00etherstaff000000 000000 [ { "description": "minProperties validation", "schema": {"minProperties": 1}, "tests": [ { "description": "longer is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1}, "valid": true }, { "description": "too short is invalid", "data": {}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/minContains.json000640 000766 000024 00000012560 14163671560 026161 0ustar00etherstaff000000 000000 [ { "description": "minContains without contains is ignored", "schema": { "minContains": 1 }, "tests": [ { "description": "one item valid against lone minContains", "data": [ 1 ], "valid": true }, { "description": "zero items still valid against lone minContains", "data": [], "valid": true } ] }, { "description": "minContains=1 with contains", "schema": { "contains": {"const": 1}, "minContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "no elements match", "data": [ 2 ], "valid": false }, { "description": "single element matches, valid minContains", "data": [ 1 ], "valid": true }, { "description": "some elements match, valid minContains", "data": [ 1, 2 ], "valid": true }, { "description": "all elements match, valid minContains", "data": [ 1, 1 ], "valid": true } ] }, { "description": "minContains=2 with contains", "schema": { "contains": {"const": 1}, "minContains": 2 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "all elements match, invalid minContains", "data": [ 1 ], "valid": false }, { "description": "some elements match, invalid minContains", "data": [ 1, 2 ], "valid": false }, { "description": "all elements match, valid minContains (exactly as needed)", "data": [ 1, 1 ], "valid": true }, { "description": "all elements match, valid minContains (more than needed)", "data": [ 1, 1, 1 ], "valid": true }, { "description": "some elements match, valid minContains", "data": [ 1, 2, 1 ], "valid": true } ] }, { "description": "maxContains = minContains", "schema": { "contains": {"const": 1}, "maxContains": 2, "minContains": 2 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "all elements match, invalid minContains", "data": [ 1 ], "valid": false }, { "description": "all elements match, invalid maxContains", "data": [ 1, 1, 1 ], "valid": false }, { "description": "all elements match, valid maxContains and minContains", "data": [ 1, 1 ], "valid": true } ] }, { "description": "maxContains < minContains", "schema": { "contains": {"const": 1}, "maxContains": 1, "minContains": 3 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "invalid minContains", "data": [ 1 ], "valid": false }, { "description": "invalid maxContains", "data": [ 1, 1, 1 ], "valid": false }, { "description": "invalid maxContains and minContains", "data": [ 1, 1 ], "valid": false } ] }, { "description": "minContains = 0", "schema": { "contains": {"const": 1}, "minContains": 0 }, "tests": [ { "description": "empty data", "data": [ ], "valid": true }, { "description": "minContains = 0 makes contains always pass", "data": [ 2 ], "valid": true } ] }, { "description": "minContains = 0 with maxContains", "schema": { "contains": {"const": 1}, "minContains": 0, "maxContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": true }, { "description": "not more than maxContains", "data": [ 1 ], "valid": true }, { "description": "too many", "data": [ 1, 1 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/properties.json000640 000766 000024 00000012034 14163671560 026067 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] }, { "description": "properties with boolean schema", "schema": { "properties": { "foo": true, "bar": false } }, "tests": [ { "description": "no property present is valid", "data": {}, "valid": true }, { "description": "only 'true' property present is valid", "data": {"foo": 1}, "valid": true }, { "description": "only 'false' property present is invalid", "data": {"bar": 2}, "valid": false }, { "description": "both properties present is invalid", "data": {"foo": 1, "bar": 2}, "valid": false } ] }, { "description": "properties with escaped characters", "schema": { "properties": { "foo\nbar": {"type": "number"}, "foo\"bar": {"type": "number"}, "foo\\bar": {"type": "number"}, "foo\rbar": {"type": "number"}, "foo\tbar": {"type": "number"}, "foo\fbar": {"type": "number"} } }, "tests": [ { "description": "object with all numbers is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1", "foo\\bar": "1", "foo\rbar": "1", "foo\tbar": "1", "foo\fbar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/maxContains.json000640 000766 000024 00000004243 14163671560 026162 0ustar00etherstaff000000 000000 [ { "description": "maxContains without contains is ignored", "schema": { "maxContains": 1 }, "tests": [ { "description": "one item valid against lone maxContains", "data": [ 1 ], "valid": true }, { "description": "two items still valid against lone maxContains", "data": [ 1, 2 ], "valid": true } ] }, { "description": "maxContains with contains", "schema": { "contains": {"const": 1}, "maxContains": 1 }, "tests": [ { "description": "empty data", "data": [ ], "valid": false }, { "description": "all elements match, valid maxContains", "data": [ 1 ], "valid": true }, { "description": "all elements match, invalid maxContains", "data": [ 1, 1 ], "valid": false }, { "description": "some elements match, valid maxContains", "data": [ 1, 2 ], "valid": true }, { "description": "some elements match, invalid maxContains", "data": [ 1, 2, 1 ], "valid": false } ] }, { "description": "minContains < maxContains", "schema": { "contains": {"const": 1}, "minContains": 1, "maxContains": 3 }, "tests": [ { "description": "actual < minContains < maxContains", "data": [ ], "valid": false }, { "description": "minContains < actual < maxContains", "data": [ 1, 1 ], "valid": true }, { "description": "minContains < maxContains < actual", "data": [ 1, 1, 1, 1 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/maxLength.json000640 000766 000024 00000001600 14163671560 025617 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/dependentSchemas.json000640 000766 000024 00000007112 14163671560 027146 0ustar00etherstaff000000 000000 [ { "description": "single dependency", "schema": { "dependentSchemas": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "boolean subschemas", "schema": { "dependentSchemas": { "foo": true, "bar": false } }, "tests": [ { "description": "object with property having schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property having schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "dependencies with escaped characters", "schema": { "dependentSchemas": { "foo\tbar": {"minProperties": 4}, "foo'bar": {"required": ["foo\"bar"]} } }, "tests": [ { "description": "quoted tab", "data": { "foo\tbar": 1, "a": 2, "b": 3, "c": 4 }, "valid": true }, { "description": "quoted quote", "data": { "foo'bar": {"foo\"bar": 1} }, "valid": false }, { "description": "quoted tab invalid under dependent schema", "data": { "foo\tbar": 1, "a": 2 }, "valid": false }, { "description": "quoted quote invalid under dependent schema", "data": {"foo'bar": 1}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/infinite-loop-detection.json000640 000766 000024 00000001724 14163671560 030427 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "$defs": { "int": { "type": "integer" } }, "allOf": [ { "properties": { "foo": { "$ref": "#/$defs/int" } } }, { "additionalProperties": { "$ref": "#/$defs/int" } } ] }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/exclusiveMaximum.json000640 000766 000024 00000001407 14163671560 027242 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMaximum validation", "schema": { "exclusiveMaximum": 3.0 }, "tests": [ { "description": "below the exclusiveMaximum is valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false }, { "description": "above the exclusiveMaximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/prefixItems.json000640 000766 000024 00000004257 14163671560 026202 0ustar00etherstaff000000 000000 [ { "description": "a schema given for prefixItems", "schema": { "prefixItems": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false }, { "description": "incomplete array of items", "data": [ 1 ], "valid": true }, { "description": "array with additional items", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array", "data": [ ], "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "1": "valid", "length": 2 }, "valid": true } ] }, { "description": "prefixItems with boolean schemas", "schema": { "prefixItems": [true, false] }, "tests": [ { "description": "array with one item is valid", "data": [ 1 ], "valid": true }, { "description": "array with two items is invalid", "data": [ 1, "foo" ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "additional items are allowed by default", "schema": {"prefixItems": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/minimum.json000640 000766 000024 00000003612 14163671560 025350 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/000770 000766 000024 00000000000 14163671560 024626 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/oneOf.json000640 000766 000024 00000016123 14163671560 024744 0ustar00etherstaff000000 000000 [ { "description": "oneOf", "schema": { "oneOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first oneOf valid", "data": 1, "valid": true }, { "description": "second oneOf valid", "data": 2.5, "valid": true }, { "description": "both oneOf valid", "data": 3, "valid": false }, { "description": "neither oneOf valid", "data": 1.5, "valid": false } ] }, { "description": "oneOf with base schema", "schema": { "type": "string", "oneOf" : [ { "minLength": 2 }, { "maxLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one oneOf valid", "data": "foobar", "valid": true }, { "description": "both oneOf valid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all true", "schema": {"oneOf": [true, true, true]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, one true", "schema": {"oneOf": [true, false, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "oneOf with boolean schemas, more than one true", "schema": {"oneOf": [true, true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all false", "schema": {"oneOf": [false, false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf complex types", "schema": { "oneOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second oneOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both oneOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": false }, { "description": "neither oneOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "oneOf with empty schema", "schema": { "oneOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "one valid - valid", "data": "foo", "valid": true }, { "description": "both valid - invalid", "data": 123, "valid": false } ] }, { "description": "oneOf with required", "schema": { "type": "object", "oneOf": [ { "required": ["foo", "bar"] }, { "required": ["foo", "baz"] } ] }, "tests": [ { "description": "both invalid - invalid", "data": {"bar": 2}, "valid": false }, { "description": "first valid - valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "second valid - valid", "data": {"foo": 1, "baz": 3}, "valid": true }, { "description": "both valid - invalid", "data": {"foo": 1, "bar": 2, "baz" : 3}, "valid": false } ] }, { "description": "oneOf with missing optional property", "schema": { "oneOf": [ { "properties": { "bar": true, "baz": true }, "required": ["bar"] }, { "properties": { "foo": true }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid", "data": {"bar": 8}, "valid": true }, { "description": "second oneOf valid", "data": {"foo": "foo"}, "valid": true }, { "description": "both oneOf valid", "data": {"foo": "foo", "bar": 8}, "valid": false }, { "description": "neither oneOf valid", "data": {"baz": "quux"}, "valid": false } ] }, { "description": "nested oneOf, to check validation semantics", "schema": { "oneOf": [ { "oneOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/if-then-else.json000640 000766 000024 00000015322 14163671560 026156 0ustar00etherstaff000000 000000 [ { "description": "ignore if without then or else", "schema": { "if": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone if", "data": 0, "valid": true }, { "description": "valid when invalid against lone if", "data": "hello", "valid": true } ] }, { "description": "ignore then without if", "schema": { "then": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone then", "data": 0, "valid": true }, { "description": "valid when invalid against lone then", "data": "hello", "valid": true } ] }, { "description": "ignore else without if", "schema": { "else": { "const": 0 } }, "tests": [ { "description": "valid when valid against lone else", "data": 0, "valid": true }, { "description": "valid when invalid against lone else", "data": "hello", "valid": true } ] }, { "description": "if and then without else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid when if test fails", "data": 3, "valid": true } ] }, { "description": "if and else without then", "schema": { "if": { "exclusiveMaximum": 0 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid when if test passes", "data": -1, "valid": true }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "validate against correct branch, then vs else", "schema": { "if": { "exclusiveMaximum": 0 }, "then": { "minimum": -10 }, "else": { "multipleOf": 2 } }, "tests": [ { "description": "valid through then", "data": -1, "valid": true }, { "description": "invalid through then", "data": -100, "valid": false }, { "description": "valid through else", "data": 4, "valid": true }, { "description": "invalid through else", "data": 3, "valid": false } ] }, { "description": "non-interference across combined schemas", "schema": { "allOf": [ { "if": { "exclusiveMaximum": 0 } }, { "then": { "minimum": -10 } }, { "else": { "multipleOf": 2 } } ] }, "tests": [ { "description": "valid, but would have been invalid through then", "data": -100, "valid": true }, { "description": "valid, but would have been invalid through else", "data": 3, "valid": true } ] }, { "description": "if with boolean schema true", "schema": { "if": true, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema true in if always chooses the then path (valid)", "data": "then", "valid": true }, { "description": "boolean schema true in if always chooses the then path (invalid)", "data": "else", "valid": false } ] }, { "description": "if with boolean schema false", "schema": { "if": false, "then": { "const": "then" }, "else": { "const": "else" } }, "tests": [ { "description": "boolean schema false in if always chooses the else path (invalid)", "data": "then", "valid": false }, { "description": "boolean schema false in if always chooses the else path (valid)", "data": "else", "valid": true } ] }, { "description": "if appears at the end when serialized (keyword processing sequence)", "schema": { "then": { "const": "yes" }, "else": { "const": "other" }, "if": { "maxLength": 4 } }, "tests": [ { "description": "yes redirects to then and passes", "data": "yes", "valid": true }, { "description": "other redirects to else and passes", "data": "other", "valid": true }, { "description": "no redirects to then and fails", "data": "no", "valid": false }, { "description": "invalid redirects to else and fails", "data": "invalid", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/pattern.json000640 000766 000024 00000003003 14163671560 025344 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/unevaluatedProperties.json000640 000766 000024 00000111627 14163671560 030275 0ustar00etherstaff000000 000000 [ { "description": "unevaluatedProperties true", "schema": { "type": "object", "unevaluatedProperties": true }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo" }, "valid": true } ] }, { "description": "unevaluatedProperties schema", "schema": { "type": "object", "unevaluatedProperties": { "type": "string", "minLength": 3 } }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with valid unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with invalid unevaluated properties", "data": { "foo": "fo" }, "valid": false } ] }, { "description": "unevaluatedProperties false", "schema": { "type": "object", "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": {}, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent properties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent patternProperties", "schema": { "type": "object", "patternProperties": { "^foo": { "type": "string" } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with adjacent additionalProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "additionalProperties": true, "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with nested properties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "properties": { "bar": { "type": "string" } } } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with nested patternProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "patternProperties": { "^bar": { "type": "string" } } } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with nested additionalProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "additionalProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no additional properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with additional properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with nested unevaluatedProperties", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": true } ], "unevaluatedProperties": { "type": "string", "maxLength": 2 } }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "unevaluatedProperties with anyOf", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "anyOf": [ { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] }, { "properties": { "baz": { "const": "baz" } }, "required": ["baz"] }, { "properties": { "quux": { "const": "quux" } }, "required": ["quux"] } ], "unevaluatedProperties": false }, "tests": [ { "description": "when one matches and has no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "when one matches and has unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "not-baz" }, "valid": false }, { "description": "when two match and has no unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": true }, { "description": "when two match and has unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz", "quux": "not-quux" }, "valid": false } ] }, { "description": "unevaluatedProperties with oneOf", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "oneOf": [ { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] }, { "properties": { "baz": { "const": "baz" } }, "required": ["baz"] } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar", "quux": "quux" }, "valid": false } ] }, { "description": "unevaluatedProperties with not", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "not": { "not": { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] } }, "unevaluatedProperties": false }, "tests": [ { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "then": { "properties": { "bar": { "type": "string" } }, "required": ["bar"] }, "else": { "properties": { "baz": { "type": "string" } }, "required": ["baz"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": true }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": true }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else, then not defined", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "else": { "properties": { "baz": { "type": "string" } }, "required": ["baz"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": false }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": true }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with if/then/else, else not defined", "schema": { "type": "object", "if": { "properties": { "foo": { "const": "then" } }, "required": ["foo"] }, "then": { "properties": { "bar": { "type": "string" } }, "required": ["bar"] }, "unevaluatedProperties": false }, "tests": [ { "description": "when if is true and has no unevaluated properties", "data": { "foo": "then", "bar": "bar" }, "valid": true }, { "description": "when if is true and has unevaluated properties", "data": { "foo": "then", "bar": "bar", "baz": "baz" }, "valid": false }, { "description": "when if is false and has no unevaluated properties", "data": { "baz": "baz" }, "valid": false }, { "description": "when if is false and has unevaluated properties", "data": { "foo": "else", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties with dependentSchemas", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "dependentSchemas": { "foo": { "properties": { "bar": { "const": "bar" } }, "required": ["bar"] } }, "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with boolean schemas", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [true], "unevaluatedProperties": false }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with unevaluated properties", "data": { "bar": "bar" }, "valid": false } ] }, { "description": "unevaluatedProperties with $ref", "schema": { "type": "object", "$ref": "#/$defs/bar", "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false, "$defs": { "bar": { "properties": { "bar": { "type": "string" } } } } }, "tests": [ { "description": "with no unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true }, { "description": "with unevaluated properties", "data": { "foo": "foo", "bar": "bar", "baz": "baz" }, "valid": false } ] }, { "description": "unevaluatedProperties can't see inside cousins", "schema": { "allOf": [ { "properties": { "foo": true } }, { "unevaluatedProperties": false } ] }, "tests": [ { "description": "always fails", "data": { "foo": 1 }, "valid": false } ] }, { "description": "nested unevaluatedProperties, outer false, inner true, properties outside", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "nested unevaluatedProperties, outer false, inner true, properties inside", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": true } ], "unevaluatedProperties": false }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": true } ] }, { "description": "nested unevaluatedProperties, outer true, inner false, properties outside", "schema": { "type": "object", "properties": { "foo": { "type": "string" } }, "allOf": [ { "unevaluatedProperties": false } ], "unevaluatedProperties": true }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": false }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "nested unevaluatedProperties, outer true, inner false, properties inside", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false } ], "unevaluatedProperties": true }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "cousin unevaluatedProperties, true and false, true with properties", "schema": { "type": "object", "allOf": [ { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": true }, { "unevaluatedProperties": false } ] }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": false }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "cousin unevaluatedProperties, true and false, false with properties", "schema": { "type": "object", "allOf": [ { "unevaluatedProperties": true }, { "properties": { "foo": { "type": "string" } }, "unevaluatedProperties": false } ] }, "tests": [ { "description": "with no nested unevaluated properties", "data": { "foo": "foo" }, "valid": true }, { "description": "with nested unevaluated properties", "data": { "foo": "foo", "bar": "bar" }, "valid": false } ] }, { "description": "property is evaluated in an uncle schema to unevaluatedProperties", "comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations", "schema": { "type": "object", "properties": { "foo": { "type": "object", "properties": { "bar": { "type": "string" } }, "unevaluatedProperties": false } }, "anyOf": [ { "properties": { "foo": { "properties": { "faz": { "type": "string" } } } } } ] }, "tests": [ { "description": "no extra properties", "data": { "foo": { "bar": "test" } }, "valid": true }, { "description": "uncle keyword evaluation is not significant", "data": { "foo": { "bar": "test", "faz": "test" } }, "valid": false } ] }, { "description": "in-place applicator siblings, allOf has unevaluated", "schema": { "type": "object", "allOf": [ { "properties": { "foo": true }, "unevaluatedProperties": false } ], "anyOf": [ { "properties": { "bar": true } } ] }, "tests": [ { "description": "base case: both properties present", "data": { "foo": 1, "bar": 1 }, "valid": false }, { "description": "in place applicator siblings, bar is missing", "data": { "foo": 1 }, "valid": true }, { "description": "in place applicator siblings, foo is missing", "data": { "bar": 1 }, "valid": false } ] }, { "description": "in-place applicator siblings, anyOf has unevaluated", "schema": { "type": "object", "allOf": [ { "properties": { "foo": true } } ], "anyOf": [ { "properties": { "bar": true }, "unevaluatedProperties": false } ] }, "tests": [ { "description": "base case: both properties present", "data": { "foo": 1, "bar": 1 }, "valid": false }, { "description": "in place applicator siblings, bar is missing", "data": { "foo": 1 }, "valid": false }, { "description": "in place applicator siblings, foo is missing", "data": { "bar": 1 }, "valid": true } ] }, { "description": "unevaluatedProperties + single cyclic ref", "schema": { "type": "object", "properties": { "x": { "$ref": "#" } }, "unevaluatedProperties": false }, "tests": [ { "description": "Empty is valid", "data": {}, "valid": true }, { "description": "Single is valid", "data": { "x": {} }, "valid": true }, { "description": "Unevaluated on 1st level is invalid", "data": { "x": {}, "y": {} }, "valid": false }, { "description": "Nested is valid", "data": { "x": { "x": {} } }, "valid": true }, { "description": "Unevaluated on 2nd level is invalid", "data": { "x": { "x": {}, "y": {} } }, "valid": false }, { "description": "Deep nested is valid", "data": { "x": { "x": { "x": {} } } }, "valid": true }, { "description": "Unevaluated on 3rd level is invalid", "data": { "x": { "x": { "x": {}, "y": {} } } }, "valid": false } ] }, { "description": "unevaluatedProperties + ref inside allOf / oneOf", "schema": { "$defs": { "one": { "properties": { "a": true } }, "two": { "required": ["x"], "properties": { "x": true } } }, "allOf": [ { "$ref": "#/$defs/one" }, { "properties": { "b": true } }, { "oneOf": [ { "$ref": "#/$defs/two" }, { "required": ["y"], "properties": { "y": true } } ] } ], "unevaluatedProperties": false }, "tests": [ { "description": "Empty is invalid (no x or y)", "data": {}, "valid": false }, { "description": "a and b are invalid (no x or y)", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "x and y are invalid", "data": { "x": 1, "y": 1 }, "valid": false }, { "description": "a and x are valid", "data": { "a": 1, "x": 1 }, "valid": true }, { "description": "a and y are valid", "data": { "a": 1, "y": 1 }, "valid": true }, { "description": "a and b and x are valid", "data": { "a": 1, "b": 1, "x": 1 }, "valid": true }, { "description": "a and b and y are valid", "data": { "a": 1, "b": 1, "y": 1 }, "valid": true }, { "description": "a and b and x and y are invalid", "data": { "a": 1, "b": 1, "x": 1, "y": 1 }, "valid": false } ] }, { "description": "dynamic evalation inside nested refs", "schema": { "$defs": { "one": { "oneOf": [ { "$ref": "#/$defs/two" }, { "required": ["b"], "properties": { "b": true } }, { "required": ["xx"], "patternProperties": { "x": true } }, { "required": ["all"], "unevaluatedProperties": true } ] }, "two": { "oneOf": [ { "required": ["c"], "properties": { "c": true } }, { "required": ["d"], "properties": { "d": true } } ] } }, "oneOf": [ { "$ref": "#/$defs/one" }, { "required": ["a"], "properties": { "a": true } } ], "unevaluatedProperties": false }, "tests": [ { "description": "Empty is invalid", "data": {}, "valid": false }, { "description": "a is valid", "data": { "a": 1 }, "valid": true }, { "description": "b is valid", "data": { "b": 1 }, "valid": true }, { "description": "c is valid", "data": { "c": 1 }, "valid": true }, { "description": "d is valid", "data": { "d": 1 }, "valid": true }, { "description": "a + b is invalid", "data": { "a": 1, "b": 1 }, "valid": false }, { "description": "a + c is invalid", "data": { "a": 1, "c": 1 }, "valid": false }, { "description": "a + d is invalid", "data": { "a": 1, "d": 1 }, "valid": false }, { "description": "b + c is invalid", "data": { "b": 1, "c": 1 }, "valid": false }, { "description": "b + d is invalid", "data": { "b": 1, "d": 1 }, "valid": false }, { "description": "c + d is invalid", "data": { "c": 1, "d": 1 }, "valid": false }, { "description": "xx is valid", "data": { "xx": 1 }, "valid": true }, { "description": "xx + foox is valid", "data": { "xx": 1, "foox": 1 }, "valid": true }, { "description": "xx + foo is invalid", "data": { "xx": 1, "foo": 1 }, "valid": false }, { "description": "xx + a is invalid", "data": { "xx": 1, "a": 1 }, "valid": false }, { "description": "xx + b is invalid", "data": { "xx": 1, "b": 1 }, "valid": false }, { "description": "xx + c is invalid", "data": { "xx": 1, "c": 1 }, "valid": false }, { "description": "xx + d is invalid", "data": { "xx": 1, "d": 1 }, "valid": false }, { "description": "all is valid", "data": { "all": 1 }, "valid": true }, { "description": "all + foo is valid", "data": { "all": 1, "foo": 1 }, "valid": true }, { "description": "all + a is invalid", "data": { "all": 1, "a": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/maxProperties.json000640 000766 000024 00000002732 14163671560 026541 0ustar00etherstaff000000 000000 [ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, "tests": [ { "description": "shorter is valid", "data": {"foo": 1}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "too long is invalid", "data": {"foo": 1, "bar": 2, "baz": 3}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "maxProperties = 0 means the object is empty", "schema": { "maxProperties": 0 }, "tests": [ { "description": "no properties is valid", "data": {}, "valid": true }, { "description": "one property is invalid", "data": { "foo": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/dependentRequired.json000640 000766 000024 00000007550 14163671560 027351 0ustar00etherstaff000000 000000 [ { "description": "single dependency", "schema": {"dependentRequired": {"bar": ["foo"]}}, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "empty dependents", "schema": {"dependentRequired": {"bar": []}}, "tests": [ { "description": "empty object", "data": {}, "valid": true }, { "description": "object with one property", "data": {"bar": 2}, "valid": true }, { "description": "non-object is valid", "data": 1, "valid": true } ] }, { "description": "multiple dependents required", "schema": {"dependentRequired": {"quux": ["foo", "bar"]}}, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "dependencies with escaped characters", "schema": { "dependentRequired": { "foo\nbar": ["foo\rbar"], "foo\"bar": ["foo'bar"] } }, "tests": [ { "description": "CRLF", "data": { "foo\nbar": 1, "foo\rbar": 2 }, "valid": true }, { "description": "quoted quotes", "data": { "foo'bar": 1, "foo\"bar": 2 }, "valid": true }, { "description": "CRLF missing dependent", "data": { "foo\nbar": 1, "foo": 2 }, "valid": false }, { "description": "quoted quotes missing dependent", "data": { "foo\"bar": 2 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/required.json000640 000766 000024 00000005206 14163671560 025516 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {}, "bar": {} }, "required": ["foo"] }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required with empty array", "schema": { "properties": { "foo": {} }, "required": [] }, "tests": [ { "description": "property not required", "data": {}, "valid": true } ] }, { "description": "required with escaped characters", "schema": { "required": [ "foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar" ] }, "tests": [ { "description": "object with all properties present is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with some properties missing is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/id.json000640 000766 000024 00000021105 14163671560 024266 0ustar00etherstaff000000 000000 [ { "description": "Invalid use of fragments in location-independent $id", "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" }, "tests": [ { "description": "Identifier name", "data": { "$ref": "#foo", "$defs": { "A": { "$id": "#foo", "type": "integer" } } }, "valid": false }, { "description": "Identifier name and no ref", "data": { "$defs": { "A": { "$id": "#foo" } } }, "valid": false }, { "description": "Identifier path", "data": { "$ref": "#/a/b", "$defs": { "A": { "$id": "#/a/b", "type": "integer" } } }, "valid": false }, { "description": "Identifier name with absolute URI", "data": { "$ref": "http://localhost:1234/bar#foo", "$defs": { "A": { "$id": "http://localhost:1234/bar#foo", "type": "integer" } } }, "valid": false }, { "description": "Identifier path with absolute URI", "data": { "$ref": "http://localhost:1234/bar#/a/b", "$defs": { "A": { "$id": "http://localhost:1234/bar#/a/b", "type": "integer" } } }, "valid": false }, { "description": "Identifier name with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#foo", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#foo", "type": "integer" } } } } }, "valid": false }, { "description": "Identifier path with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#/a/b", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#/a/b", "type": "integer" } } } } }, "valid": false } ] }, { "description": "Valid use of empty fragments in location-independent $id", "comment": "These are allowed but discouraged", "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" }, "tests": [ { "description": "Identifier name with absolute URI", "data": { "$ref": "http://localhost:1234/bar", "$defs": { "A": { "$id": "http://localhost:1234/bar#", "type": "integer" } } }, "valid": true }, { "description": "Identifier name with base URI change in subschema", "data": { "$id": "http://localhost:1234/root", "$ref": "http://localhost:1234/nested.json#/$defs/B", "$defs": { "A": { "$id": "nested.json", "$defs": { "B": { "$id": "#", "type": "integer" } } } } }, "valid": true } ] }, { "description": "Unnormalized $ids are allowed but discouraged", "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" }, "tests": [ { "description": "Unnormalized identifier", "data": { "$ref": "http://localhost:1234/foo/baz", "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier and no ref", "data": { "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier with empty fragment", "data": { "$ref": "http://localhost:1234/foo/baz", "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz#", "type": "integer" } } }, "valid": true }, { "description": "Unnormalized identifier with empty fragment and no ref", "data": { "$defs": { "A": { "$id": "http://localhost:1234/foo/bar/../baz#", "type": "integer" } } }, "valid": true } ] }, { "description": "$id inside an enum is not a real identifier", "comment": "the implementation must not be confused by an $id buried in the enum", "schema": { "$defs": { "id_in_enum": { "enum": [ { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } ] }, "real_id_in_schema": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "string" }, "zzz_id_in_const": { "const": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } } }, "anyOf": [ { "$ref": "#/$defs/id_in_enum" }, { "$ref": "https://localhost:1234/id/my_identifier.json" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" }, "valid": true }, { "description": "match $ref to $id", "data": "a string to match #/$defs/id_in_enum", "valid": true }, { "description": "no match on enum or $ref to $id", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/type.json000640 000766 000024 00000032140 14163671560 024654 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float with zero fractional part is an integer", "data": 1.0, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number (and an integer)", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an empty string is still a string", "data": "", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "zero is not a boolean", "data": 0, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an empty string is not a boolean", "data": "", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "true is a boolean", "data": true, "valid": true }, { "description": "false is a boolean", "data": false, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "zero is not null", "data": 0, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an empty string is not null", "data": "", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "true is not null", "data": true, "valid": false }, { "description": "false is not null", "data": false, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type as array with one item", "schema": { "type": ["string"] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is invalid", "data": 123, "valid": false } ] }, { "description": "type: array or object", "schema": { "type": ["array", "object"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type: array, object or null", "schema": { "type": ["array", "object", "null"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/default.json000640 000766 000024 00000004267 14163671560 025330 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/multipleOf.json000640 000766 000024 00000003577 14163671560 026027 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"multipleOf": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"multipleOf": 1.5}, "tests": [ { "description": "zero is multiple of anything", "data": 0, "valid": true }, { "description": "4.5 is multiple of 1.5", "data": 4.5, "valid": true }, { "description": "35 is not multiple of 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"multipleOf": 0.0001}, "tests": [ { "description": "0.0075 is multiple of 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not multiple of 0.0001", "data": 0.00751, "valid": false } ] }, { "description": "invalid instance should not raise error when float division = inf", "schema": {"type": "integer", "multipleOf": 0.123456789}, "tests": [ { "description": "always invalid, but naive implementations may raise an overflow error", "data": 1e308, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/patternProperties.json000640 000766 000024 00000011251 14163671560 027425 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": ["foo"], "valid": true }, { "description": "ignores strings", "data": "foo", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] }, { "description": "patternProperties with boolean schemas", "schema": { "patternProperties": { "f.*": true, "b.*": false } }, "tests": [ { "description": "object with property matching schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property matching schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "object with a property matching both true and false is invalid", "data": {"foobar":1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/refRemote.json000640 000766 000024 00000012334 14163671560 025626 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas-defs.json#/$defs/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "base URI change", "schema": { "$id": "http://localhost:1234/", "items": { "$id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "base URI change ref valid", "data": [[1]], "valid": true }, { "description": "base URI change ref invalid", "data": [["a"]], "valid": false } ] }, { "description": "base URI change - change folder", "schema": { "$id": "http://localhost:1234/scope_change_defs1.json", "type" : "object", "properties": {"list": {"$ref": "baseUriChangeFolder/"}}, "$defs": { "baz": { "$id": "baseUriChangeFolder/", "type": "array", "items": {"$ref": "folderInteger.json"} } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "base URI change - change folder in subschema", "schema": { "$id": "http://localhost:1234/scope_change_defs2.json", "type" : "object", "properties": {"list": {"$ref": "baseUriChangeFolderInSubschema/#/$defs/bar"}}, "$defs": { "baz": { "$id": "baseUriChangeFolderInSubschema/", "$defs": { "bar": { "type": "array", "items": {"$ref": "folderInteger.json"} } } } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "root ref in remote ref", "schema": { "$id": "http://localhost:1234/object", "type": "object", "properties": { "name": {"$ref": "name-defs.json#/$defs/orNull"} } }, "tests": [ { "description": "string is valid", "data": { "name": "foo" }, "valid": true }, { "description": "null is valid", "data": { "name": null }, "valid": true }, { "description": "object is invalid", "data": { "name": { "name": null } }, "valid": false } ] }, { "description": "remote ref with ref to defs", "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "$ref": "ref-and-defs.json" }, "tests": [ { "description": "invalid", "data": { "bar": 1 }, "valid": false }, { "description": "valid", "data": { "bar": "a" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/allOf.json000640 000766 000024 00000017147 14163671560 024742 0ustar00etherstaff000000 000000 [ { "description": "allOf", "schema": { "allOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "allOf", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch second", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch first", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "allOf with base schema", "schema": { "properties": {"bar": {"type": "integer"}}, "required": ["bar"], "allOf" : [ { "properties": { "foo": {"type": "string"} }, "required": ["foo"] }, { "properties": { "baz": {"type": "null"} }, "required": ["baz"] } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch base schema", "data": {"foo": "quux", "baz": null}, "valid": false }, { "description": "mismatch first allOf", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second allOf", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "allOf simple types", "schema": { "allOf": [ {"maximum": 30}, {"minimum": 20} ] }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch one", "data": 35, "valid": false } ] }, { "description": "allOf with boolean schemas, all true", "schema": {"allOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "allOf with boolean schemas, some false", "schema": {"allOf": [true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with boolean schemas, all false", "schema": {"allOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with one empty schema", "schema": { "allOf": [ {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with two empty schemas", "schema": { "allOf": [ {}, {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with the first empty schema", "schema": { "allOf": [ {}, { "type": "number" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with the last empty schema", "schema": { "allOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "nested allOf, to check validation semantics", "schema": { "allOf": [ { "allOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "allOf combined with anyOf, oneOf", "schema": { "allOf": [ { "multipleOf": 2 } ], "anyOf": [ { "multipleOf": 3 } ], "oneOf": [ { "multipleOf": 5 } ] }, "tests": [ { "description": "allOf: false, anyOf: false, oneOf: false", "data": 1, "valid": false }, { "description": "allOf: false, anyOf: false, oneOf: true", "data": 5, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: false", "data": 3, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: true", "data": 15, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: false", "data": 2, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: true", "data": 10, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: false", "data": 6, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: true", "data": 30, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/format.json000640 000766 000024 00000047327 14163671560 025200 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-email format", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "regex format", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv4 format", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "idn-hostname format", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "hostname format", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date format", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "time format", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "json-pointer format", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "relative-json-pointer format", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri format", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "iri-reference format", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-reference format", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-template format", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uuid format", "schema": { "format": "uuid" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "duration format", "schema": { "format": "duration" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/ref.json000640 000766 000024 00000040566 14163671560 024462 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "prefixItems": [ {"type": "integer"}, {"$ref": "#/prefixItems/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "$defs": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/$defs/tilde~0field"}, "slash": {"$ref": "#/$defs/slash~1field"}, "percent": {"$ref": "#/$defs/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "$defs": { "a": {"type": "integer"}, "b": {"$ref": "#/$defs/a"}, "c": {"$ref": "#/$defs/b"} }, "$ref": "#/$defs/c" }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref applies alongside sibling keywords", "schema": { "$defs": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/$defs/reffed", "maxItems": 2 } } }, "tests": [ { "description": "ref valid, maxItems valid", "data": { "foo": [] }, "valid": true }, { "description": "ref valid, maxItems invalid", "data": { "foo": [1, 2, 3] }, "valid": false }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "remote ref, containing refs itself", "schema": { "$ref": "https://json-schema.org/draft/2020-12/schema" }, "tests": [ { "description": "remote ref valid", "data": {"minLength": 1}, "valid": true }, { "description": "remote ref invalid", "data": {"minLength": -1}, "valid": false } ] }, { "description": "property named $ref that is not a reference", "schema": { "properties": { "$ref": {"type": "string"} } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/$defs/is-string"} }, "$defs": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "$ref to boolean schema true", "schema": { "$ref": "#/$defs/bool", "$defs": { "bool": true } }, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "$ref to boolean schema false", "schema": { "$ref": "#/$defs/bool", "$defs": { "bool": false } }, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "Recursive references between schemas", "schema": { "$id": "http://localhost:1234/tree", "description": "tree of nodes", "type": "object", "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "required": ["meta", "nodes"], "$defs": { "node": { "$id": "http://localhost:1234/node", "description": "node", "type": "object", "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} }, "required": ["value"] } } }, "tests": [ { "description": "valid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": 1.1}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": true }, { "description": "invalid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": "string is invalid"}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": false } ] }, { "description": "refs with quote", "schema": { "properties": { "foo\"bar": {"$ref": "#/$defs/foo%22bar"} }, "$defs": { "foo\"bar": {"type": "number"} } }, "tests": [ { "description": "object with numbers is valid", "data": { "foo\"bar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\"bar": "1" }, "valid": false } ] }, { "description": "ref creates new scope when adjacent to keywords", "schema": { "$defs": { "A": { "unevaluatedProperties": false } }, "properties": { "prop1": { "type": "string" } }, "$ref": "#/$defs/A" }, "tests": [ { "description": "referenced subschema doesn't see annotations from properties", "data": { "prop1": "match" }, "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "$defs": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/$defs/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "do not evaluate the $ref inside the enum, definition exact match", "data": { "type": "string" }, "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/$defs/a_string" }, "valid": true } ] }, { "description": "refs with relative uris and defs", "schema": { "$id": "http://example.com/schema-relative-uri-defs1.json", "properties": { "foo": { "$id": "schema-relative-uri-defs2.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } }, "$ref": "schema-relative-uri-defs2.json" }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "relative refs with absolute uris and defs", "schema": { "$id": "http://example.com/schema-refs-absolute-uris-defs1.json", "properties": { "foo": { "$id": "http://example.com/schema-refs-absolute-uris-defs2.json", "$defs": { "inner": { "properties": { "bar": { "type": "string" } } } }, "$ref": "#/$defs/inner" } }, "$ref": "schema-refs-absolute-uris-defs2.json" }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "$id must be resolved against nearest parent, not just immediate parent", "schema": { "$id": "http://example.com/a.json", "$defs": { "x": { "$id": "http://example.com/b/c.json", "not": { "$defs": { "y": { "$id": "d.json", "type": "number" } } } } }, "allOf": [ { "$ref": "http://example.com/b/d.json" } ] }, "tests": [ { "description": "number should pass", "data": 1, "valid": true }, { "description": "non-number should fail", "data": "a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/maximum.json000640 000766 000024 00000002704 14163671560 025353 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/minLength.json000640 000766 000024 00000001566 14163671560 025630 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/maxItems.json000640 000766 000024 00000001302 14163671560 025456 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/contains.json000640 000766 000024 00000010272 14163671560 025513 0ustar00etherstaff000000 000000 [ { "description": "contains keyword validation", "schema": { "contains": {"minimum": 5} }, "tests": [ { "description": "array with item matching schema (5) is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with item matching schema (6) is valid", "data": [3, 4, 6], "valid": true }, { "description": "array with two items matching schema (5, 6) is valid", "data": [3, 4, 5, 6], "valid": true }, { "description": "array without items matching schema is invalid", "data": [2, 3, 4], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "not array is valid", "data": {}, "valid": true } ] }, { "description": "contains keyword with const keyword", "schema": { "contains": { "const": 5 } }, "tests": [ { "description": "array with item 5 is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with two items 5 is valid", "data": [3, 4, 5, 5], "valid": true }, { "description": "array without item 5 is invalid", "data": [1, 2, 3, 4], "valid": false } ] }, { "description": "contains keyword with boolean schema true", "schema": {"contains": true}, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] }, { "description": "contains keyword with boolean schema false", "schema": {"contains": false}, "tests": [ { "description": "any non-empty array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "non-arrays are valid", "data": "contains does not apply to strings", "valid": true } ] }, { "description": "items + contains", "schema": { "items": { "multipleOf": 2 }, "contains": { "multipleOf": 3 } }, "tests": [ { "description": "matches items, does not match contains", "data": [ 2, 4, 8 ], "valid": false }, { "description": "does not match items, matches contains", "data": [ 3, 6, 9 ], "valid": false }, { "description": "matches both items and contains", "data": [ 6, 12 ], "valid": true }, { "description": "matches neither items nor contains", "data": [ 1, 5 ], "valid": false } ] }, { "description": "contains with false if subschema", "schema": { "contains": { "if": false, "else": true } }, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/dynamicRef.json000640 000766 000024 00000050137 14163671560 025762 0ustar00etherstaff000000 000000 [ { "description": "A $dynamicRef to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor", "schema": { "$id": "https://test.json-schema.org/dynamicRef-dynamicAnchor-same-schema/root", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $dynamicRef to an $anchor in the same schema resource should behave like a normal $ref to an $anchor", "schema": { "$id": "https://test.json-schema.org/dynamicRef-anchor-same-schema/root", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "foo": { "$anchor": "items", "type": "string" } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $ref to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor", "schema": { "$id": "https://test.json-schema.org/ref-dynamicAnchor-same-schema/root", "type": "array", "items": { "$ref": "#items" }, "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $dynamicRef should resolve to the first $dynamicAnchor still in scope that is encountered when the schema is evaluated", "schema": { "$id": "https://test.json-schema.org/typical-dynamic-resolution/root", "$ref": "list", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to satisfy the bookending requirement", "$dynamicAnchor": "items" } } } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "A $dynamicRef with intermediate scopes that don't include a matching $dynamicAnchor should not affect dynamic scope resolution", "schema": { "$id": "https://test.json-schema.org/dynamic-resolution-with-intermediate-scopes/root", "$ref": "intermediate-scope", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "intermediate-scope": { "$id": "intermediate-scope", "$ref": "list" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to satisfy the bookending requirement", "$dynamicAnchor": "items" } } } } }, "tests": [ { "description": "An array of strings is valid", "data": ["foo", "bar"], "valid": true }, { "description": "An array containing non-strings is invalid", "data": ["foo", 42], "valid": false } ] }, { "description": "An $anchor with the same name as a $dynamicAnchor should not be used for dynamic scope resolution", "schema": { "$id": "https://test.json-schema.org/dynamic-resolution-ignores-anchors/root", "$ref": "list", "$defs": { "foo": { "$anchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to satisfy the bookending requirement", "$dynamicAnchor": "items" } } } } }, "tests": [ { "description": "Any array is valid", "data": ["foo", 42], "valid": true } ] }, { "description": "A $dynamicRef without a matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor", "schema": { "$id": "https://test.json-schema.org/dynamic-resolution-without-bookend/root", "$ref": "list", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to give the reference somewhere to resolve to when it behaves like $ref", "$anchor": "items" } } } } }, "tests": [ { "description": "Any array is valid", "data": ["foo", 42], "valid": true } ] }, { "description": "A $dynamicRef with a non-matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor", "schema": { "$id": "https://test.json-schema.org/unmatched-dynamic-anchor/root", "$ref": "list", "$defs": { "foo": { "$dynamicAnchor": "items", "type": "string" }, "list": { "$id": "list", "type": "array", "items": { "$dynamicRef": "#items" }, "$defs": { "items": { "$comment": "This is only needed to give the reference somewhere to resolve to when it behaves like $ref", "$anchor": "items", "$dynamicAnchor": "foo" } } } } }, "tests": [ { "description": "Any array is valid", "data": ["foo", 42], "valid": true } ] }, { "description": "A $dynamicRef that initially resolves to a schema with a matching $dynamicAnchor should resolve to the first $dynamicAnchor in the dynamic scope", "schema": { "$id": "https://test.json-schema.org/relative-dynamic-reference/root", "$dynamicAnchor": "meta", "type": "object", "properties": { "foo": { "const": "pass" } }, "$ref": "extended", "$defs": { "extended": { "$id": "extended", "$dynamicAnchor": "meta", "type": "object", "properties": { "bar": { "$ref": "bar" } } }, "bar": { "$id": "bar", "type": "object", "properties": { "baz": { "$dynamicRef": "extended#meta" } } } } }, "tests": [ { "description": "The recursive part is valid against the root", "data": { "foo": "pass", "bar": { "baz": { "foo": "pass" } } }, "valid": true }, { "description": "The recursive part is not valid against the root", "data": { "foo": "pass", "bar": { "baz": { "foo": "fail" } } }, "valid": false } ] }, { "description": "A $dynamicRef that initially resolves to a schema without a matching $dynamicAnchor should behave like a normal $ref to $anchor", "schema": { "$id": "https://test.json-schema.org/relative-dynamic-reference-without-bookend/root", "$dynamicAnchor": "meta", "type": "object", "properties": { "foo": { "const": "pass" } }, "$ref": "extended", "$defs": { "extended": { "$id": "extended", "$anchor": "meta", "type": "object", "properties": { "bar": { "$ref": "bar" } } }, "bar": { "$id": "bar", "type": "object", "properties": { "baz": { "$dynamicRef": "extended#meta" } } } } }, "tests": [ { "description": "The recursive part doesn't need to validate against the root", "data": { "foo": "pass", "bar": { "baz": { "foo": "fail" } } }, "valid": true } ] }, { "description": "multiple dynamic paths to the $dynamicRef keyword", "schema": { "$id": "https://test.json-schema.org/dynamic-ref-with-multiple-paths/main", "$defs": { "inner": { "$id": "inner", "$dynamicAnchor": "foo", "title": "inner", "additionalProperties": { "$dynamicRef": "#foo" } } }, "if": { "propertyNames": { "pattern": "^[a-m]" } }, "then": { "title": "any type of node", "$id": "anyLeafNode", "$dynamicAnchor": "foo", "$ref": "inner" }, "else": { "title": "integer node", "$id": "integerNode", "$dynamicAnchor": "foo", "type": [ "object", "integer" ], "$ref": "inner" } }, "tests": [ { "description": "recurse to anyLeafNode - floats are allowed", "data": { "alpha": 1.1 }, "valid": true }, { "description": "recurse to integerNode - floats are not allowed", "data": { "november": 1.1 }, "valid": false } ] }, { "description": "after leaving a dynamic scope, it should not be used by a $dynamicRef", "schema": { "$id": "https://test.json-schema.org/dynamic-ref-leaving-dynamic-scope/main", "if": { "$id": "first_scope", "$defs": { "thingy": { "$comment": "this is first_scope#thingy", "$dynamicAnchor": "thingy", "type": "number" } } }, "then": { "$id": "second_scope", "$ref": "start", "$defs": { "thingy": { "$comment": "this is second_scope#thingy, the final destination of the $dynamicRef", "$dynamicAnchor": "thingy", "type": "null" } } }, "$defs": { "start": { "$comment": "this is the landing spot from $ref", "$id": "start", "$dynamicRef": "inner_scope#thingy" }, "thingy": { "$comment": "this is the first stop for the $dynamicRef", "$id": "inner_scope", "$dynamicAnchor": "thingy", "type": "string" } } }, "tests": [ { "description": "string matches /$defs/thingy, but the $dynamicRef does not stop here", "data": "a string", "valid": false }, { "description": "first_scope is not in dynamic scope for the $dynamicRef", "data": 42, "valid": false }, { "description": "/then/$defs/thingy is the final stop for the $dynamicRef", "data": null, "valid": true } ] }, { "description": "strict-tree schema, guards against misspelled properties", "schema": { "$id": "http://localhost:1234/strict-tree.json", "$dynamicAnchor": "node", "$ref": "tree.json", "unevaluatedProperties": false }, "tests": [ { "description": "instance with misspelled field", "data": { "children": [{ "daat": 1 }] }, "valid": false }, { "description": "instance with correct field", "data": { "children": [{ "data": 1 }] }, "valid": true } ] }, { "description": "tests for implementation dynamic anchor and reference link", "schema": { "$id": "http://localhost:1234/strict-extendible.json", "$ref": "extendible-dynamic-ref.json", "$defs": { "elements": { "$dynamicAnchor": "elements", "properties": { "a": true }, "required": ["a"], "additionalProperties": false } } }, "tests": [ { "description": "incorrect parent schema", "data": { "a": true }, "valid": false }, { "description": "incorrect extended schema", "data": { "elements": [ { "b": 1 } ] }, "valid": false }, { "description": "correct extended schema", "data": { "elements": [ { "a": 1 } ] }, "valid": true } ] }, { "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.", "schema": { "$id": "http://localhost:1234/strict-extendible-allof-defs-first.json", "allOf": [ { "$ref": "extendible-dynamic-ref.json" }, { "$defs": { "elements": { "$dynamicAnchor": "elements", "properties": { "a": true }, "required": ["a"], "additionalProperties": false } } } ] }, "tests": [ { "description": "incorrect parent schema", "data": { "a": true }, "valid": false }, { "description": "incorrect extended schema", "data": { "elements": [ { "b": 1 } ] }, "valid": false }, { "description": "correct extended schema", "data": { "elements": [ { "a": 1 } ] }, "valid": true } ] }, { "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.", "schema": { "$id": "http://localhost:1234/strict-extendible-allof-ref-first.json", "allOf": [ { "$defs": { "elements": { "$dynamicAnchor": "elements", "properties": { "a": true }, "required": ["a"], "additionalProperties": false } } }, { "$ref": "extendible-dynamic-ref.json" } ] }, "tests": [ { "description": "incorrect parent schema", "data": { "a": true }, "valid": false }, { "description": "incorrect extended schema", "data": { "elements": [ { "b": 1 } ] }, "valid": false }, { "description": "correct extended schema", "data": { "elements": [ { "a": 1 } ] }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/refOfUnknownKeyword.json000640 000766 000024 00000002214 14163671560 031505 0ustar00etherstaff000000 000000 [ { "description": "reference of a root arbitrary keyword ", "schema": { "unknown-keyword": {"type": "integer"}, "properties": { "bar": {"$ref": "#/unknown-keyword"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "reference of an arbitrary keyword of a sub-schema", "schema": { "properties": { "foo": {"unknown-keyword": {"type": "integer"}}, "bar": {"$ref": "#/properties/foo/unknown-keyword"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/bignum.json000640 000766 000024 00000005361 14163671560 027006 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": { "type": "integer" }, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true }, { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": { "type": "number" }, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true }, { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": { "type": "string" }, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": { "maximum": 18446744073709551615 }, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "exclusiveMaximum": 972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": { "minimum": -18446744073709551615 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "exclusiveMinimum": -972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format-assertion.json000640 000766 000024 00000002534 14163671560 031021 0ustar00etherstaff000000 000000 [ { "description": "schema that uses custom metaschema with format-assertion: false", "schema": { "$id": "https://schema/using/format-assertion/false", "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json", "format": "ipv4" }, "tests": [ { "description": "format-assertion: false: valid string", "data": "127.0.0.1", "valid": true }, { "description": "format-assertion: false: invalid string", "data": "not-an-ipv4", "valid": false } ] }, { "description": "schema that uses custom metaschema with format-assertion: true", "schema": { "$id": "https://schema/using/format-assertion/true", "$schema": "http://localhost:1234/draft2020-12/format-assertion-true.json", "format": "ipv4" }, "tests": [ { "description": "format-assertion: true: valid string", "data": "127.0.0.1", "valid": true }, { "description": "format-assertion: true: invalid string", "data": "not-an-ipv4", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/unicode.json000644 000766 000024 00000000002 14163671560 027142 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 030206 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/000770 000766 000024 00000000000 14163671560 026116 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/float-overflow.json000640 000766 000024 00000000551 14163671560 030467 0ustar00etherstaff000000 000000 [ { "description": "all integers are multiples of 0.5, if overflow is handled", "schema": {"type": "integer", "multipleOf": 0.5}, "tests": [ { "description": "valid if optional overflow handling is implemented", "data": 1e308, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/ecmascript-regex.json000640 000766 000024 00000044205 14163671560 030767 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { "type": "string", "pattern": "^abc$" }, "tests": [ { "description": "matches in Python, but should not in jsonschema", "data": "abc\\n", "valid": false }, { "description": "should match", "data": "abc", "valid": true } ] }, { "description": "ECMA 262 regex converts \\t to horizontal tab", "schema": { "type": "string", "pattern": "^\\t$" }, "tests": [ { "description": "does not match", "data": "\\t", "valid": false }, { "description": "matches", "data": "\u0009", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and upper letter", "schema": { "type": "string", "pattern": "^\\cC$" }, "tests": [ { "description": "does not match", "data": "\\cC", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and lower letter", "schema": { "type": "string", "pattern": "^\\cc$" }, "tests": [ { "description": "does not match", "data": "\\cc", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 \\d matches ascii digits only", "schema": { "type": "string", "pattern": "^\\d$" }, "tests": [ { "description": "ASCII zero matches", "data": "0", "valid": true }, { "description": "NKO DIGIT ZERO does not match (unlike e.g. Python)", "data": "߀", "valid": false }, { "description": "NKO DIGIT ZERO (as \\u escape) does not match", "data": "\u07c0", "valid": false } ] }, { "description": "ECMA 262 \\D matches everything but ascii digits", "schema": { "type": "string", "pattern": "^\\D$" }, "tests": [ { "description": "ASCII zero does not match", "data": "0", "valid": false }, { "description": "NKO DIGIT ZERO matches (unlike e.g. Python)", "data": "߀", "valid": true }, { "description": "NKO DIGIT ZERO (as \\u escape) matches", "data": "\u07c0", "valid": true } ] }, { "description": "ECMA 262 \\w matches ascii letters only", "schema": { "type": "string", "pattern": "^\\w$" }, "tests": [ { "description": "ASCII 'a' matches", "data": "a", "valid": true }, { "description": "latin-1 e-acute does not match (unlike e.g. Python)", "data": "é", "valid": false } ] }, { "description": "ECMA 262 \\W matches everything but ascii letters", "schema": { "type": "string", "pattern": "^\\W$" }, "tests": [ { "description": "ASCII 'a' does not match", "data": "a", "valid": false }, { "description": "latin-1 e-acute matches (unlike e.g. Python)", "data": "é", "valid": true } ] }, { "description": "ECMA 262 \\s matches whitespace", "schema": { "type": "string", "pattern": "^\\s$" }, "tests": [ { "description": "ASCII space matches", "data": " ", "valid": true }, { "description": "Character tabulation matches", "data": "\t", "valid": true }, { "description": "Line tabulation matches", "data": "\u000b", "valid": true }, { "description": "Form feed matches", "data": "\u000c", "valid": true }, { "description": "latin-1 non-breaking-space matches", "data": "\u00a0", "valid": true }, { "description": "zero-width whitespace matches", "data": "\ufeff", "valid": true }, { "description": "line feed matches (line terminator)", "data": "\u000a", "valid": true }, { "description": "paragraph separator matches (line terminator)", "data": "\u2029", "valid": true }, { "description": "EM SPACE matches (Space_Separator)", "data": "\u2003", "valid": true }, { "description": "Non-whitespace control does not match", "data": "\u0001", "valid": false }, { "description": "Non-whitespace does not match", "data": "\u2013", "valid": false } ] }, { "description": "ECMA 262 \\S matches everything but whitespace", "schema": { "type": "string", "pattern": "^\\S$" }, "tests": [ { "description": "ASCII space does not match", "data": " ", "valid": false }, { "description": "Character tabulation does not match", "data": "\t", "valid": false }, { "description": "Line tabulation does not match", "data": "\u000b", "valid": false }, { "description": "Form feed does not match", "data": "\u000c", "valid": false }, { "description": "latin-1 non-breaking-space does not match", "data": "\u00a0", "valid": false }, { "description": "zero-width whitespace does not match", "data": "\ufeff", "valid": false }, { "description": "line feed does not match (line terminator)", "data": "\u000a", "valid": false }, { "description": "paragraph separator does not match (line terminator)", "data": "\u2029", "valid": false }, { "description": "EM SPACE does not match (Space_Separator)", "data": "\u2003", "valid": false }, { "description": "Non-whitespace control matches", "data": "\u0001", "valid": true }, { "description": "Non-whitespace matches", "data": "\u2013", "valid": true } ] }, { "description": "unicode semantics should be used for all pattern matching", "schema": { "pattern": "\\p{Letter}cole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters", "schema": { "pattern": "\\wcole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "pattern": "[a-z]cole" }, "tests": [ { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "ascii characters match", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true } ] }, { "description": "\\d in pattern matches [0-9], not unicode digits", "schema": { "pattern": "^\\d+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "pattern": "^\\p{digit}+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": true } ] }, { "description": "unicode semantics should be used for all patternProperties matching", "schema": { "type": "object", "patternProperties": { "\\p{Letter}cole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": true }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": true }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters", "schema": { "type": "object", "patternProperties": { "\\wcole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "type": "object", "patternProperties": { "[a-z]cole": true }, "additionalProperties": false }, "tests": [ { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "ascii characters match", "data": { "l'ecole": "pas de vraie vie" }, "valid": true } ] }, { "description": "\\d in patternProperties matches [0-9], not unicode digits", "schema": { "type": "object", "patternProperties": { "^\\d+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "type": "object", "patternProperties": { "^\\p{digit}+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/date.json000640 000766 000024 00000016426 14163671560 027736 0ustar00etherstaff000000 000000 [ { "description": "validation of date strings", "schema": { "format": "date" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date string", "data": "1963-06-19", "valid": true }, { "description": "a valid date string with 31 days in January", "data": "2020-01-31", "valid": true }, { "description": "a invalid date string with 32 days in January", "data": "2020-01-32", "valid": false }, { "description": "a valid date string with 28 days in February (normal)", "data": "2021-02-28", "valid": true }, { "description": "a invalid date string with 29 days in February (normal)", "data": "2021-02-29", "valid": false }, { "description": "a valid date string with 29 days in February (leap)", "data": "2020-02-29", "valid": true }, { "description": "a invalid date string with 30 days in February (leap)", "data": "2020-02-30", "valid": false }, { "description": "a valid date string with 31 days in March", "data": "2020-03-31", "valid": true }, { "description": "a invalid date string with 32 days in March", "data": "2020-03-32", "valid": false }, { "description": "a valid date string with 30 days in April", "data": "2020-04-30", "valid": true }, { "description": "a invalid date string with 31 days in April", "data": "2020-04-31", "valid": false }, { "description": "a valid date string with 31 days in May", "data": "2020-05-31", "valid": true }, { "description": "a invalid date string with 32 days in May", "data": "2020-05-32", "valid": false }, { "description": "a valid date string with 30 days in June", "data": "2020-06-30", "valid": true }, { "description": "a invalid date string with 31 days in June", "data": "2020-06-31", "valid": false }, { "description": "a valid date string with 31 days in July", "data": "2020-07-31", "valid": true }, { "description": "a invalid date string with 32 days in July", "data": "2020-07-32", "valid": false }, { "description": "a valid date string with 31 days in August", "data": "2020-08-31", "valid": true }, { "description": "a invalid date string with 32 days in August", "data": "2020-08-32", "valid": false }, { "description": "a valid date string with 30 days in September", "data": "2020-09-30", "valid": true }, { "description": "a invalid date string with 31 days in September", "data": "2020-09-31", "valid": false }, { "description": "a valid date string with 31 days in October", "data": "2020-10-31", "valid": true }, { "description": "a invalid date string with 32 days in October", "data": "2020-10-32", "valid": false }, { "description": "a valid date string with 30 days in November", "data": "2020-11-30", "valid": true }, { "description": "a invalid date string with 31 days in November", "data": "2020-11-31", "valid": false }, { "description": "a valid date string with 31 days in December", "data": "2020-12-31", "valid": true }, { "description": "a invalid date string with 32 days in December", "data": "2020-12-32", "valid": false }, { "description": "a invalid date string with invalid month", "data": "2020-13-01", "valid": false }, { "description": "an invalid date string", "data": "06/19/1963", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false }, { "description": "non-padded month dates are not valid", "data": "1998-1-20", "valid": false }, { "description": "non-padded day dates are not valid", "data": "1998-01-1", "valid": false }, { "description": "invalid month", "data": "1998-13-01", "valid": false }, { "description": "invalid month-day combination", "data": "1998-04-31", "valid": false }, { "description": "2021 is not a leap year", "data": "2021-02-29", "valid": false }, { "description": "2020 is a leap year", "data": "2020-02-29", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1963-06-1৪", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/json-pointer.json000640 000766 000024 00000015063 14163671560 031444 0ustar00etherstaff000000 000000 [ { "description": "validation of JSON-pointers (JSON String Representation)", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid JSON-pointer", "data": "/foo/bar~0/baz~1/%a", "valid": true }, { "description": "not a valid JSON-pointer (~ not escaped)", "data": "/foo/bar~", "valid": false }, { "description": "valid JSON-pointer with empty segment", "data": "/foo//bar", "valid": true }, { "description": "valid JSON-pointer with the last empty segment", "data": "/foo/bar/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #1", "data": "", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #2", "data": "/foo", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #3", "data": "/foo/0", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #4", "data": "/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #5", "data": "/a~1b", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #6", "data": "/c%d", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #7", "data": "/e^f", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #8", "data": "/g|h", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #9", "data": "/i\\j", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #10", "data": "/k\"l", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #11", "data": "/ ", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #12", "data": "/m~0n", "valid": true }, { "description": "valid JSON-pointer used adding to the last array position", "data": "/foo/-", "valid": true }, { "description": "valid JSON-pointer (- used as object member name)", "data": "/foo/-/bar", "valid": true }, { "description": "valid JSON-pointer (multiple escaped characters)", "data": "/~1~0~0~1~1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #1", "data": "/~1.1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #2", "data": "/~0.1", "valid": true }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #1", "data": "#", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #2", "data": "#/", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #3", "data": "#a", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #1", "data": "/~0~", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #2", "data": "/~0/~", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #1", "data": "/~2", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #2", "data": "/~-1", "valid": false }, { "description": "not a valid JSON-pointer (multiple characters not escaped)", "data": "/~~", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1", "data": "a", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2", "data": "0", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3", "data": "a/a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/idn-hostname.json000640 000766 000024 00000034641 14163671560 031406 0ustar00etherstaff000000 000000 [ { "description": "validation of internationalized host names", "schema": { "format": "idn-hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name (example.test in Hangul)", "data": "실례.테스트", "valid": true }, { "description": "illegal first char U+302E Hangul single dot tone mark", "data": "〮실례.테스트", "valid": false }, { "description": "contains illegal char U+302E Hangul single dot tone mark", "data": "실〮례.테스트", "valid": false }, { "description": "a host name with a component too long", "data": "실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실실례례테스트례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례례례례례례례례테스트례례례례례례례례례례례례테스트례례실례.테스트", "valid": false }, { "description": "invalid label, correct Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc3492#section-7.1", "data": "-> $1.00 <--", "valid": false }, { "description": "valid Chinese Punycode", "comment": "https://tools.ietf.org/html/rfc5890#section-2.3.2.1 https://tools.ietf.org/html/rfc5891#section-4.4", "data": "xn--ihqwcrb4cv8a8dqg056pqjye", "valid": true }, { "description": "invalid Punycode", "comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "xn--X", "valid": false }, { "description": "U-label contains \"--\" in the 3rd and 4th position", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1", "data": "XN--aa---o47jg78q", "valid": false }, { "description": "U-label starts with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello", "valid": false }, { "description": "U-label ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "hello-", "valid": false }, { "description": "U-label starts and ends with a dash", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1", "data": "-hello-", "valid": false }, { "description": "Begins with a Spacing Combining Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0903hello", "valid": false }, { "description": "Begins with a Nonspacing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0300hello", "valid": false }, { "description": "Begins with an Enclosing Mark", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2", "data": "\u0488hello", "valid": false }, { "description": "Exceptions that are PVALID, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u00df\u03c2\u0f0b\u3007", "valid": true }, { "description": "Exceptions that are PVALID, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u06fd\u06fe", "valid": true }, { "description": "Exceptions that are DISALLOWED, right-to-left chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6", "data": "\u0640\u07fa", "valid": false }, { "description": "Exceptions that are DISALLOWED, left-to-right chars", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start", "data": "\u3031\u3032\u3033\u3034\u3035\u302e\u302f\u303b", "valid": false }, { "description": "MIDDLE DOT with no preceding 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "a\u00b7l", "valid": false }, { "description": "MIDDLE DOT with nothing preceding", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "\u00b7l", "valid": false }, { "description": "MIDDLE DOT with no following 'l'", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7a", "valid": false }, { "description": "MIDDLE DOT with nothing following", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7", "valid": false }, { "description": "MIDDLE DOT with surrounding 'l's", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3", "data": "l\u00b7l", "valid": true }, { "description": "Greek KERAIA not followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375S", "valid": false }, { "description": "Greek KERAIA not followed by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375", "valid": false }, { "description": "Greek KERAIA followed by Greek", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4", "data": "\u03b1\u0375\u03b2", "valid": true }, { "description": "Hebrew GERESH not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "A\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05f3\u05d1", "valid": false }, { "description": "Hebrew GERESH preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5", "data": "\u05d0\u05f3\u05d1", "valid": true }, { "description": "Hebrew GERSHAYIM not preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "A\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05f4\u05d1", "valid": false }, { "description": "Hebrew GERSHAYIM preceded by Hebrew", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6", "data": "\u05d0\u05f4\u05d1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "def\u30fbabc", "valid": false }, { "description": "KATAKANA MIDDLE DOT with no other characters", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb", "valid": false }, { "description": "KATAKANA MIDDLE DOT with Hiragana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u3041", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Katakana", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u30a1", "valid": true }, { "description": "KATAKANA MIDDLE DOT with Han", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7", "data": "\u30fb\u4e08", "valid": true }, { "description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0660\u06f0", "valid": false }, { "description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8", "data": "\u0628\u0660\u0628", "valid": true }, { "description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9", "data": "\u06f00", "valid": true }, { "description": "ZERO WIDTH JOINER not preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER not preceded by anything", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u200d\u0937", "valid": false }, { "description": "ZERO WIDTH JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf", "data": "\u0915\u094d\u200d\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER preceded by Virama", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1", "data": "\u0915\u094d\u200c\u0937", "valid": true }, { "description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp", "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement", "data": "\u0628\u064a\u200c\u0628\u064a", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/uri.json000640 000766 000024 00000007165 14163671560 027620 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid URL with anchor tag and parentheses", "data": "http://foo.com/blah_(wikipedia)_blah#cite-1", "valid": true }, { "description": "a valid URL with URL-encoded stuff", "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid puny-coded URL ", "data": "http://xn--nw2a.xn--j6w193g/", "valid": true }, { "description": "a valid URL with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid URL based on IPv4", "data": "http://223.255.255.254", "valid": true }, { "description": "a valid URL with ftp scheme", "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt", "valid": true }, { "description": "a valid URL for a simple text file", "data": "http://www.ietf.org/rfc/rfc2396.txt", "valid": true }, { "description": "a valid URL ", "data": "ldap://[2001:db8::7]/c=GB?objectClass?one", "valid": true }, { "description": "a valid mailto URI", "data": "mailto:John.Doe@example.com", "valid": true }, { "description": "a valid newsgroup URI", "data": "news:comp.infosystems.www.servers.unix", "valid": true }, { "description": "a valid tel URI", "data": "tel:+1-816-555-1212", "valid": true }, { "description": "a valid URN", "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid relative URI Reference", "data": "/abc", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false }, { "description": "an invalid URI with spaces", "data": "http:// shouldfail.com", "valid": false }, { "description": "an invalid URI with spaces and missing scheme", "data": ":// should fail", "valid": false }, { "description": "an invalid URI with comma in scheme", "data": "bar,baz:foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/uri-template.json000640 000766 000024 00000003431 14163671560 031421 0ustar00etherstaff000000 000000 [ { "description": "format: uri-template", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid uri-template", "data": "http://example.com/dictionary/{term:1}/{term}", "valid": true }, { "description": "an invalid uri-template", "data": "http://example.com/dictionary/{term:1}/{term", "valid": false }, { "description": "a valid uri-template without variables", "data": "http://example.com/dictionary", "valid": true }, { "description": "a valid relative uri-template", "data": "dictionary/{term:1}/{term}", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/iri-reference.json000640 000766 000024 00000004312 14163671560 031527 0ustar00etherstaff000000 000000 [ { "description": "validation of IRI References", "schema": { "format": "iri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid protocol-relative IRI Reference", "data": "//ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid relative IRI Reference", "data": "/âππ", "valid": true }, { "description": "an invalid IRI Reference", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "a valid IRI Reference", "data": "âππ", "valid": true }, { "description": "a valid IRI fragment", "data": "#ƒrägmênt", "valid": true }, { "description": "an invalid IRI fragment", "data": "#ƒräg\\mênt", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/iri.json000640 000766 000024 00000005324 14163671560 027577 0ustar00etherstaff000000 000000 [ { "description": "validation of IRIs", "schema": { "format": "iri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IRI with anchor tag", "data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx", "valid": true }, { "description": "a valid IRI with anchor tag and parentheses", "data": "http://ƒøø.com/blah_(wîkïpédiå)_blah#ßité-1", "valid": true }, { "description": "a valid IRI with URL-encoded stuff", "data": "http://ƒøø.ßår/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid IRI with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid IRI based on IPv6", "data": "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]", "valid": true }, { "description": "an invalid IRI based on IPv6", "data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334", "valid": false }, { "description": "an invalid relative IRI Reference", "data": "/abc", "valid": false }, { "description": "an invalid IRI", "data": "\\\\WINDOWS\\filëßåré", "valid": false }, { "description": "an invalid IRI though valid IRI reference", "data": "âππ", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/ipv4.json000640 000766 000024 00000005415 14163671560 027677 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false }, { "description": "an IP address without 4 components", "data": "127.0", "valid": false }, { "description": "an IP address as an integer", "data": "0x7f000001", "valid": false }, { "description": "an IP address as an integer (decimal)", "data": "2130706433", "valid": false }, { "description": "leading zeroes should be rejected, as they are treated as octals", "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", "data": "087.10.0.1", "valid": false }, { "description": "value without leading zero is valid", "data": "87.10.0.1", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1২7.0.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/uri-reference.json000640 000766 000024 00000004237 14163671560 031551 0ustar00etherstaff000000 000000 [ { "description": "validation of URI References", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid relative URI Reference", "data": "/abc", "valid": true }, { "description": "an invalid URI Reference", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "a valid URI Reference", "data": "abc", "valid": true }, { "description": "a valid URI fragment", "data": "#fragment", "valid": true }, { "description": "an invalid URI fragment", "data": "#frag\\ment", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/time.json000640 000766 000024 00000015211 14163671560 027746 0ustar00etherstaff000000 000000 [ { "description": "validation of time strings", "schema": { "format": "time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid time string", "data": "08:30:06Z", "valid": true }, { "description": "a valid time string with leap second, Zulu", "data": "23:59:60Z", "valid": true }, { "description": "invalid leap second, Zulu (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "invalid leap second, Zulu (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "valid leap second, zero time-offset", "data": "23:59:60+00:00", "valid": true }, { "description": "invalid leap second, zero time-offset (wrong hour)", "data": "22:59:60+00:00", "valid": false }, { "description": "invalid leap second, zero time-offset (wrong minute)", "data": "23:58:60+00:00", "valid": false }, { "description": "valid leap second, positive time-offset", "data": "01:29:60+01:30", "valid": true }, { "description": "valid leap second, large positive time-offset", "data": "23:29:60+23:30", "valid": true }, { "description": "invalid leap second, positive time-offset (wrong hour)", "data": "23:59:60+01:00", "valid": false }, { "description": "invalid leap second, positive time-offset (wrong minute)", "data": "23:59:60+00:30", "valid": false }, { "description": "valid leap second, negative time-offset", "data": "15:59:60-08:00", "valid": true }, { "description": "valid leap second, large negative time-offset", "data": "00:29:60-23:30", "valid": true }, { "description": "invalid leap second, negative time-offset (wrong hour)", "data": "23:59:60-01:00", "valid": false }, { "description": "invalid leap second, negative time-offset (wrong minute)", "data": "23:59:60-00:30", "valid": false }, { "description": "a valid time string with second fraction", "data": "23:20:50.52Z", "valid": true }, { "description": "a valid time string with precise second fraction", "data": "08:30:06.283185Z", "valid": true }, { "description": "a valid time string with plus offset", "data": "08:30:06+00:20", "valid": true }, { "description": "a valid time string with minus offset", "data": "08:30:06-08:00", "valid": true }, { "description": "a valid time string with case-insensitive Z", "data": "08:30:06z", "valid": true }, { "description": "an invalid time string with invalid hour", "data": "24:00:00Z", "valid": false }, { "description": "an invalid time string with invalid minute", "data": "00:60:00Z", "valid": false }, { "description": "an invalid time string with invalid second", "data": "00:00:61Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong hour)", "data": "22:59:60Z", "valid": false }, { "description": "an invalid time string with invalid leap second (wrong minute)", "data": "23:58:60Z", "valid": false }, { "description": "an invalid time string with invalid time numoffset hour", "data": "01:02:03+24:00", "valid": false }, { "description": "an invalid time string with invalid time numoffset minute", "data": "01:02:03+00:60", "valid": false }, { "description": "an invalid time string with invalid time with both Z and numoffset", "data": "01:02:03Z+00:30", "valid": false }, { "description": "an invalid offset indicator", "data": "08:30:06 PST", "valid": false }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "01:01:01,1111", "valid": false }, { "description": "no time offset", "data": "12:00:00", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1২:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/ipv6.json000640 000766 000024 00000015440 14163671560 027700 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "trailing 4 hex symbols is valid", "data": "::abef", "valid": true }, { "description": "trailing 5 hex symbols is invalid", "data": "::abcef", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::42:ff:1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "missing leading octet is invalid", "data": ":2:3:4:5:6:7:8", "valid": false }, { "description": "missing trailing octet is invalid", "data": "1:2:3:4:5:6:7:", "valid": false }, { "description": "missing leading octet with omitted octets later", "data": ":2:3:4::8", "valid": false }, { "description": "single set of double colons in the middle is valid", "data": "1:d6::42", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false }, { "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", "data": "::ffff:192.168.0.1", "valid": true }, { "description": "triple colons is invalid", "data": "1:2:3:4:5:::8", "valid": false }, { "description": "8 octets", "data": "1:2:3:4:5:6:7:8", "valid": true }, { "description": "insufficient octets without double colons", "data": "1:2:3:4:5:6:7", "valid": false }, { "description": "no colons is invalid", "data": "1", "valid": false }, { "description": "ipv4 is not ipv6", "data": "127.0.0.1", "valid": false }, { "description": "ipv4 segment must have 4 octets", "data": "1:2:3:4:1.2.3", "valid": false }, { "description": "leading whitespace is invalid", "data": " ::1", "valid": false }, { "description": "trailing whitespace is invalid", "data": "::1 ", "valid": false }, { "description": "netmask is not a part of ipv6 address", "data": "fe80::/64", "valid": false }, { "description": "zone id is not a part of ipv6 address", "data": "fe80::a%eth1", "valid": false }, { "description": "a long valid ipv6", "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", "valid": true }, { "description": "a long invalid ipv6, below length limit, first", "data": "100:100:100:100:100:100:255.255.255.255.255", "valid": false }, { "description": "a long invalid ipv6, below length limit, second", "data": "100:100:100:100:100:100:100:255.255.255.255", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1:2:3:4:5:6:7:৪", "valid": false }, { "description": "non-ascii digits should be rejected in the ipv4 portion also", "data": "1:2::192.16৪.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/hostname.json000640 000766 000024 00000006224 14163671560 030632 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a valid punycoded IDN hostname", "data": "xn--4gbwdl.xn--wgbh1c", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/uuid.json000640 000766 000024 00000005301 14163671560 027755 0ustar00etherstaff000000 000000 [ { "description": "uuid format", "schema": { "format": "uuid" }, "tests": [ { "description": "all upper-case", "data": "2EB8AA08-AA98-11EA-B4AA-73B441D16380", "valid": true }, { "description": "all lower-case", "data": "2eb8aa08-aa98-11ea-b4aa-73b441d16380", "valid": true }, { "description": "mixed case", "data": "2eb8aa08-AA98-11ea-B4Aa-73B441D16380", "valid": true }, { "description": "all zeroes is valid", "data": "00000000-0000-0000-0000-000000000000", "valid": true }, { "description": "wrong length", "data": "2eb8aa08-aa98-11ea-b4aa-73b441d1638", "valid": false }, { "description": "missing section", "data": "2eb8aa08-aa98-11ea-73b441d16380", "valid": false }, { "description": "bad characters (not hex)", "data": "2eb8aa08-aa98-11ea-b4ga-73b441d16380", "valid": false }, { "description": "no dashes", "data": "2eb8aa08aa9811eab4aa73b441d16380", "valid": false }, { "description": "too few dashes", "data": "2eb8aa08aa98-11ea-b4aa73b441d16380", "valid": false }, { "description": "too many dashes", "data": "2eb8-aa08-aa98-11ea-b4aa73b44-1d16380", "valid": false }, { "description": "dashes in the wrong spot", "data": "2eb8aa08aa9811eab4aa73b441d16380----", "valid": false }, { "description": "valid version 4", "data": "98d80576-482e-427f-8434-7f86890ab222", "valid": true }, { "description": "valid version 5", "data": "99c17cbb-656f-564a-940f-1a4568f03487", "valid": true }, { "description": "hypothetical version 6", "data": "99c17cbb-656f-664a-940f-1a4568f03487", "valid": true }, { "description": "hypothetical version 15", "data": "99c17cbb-656f-f64a-940f-1a4568f03487", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/email.json000640 000766 000024 00000005104 14163671560 030077 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/duration.json000640 000766 000024 00000007342 14163671560 030643 0ustar00etherstaff000000 000000 [ { "description": "validation of duration strings", "schema": { "format": "duration" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid duration string", "data": "P4DT12H30M5S", "valid": true }, { "description": "an invalid duration string", "data": "PT1D", "valid": false }, { "description": "no elements present", "data": "P", "valid": false }, { "description": "no time elements present", "data": "P1YT", "valid": false }, { "description": "no date or time elements present", "data": "PT", "valid": false }, { "description": "elements out of order", "data": "P2D1Y", "valid": false }, { "description": "missing time separator", "data": "P1D2H", "valid": false }, { "description": "time element in the date position", "data": "P2S", "valid": false }, { "description": "four years duration", "data": "P4Y", "valid": true }, { "description": "zero time, in seconds", "data": "PT0S", "valid": true }, { "description": "zero time, in days", "data": "P0D", "valid": true }, { "description": "one month duration", "data": "P1M", "valid": true }, { "description": "one minute duration", "data": "PT1M", "valid": true }, { "description": "one and a half days, in hours", "data": "PT36H", "valid": true }, { "description": "one and a half days, in days and hours", "data": "P1DT12H", "valid": true }, { "description": "two weeks", "data": "P2W", "valid": true }, { "description": "weeks cannot be combined with other units", "data": "P1Y2W", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "P২Y", "valid": false } ] } ] share/tests/draft2020-12/optional/format/relative-json-pointer.json000640 000766 000024 00000005040 14163671560 033170 0ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015[ { "description": "validation of Relative JSON Pointers (RJP)", "schema": { "format": "relative-json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid upwards RJP", "data": "1", "valid": true }, { "description": "a valid downwards RJP", "data": "0/foo/bar", "valid": true }, { "description": "a valid up and then down RJP, with array index", "data": "2/0/baz/1/zip", "valid": true }, { "description": "a valid RJP taking the member or index name", "data": "0#", "valid": true }, { "description": "an invalid RJP that is a valid JSON Pointer", "data": "/foo/bar", "valid": false }, { "description": "negative prefix", "data": "-1/foo/bar", "valid": false }, { "description": "## is not a valid json-pointer", "data": "0##", "valid": false }, { "description": "zero cannot be followed by other digits, plus json-pointer", "data": "01/a", "valid": false }, { "description": "zero cannot be followed by other digits, plus octothorpe", "data": "01#", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/date-time.json000640 000766 000024 00000011064 14163671560 030663 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "a valid date-time string without second fraction", "data": "1963-06-19T08:30:06Z", "valid": true }, { "description": "a valid date-time string with plus offset", "data": "1937-01-01T12:00:27.87+00:20", "valid": true }, { "description": "a valid date-time string with minus offset", "data": "1990-12-31T15:59:50.123-08:00", "valid": true }, { "description": "a valid date-time with a leap second, UTC", "data": "1998-12-31T23:59:60Z", "valid": true }, { "description": "a valid date-time with a leap second, with minus offset", "data": "1998-12-31T15:59:60.123-08:00", "valid": true }, { "description": "an invalid date-time past leap second, UTC", "data": "1998-12-31T23:59:61Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong minute, UTC", "data": "1998-12-31T23:58:60Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong hour, UTC", "data": "1998-12-31T22:59:60Z", "valid": false }, { "description": "an invalid day in date-time string", "data": "1990-02-31T15:59:59.123-08:00", "valid": false }, { "description": "an invalid offset in date-time string", "data": "1990-12-31T15:59:59-24:00", "valid": false }, { "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false }, { "description": "non-ascii digits should be rejected in the date portion", "data": "1963-06-1৪T00:00:00Z", "valid": false }, { "description": "non-ascii digits should be rejected in the time portion", "data": "1963-06-11T0৪:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/regex.json000640 000766 000024 00000002616 14163671560 030127 0ustar00etherstaff000000 000000 [ { "description": "validation of regular expressions", "schema": { "format": "regex" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid regular expression", "data": "([abc])+\\s+$", "valid": true }, { "description": "a regular expression with unclosed parens is invalid", "data": "^(abc]", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft2020-12/optional/format/idn-email.json000640 000766 000024 00000003354 14163671560 030654 0ustar00etherstaff000000 000000 [ { "description": "validation of an internationalized e-mail addresses", "schema": { "format": "idn-email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid idn e-mail (example@example.test in Hangul)", "data": "실례@실례.테스트", "valid": true }, { "description": "an invalid idn e-mail address", "data": "2962", "valid": false }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/uniqueItems.json000640 000766 000024 00000032740 14163671560 025553 0ustar00etherstaff000000 000000 [ { "description": "uniqueItems validation", "schema": {"uniqueItems": true}, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is invalid", "data": [1, 1], "valid": false }, { "description": "non-unique array of more than two integers is invalid", "data": [1, 2, 1], "valid": false }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": false }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of strings is valid", "data": ["foo", "bar", "baz"], "valid": true }, { "description": "non-unique array of strings is invalid", "data": ["foo", "bar", "foo"], "valid": false }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is invalid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": false }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is invalid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": false }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is invalid", "data": [["foo"], ["foo"]], "valid": false }, { "description": "non-unique array of more than two arrays is invalid", "data": [["foo"], ["bar"], ["foo"]], "valid": false }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "[1] and [true] are unique", "data": [[1], [true]], "valid": true }, { "description": "[0] and [false] are unique", "data": [[0], [false]], "valid": true }, { "description": "nested [1] and [true] are unique", "data": [[[1], "foo"], [[true], "foo"]], "valid": true }, { "description": "nested [0] and [false] are unique", "data": [[[0], "foo"], [[false], "foo"]], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1, "{}"], "valid": true }, { "description": "non-unique heterogeneous types are invalid", "data": [{}, [1], true, null, {}, 1], "valid": false }, { "description": "different objects are unique", "data": [{"a": 1, "b": 2}, {"a": 2, "b": 1}], "valid": true }, { "description": "objects are non-unique despite key order", "data": [{"a": 1, "b": 2}, {"b": 2, "a": 1}], "valid": false }, { "description": "{\"a\": false} and {\"a\": 0} are unique", "data": [{"a": false}, {"a": 0}], "valid": true }, { "description": "{\"a\": true} and {\"a\": 1} are unique", "data": [{"a": true}, {"a": 1}], "valid": true } ] }, { "description": "uniqueItems with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is not valid", "data": [false, true, "foo", "foo"], "valid": false }, { "description": "non-unique array extended from [true, false] is not valid", "data": [true, false, "foo", "foo"], "valid": false } ] }, { "description": "uniqueItems with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": true, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is not valid", "data": [false, false], "valid": false }, { "description": "[true, true] from items array is not valid", "data": [true, true], "valid": false }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] }, { "description": "uniqueItems=false validation", "schema": { "uniqueItems": false }, "tests": [ { "description": "unique array of integers is valid", "data": [1, 2], "valid": true }, { "description": "non-unique array of integers is valid", "data": [1, 1], "valid": true }, { "description": "numbers are unique if mathematically unequal", "data": [1.0, 1.00, 1], "valid": true }, { "description": "false is not equal to zero", "data": [0, false], "valid": true }, { "description": "true is not equal to one", "data": [1, true], "valid": true }, { "description": "unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "baz"}], "valid": true }, { "description": "non-unique array of objects is valid", "data": [{"foo": "bar"}, {"foo": "bar"}], "valid": true }, { "description": "unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : false}}} ], "valid": true }, { "description": "non-unique array of nested objects is valid", "data": [ {"foo": {"bar" : {"baz" : true}}}, {"foo": {"bar" : {"baz" : true}}} ], "valid": true }, { "description": "unique array of arrays is valid", "data": [["foo"], ["bar"]], "valid": true }, { "description": "non-unique array of arrays is valid", "data": [["foo"], ["foo"]], "valid": true }, { "description": "1 and true are unique", "data": [1, true], "valid": true }, { "description": "0 and false are unique", "data": [0, false], "valid": true }, { "description": "unique heterogeneous types are valid", "data": [{}, [1], true, null, 1], "valid": true }, { "description": "non-unique heterogeneous types are valid", "data": [{}, [1], true, null, {}, 1], "valid": true } ] }, { "description": "uniqueItems=false with an array of items", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "unique array extended from [false, true] is valid", "data": [false, true, "foo", "bar"], "valid": true }, { "description": "unique array extended from [true, false] is valid", "data": [true, false, "foo", "bar"], "valid": true }, { "description": "non-unique array extended from [false, true] is valid", "data": [false, true, "foo", "foo"], "valid": true }, { "description": "non-unique array extended from [true, false] is valid", "data": [true, false, "foo", "foo"], "valid": true } ] }, { "description": "uniqueItems=false with an array of items and additionalItems=false", "schema": { "items": [{"type": "boolean"}, {"type": "boolean"}], "uniqueItems": false, "additionalItems": false }, "tests": [ { "description": "[false, true] from items array is valid", "data": [false, true], "valid": true }, { "description": "[true, false] from items array is valid", "data": [true, false], "valid": true }, { "description": "[false, false] from items array is valid", "data": [false, false], "valid": true }, { "description": "[true, true] from items array is valid", "data": [true, true], "valid": true }, { "description": "extra items are invalid even if unique", "data": [false, true, null], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/minItems.json000640 000766 000024 00000001265 14163671560 025026 0ustar00etherstaff000000 000000 [ { "description": "minItems validation", "schema": {"minItems": 1}, "tests": [ { "description": "longer is valid", "data": [1, 2], "valid": true }, { "description": "exact length is valid", "data": [1], "valid": true }, { "description": "too short is invalid", "data": [], "valid": false }, { "description": "ignores non-arrays", "data": "", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/additionalProperties.json000640 000766 000024 00000007754 14163671560 027437 0ustar00etherstaff000000 000000 [ { "description": "additionalProperties being false does not allow other properties", "schema": { "properties": {"foo": {}, "bar": {}}, "patternProperties": { "^v": {} }, "additionalProperties": false }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobarbaz", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true }, { "description": "patternProperties are not additional properties", "data": {"foo":1, "vroom": 2}, "valid": true } ] }, { "description": "non-ASCII pattern with additionalProperties", "schema": { "patternProperties": {"^á": {}}, "additionalProperties": false }, "tests": [ { "description": "matching the pattern is valid", "data": {"ármányos": 2}, "valid": true }, { "description": "not matching the pattern is invalid", "data": {"élmény": 2}, "valid": false } ] }, { "description": "additionalProperties allows a schema which should validate", "schema": { "properties": {"foo": {}, "bar": {}}, "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "no additional properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "an additional valid property is valid", "data": {"foo" : 1, "bar" : 2, "quux" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1, "bar" : 2, "quux" : 12}, "valid": false } ] }, { "description": "additionalProperties can exist by itself", "schema": { "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "an additional valid property is valid", "data": {"foo" : true}, "valid": true }, { "description": "an additional invalid property is invalid", "data": {"foo" : 1}, "valid": false } ] }, { "description": "additionalProperties are allowed by default", "schema": {"properties": {"foo": {}, "bar": {}}}, "tests": [ { "description": "additional properties are allowed", "data": {"foo": 1, "bar": 2, "quux": true}, "valid": true } ] }, { "description": "additionalProperties should not look in applicators", "schema": { "allOf": [ {"properties": {"foo": {}}} ], "additionalProperties": {"type": "boolean"} }, "tests": [ { "description": "properties defined in allOf are not examined", "data": {"foo": 1, "bar": true}, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/dependencies.json000640 000766 000024 00000015334 14163671560 025671 0ustar00etherstaff000000 000000 [ { "description": "dependencies", "schema": { "dependencies": {"bar": ["foo"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependant", "data": {"foo": 1}, "valid": true }, { "description": "with dependency", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "missing dependency", "data": {"bar": 2}, "valid": false }, { "description": "ignores arrays", "data": ["bar"], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "dependencies with empty array", "schema": { "dependencies": {"bar": []} }, "tests": [ { "description": "empty object", "data": {}, "valid": true }, { "description": "object with one property", "data": {"bar": 2}, "valid": true }, { "description": "non-object is valid", "data": 1, "valid": true } ] }, { "description": "multiple dependencies", "schema": { "dependencies": {"quux": ["foo", "bar"]} }, "tests": [ { "description": "neither", "data": {}, "valid": true }, { "description": "nondependants", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "with dependencies", "data": {"foo": 1, "bar": 2, "quux": 3}, "valid": true }, { "description": "missing dependency", "data": {"foo": 1, "quux": 2}, "valid": false }, { "description": "missing other dependency", "data": {"bar": 1, "quux": 2}, "valid": false }, { "description": "missing both dependencies", "data": {"quux": 1}, "valid": false } ] }, { "description": "multiple dependencies subschema", "schema": { "dependencies": { "bar": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"} } } } }, "tests": [ { "description": "valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "no dependency", "data": {"foo": "quux"}, "valid": true }, { "description": "wrong type", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "wrong type other", "data": {"foo": 2, "bar": "quux"}, "valid": false }, { "description": "wrong type both", "data": {"foo": "quux", "bar": "quux"}, "valid": false } ] }, { "description": "dependencies with boolean subschemas", "schema": { "dependencies": { "foo": true, "bar": false } }, "tests": [ { "description": "object with property having schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property having schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "dependencies with escaped characters", "schema": { "dependencies": { "foo\nbar": ["foo\rbar"], "foo\tbar": { "minProperties": 4 }, "foo'bar": {"required": ["foo\"bar"]}, "foo\"bar": ["foo'bar"] } }, "tests": [ { "description": "valid object 1", "data": { "foo\nbar": 1, "foo\rbar": 2 }, "valid": true }, { "description": "valid object 2", "data": { "foo\tbar": 1, "a": 2, "b": 3, "c": 4 }, "valid": true }, { "description": "valid object 3", "data": { "foo'bar": 1, "foo\"bar": 2 }, "valid": true }, { "description": "invalid object 1", "data": { "foo\nbar": 1, "foo": 2 }, "valid": false }, { "description": "invalid object 2", "data": { "foo\tbar": 1, "a": 2 }, "valid": false }, { "description": "invalid object 3", "data": { "foo'bar": 1 }, "valid": false }, { "description": "invalid object 4", "data": { "foo\"bar": 2 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/exclusiveMinimum.json000640 000766 000024 00000001407 14163671560 026602 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMinimum validation", "schema": { "exclusiveMinimum": 1.1 }, "tests": [ { "description": "above the exclusiveMinimum is valid", "data": 1.2, "valid": true }, { "description": "boundary point is invalid", "data": 1.1, "valid": false }, { "description": "below the exclusiveMinimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/const.json000640 000766 000024 00000022564 14163671560 024374 0ustar00etherstaff000000 000000 [ { "description": "const validation", "schema": {"const": 2}, "tests": [ { "description": "same value is valid", "data": 2, "valid": true }, { "description": "another value is invalid", "data": 5, "valid": false }, { "description": "another type is invalid", "data": "a", "valid": false } ] }, { "description": "const with object", "schema": {"const": {"foo": "bar", "baz": "bax"}}, "tests": [ { "description": "same object is valid", "data": {"foo": "bar", "baz": "bax"}, "valid": true }, { "description": "same object with different property order is valid", "data": {"baz": "bax", "foo": "bar"}, "valid": true }, { "description": "another object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "another type is invalid", "data": [1, 2], "valid": false } ] }, { "description": "const with array", "schema": {"const": [{ "foo": "bar" }]}, "tests": [ { "description": "same array is valid", "data": [{"foo": "bar"}], "valid": true }, { "description": "another array item is invalid", "data": [2], "valid": false }, { "description": "array with additional items is invalid", "data": [1, 2, 3], "valid": false } ] }, { "description": "const with null", "schema": {"const": null}, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "not null is invalid", "data": 0, "valid": false } ] }, { "description": "const with false does not match 0", "schema": {"const": false}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "const with true does not match 1", "schema": {"const": true}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "const with [false] does not match [0]", "schema": {"const": [false]}, "tests": [ { "description": "[false] is valid", "data": [false], "valid": true }, { "description": "[0] is invalid", "data": [0], "valid": false }, { "description": "[0.0] is invalid", "data": [0.0], "valid": false } ] }, { "description": "const with [true] does not match [1]", "schema": {"const": [true]}, "tests": [ { "description": "[true] is valid", "data": [true], "valid": true }, { "description": "[1] is invalid", "data": [1], "valid": false }, { "description": "[1.0] is invalid", "data": [1.0], "valid": false } ] }, { "description": "const with {\"a\": false} does not match {\"a\": 0}", "schema": {"const": {"a": false}}, "tests": [ { "description": "{\"a\": false} is valid", "data": {"a": false}, "valid": true }, { "description": "{\"a\": 0} is invalid", "data": {"a": 0}, "valid": false }, { "description": "{\"a\": 0.0} is invalid", "data": {"a": 0.0}, "valid": false } ] }, { "description": "const with {\"a\": true} does not match {\"a\": 1}", "schema": {"const": {"a": true}}, "tests": [ { "description": "{\"a\": true} is valid", "data": {"a": true}, "valid": true }, { "description": "{\"a\": 1} is invalid", "data": {"a": 1}, "valid": false }, { "description": "{\"a\": 1.0} is invalid", "data": {"a": 1.0}, "valid": false } ] }, { "description": "const with 0 does not match other zero-like types", "schema": {"const": 0}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "empty string is invalid", "data": "", "valid": false } ] }, { "description": "const with 1 does not match true", "schema": {"const": 1}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "const with -2.0 matches integer and float types", "schema": {"const": -2.0}, "tests": [ { "description": "integer -2 is valid", "data": -2, "valid": true }, { "description": "integer 2 is invalid", "data": 2, "valid": false }, { "description": "float -2.0 is valid", "data": -2.0, "valid": true }, { "description": "float 2.0 is invalid", "data": 2.0, "valid": false }, { "description": "float -2.00001 is invalid", "data": -2.00001, "valid": false } ] }, { "description": "float and integers are equal up to 64-bit representation limits", "schema": {"const": 9007199254740992}, "tests": [ { "description": "integer is valid", "data": 9007199254740992, "valid": true }, { "description": "integer minus one is invalid", "data": 9007199254740991, "valid": false }, { "description": "float is valid", "data": 9007199254740992.0, "valid": true }, { "description": "float minus one is invalid", "data": 9007199254740991.0, "valid": false } ] }, { "description": "nul characters in strings", "schema": { "const": "hello\u0000there" }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/anyOf.json000640 000766 000024 00000012547 14163671560 024322 0ustar00etherstaff000000 000000 [ { "description": "anyOf", "schema": { "anyOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first anyOf valid", "data": 1, "valid": true }, { "description": "second anyOf valid", "data": 2.5, "valid": true }, { "description": "both anyOf valid", "data": 3, "valid": true }, { "description": "neither anyOf valid", "data": 1.5, "valid": false } ] }, { "description": "anyOf with base schema", "schema": { "type": "string", "anyOf" : [ { "maxLength": 2 }, { "minLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one anyOf valid", "data": "foobar", "valid": true }, { "description": "both anyOf invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf with boolean schemas, all true", "schema": {"anyOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, some true", "schema": {"anyOf": [true, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "anyOf with boolean schemas, all false", "schema": {"anyOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "anyOf complex types", "schema": { "anyOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first anyOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second anyOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both anyOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "neither anyOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "anyOf with one empty schema", "schema": { "anyOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is valid", "data": 123, "valid": true } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "nested anyOf, to check validation semantics", "schema": { "anyOf": [ { "anyOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/propertyNames.json000640 000766 000024 00000005577 14163671560 026123 0ustar00etherstaff000000 000000 [ { "description": "propertyNames validation", "schema": { "propertyNames": {"maxLength": 3} }, "tests": [ { "description": "all property names valid", "data": { "f": {}, "foo": {} }, "valid": true }, { "description": "some property names invalid", "data": { "foo": {}, "foobar": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [1, 2, 3, 4], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "propertyNames validation with pattern", "schema": { "propertyNames": { "pattern": "^a+$" } }, "tests": [ { "description": "matching property names valid", "data": { "a": {}, "aa": {}, "aaa": {} }, "valid": true }, { "description": "non-matching property name is invalid", "data": { "aaA": {} }, "valid": false }, { "description": "object without properties is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema true", "schema": {"propertyNames": true}, "tests": [ { "description": "object with any properties is valid", "data": {"foo": 1}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true } ] }, { "description": "propertyNames with boolean schema false", "schema": {"propertyNames": false}, "tests": [ { "description": "object with any properties is invalid", "data": {"foo": 1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/unknownKeyword.json000640 000766 000024 00000003742 14163671560 026307 0ustar00etherstaff000000 000000 [ { "description": "$id inside an unknown keyword is not a real identifier", "comment": "the implementation must not be confused by an $id in locations we do not know how to parse", "schema": { "definitions": { "id_in_unknown0": { "not": { "array_of_schemas": [ { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "null" } ] } }, "real_id_in_schema": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "string" }, "id_in_unknown1": { "not": { "object_of_schemas": { "foo": { "$id": "https://localhost:1234/unknownKeyword/my_identifier.json", "type": "integer" } } } } }, "anyOf": [ { "$ref": "#/definitions/id_in_unknown0" }, { "$ref": "#/definitions/id_in_unknown1" }, { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" } ] }, "tests": [ { "description": "type matches second anyOf, which has a real schema in it", "data": "a string", "valid": true }, { "description": "type matches non-schema in first anyOf", "data": null, "valid": false }, { "description": "type matches non-schema in third anyOf", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/boolean_schema.json000640 000766 000024 00000005402 14163671560 026175 0ustar00etherstaff000000 000000 [ { "description": "boolean schema 'true'", "schema": true, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is valid", "data": "foo", "valid": true }, { "description": "boolean true is valid", "data": true, "valid": true }, { "description": "boolean false is valid", "data": false, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "object is valid", "data": {"foo": "bar"}, "valid": true }, { "description": "empty object is valid", "data": {}, "valid": true }, { "description": "array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "boolean schema 'false'", "schema": false, "tests": [ { "description": "number is invalid", "data": 1, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "boolean true is invalid", "data": true, "valid": false }, { "description": "boolean false is invalid", "data": false, "valid": false }, { "description": "null is invalid", "data": null, "valid": false }, { "description": "object is invalid", "data": {"foo": "bar"}, "valid": false }, { "description": "empty object is invalid", "data": {}, "valid": false }, { "description": "array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/not.json000640 000766 000024 00000005376 14163671560 024050 0ustar00etherstaff000000 000000 [ { "description": "not", "schema": { "not": {"type": "integer"} }, "tests": [ { "description": "allowed", "data": "foo", "valid": true }, { "description": "disallowed", "data": 1, "valid": false } ] }, { "description": "not multiple types", "schema": { "not": {"type": ["integer", "boolean"]} }, "tests": [ { "description": "valid", "data": "foo", "valid": true }, { "description": "mismatch", "data": 1, "valid": false }, { "description": "other mismatch", "data": true, "valid": false } ] }, { "description": "not more complex schema", "schema": { "not": { "type": "object", "properties": { "foo": { "type": "string" } } } }, "tests": [ { "description": "match", "data": 1, "valid": true }, { "description": "other match", "data": {"foo": 1}, "valid": true }, { "description": "mismatch", "data": {"foo": "bar"}, "valid": false } ] }, { "description": "forbidden property", "schema": { "properties": { "foo": { "not": {} } } }, "tests": [ { "description": "property present", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "property absent", "data": {"bar": 1, "baz": 2}, "valid": true } ] }, { "description": "not with boolean schema true", "schema": {"not": true}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "not with boolean schema false", "schema": {"not": false}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/items.json000640 000766 000024 00000016225 14163671560 024364 0ustar00etherstaff000000 000000 [ { "description": "a schema given for items", "schema": { "items": {"type": "integer"} }, "tests": [ { "description": "valid items", "data": [ 1, 2, 3 ], "valid": true }, { "description": "wrong type of items", "data": [1, "x"], "valid": false }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "length": 1 }, "valid": true } ] }, { "description": "an array of schemas for items", "schema": { "items": [ {"type": "integer"}, {"type": "string"} ] }, "tests": [ { "description": "correct types", "data": [ 1, "foo" ], "valid": true }, { "description": "wrong types", "data": [ "foo", 1 ], "valid": false }, { "description": "incomplete array of items", "data": [ 1 ], "valid": true }, { "description": "array with additional items", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array", "data": [ ], "valid": true }, { "description": "JavaScript pseudo-array is valid", "data": { "0": "invalid", "1": "valid", "length": 2 }, "valid": true } ] }, { "description": "items with boolean schema (true)", "schema": {"items": true}, "tests": [ { "description": "any array is valid", "data": [ 1, "foo", true ], "valid": true }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schema (false)", "schema": {"items": false}, "tests": [ { "description": "any non-empty array is invalid", "data": [ 1, "foo", true ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items with boolean schemas", "schema": { "items": [true, false] }, "tests": [ { "description": "array with one item is valid", "data": [ 1 ], "valid": true }, { "description": "array with two items is invalid", "data": [ 1, "foo" ], "valid": false }, { "description": "empty array is valid", "data": [], "valid": true } ] }, { "description": "items and subitems", "schema": { "definitions": { "item": { "type": "array", "additionalItems": false, "items": [ { "$ref": "#/definitions/sub-item" }, { "$ref": "#/definitions/sub-item" } ] }, "sub-item": { "type": "object", "required": ["foo"] } }, "type": "array", "additionalItems": false, "items": [ { "$ref": "#/definitions/item" }, { "$ref": "#/definitions/item" }, { "$ref": "#/definitions/item" } ] }, "tests": [ { "description": "valid items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": true }, { "description": "too many items", "data": [ [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "too many sub-items", "data": [ [ {"foo": null}, {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong item", "data": [ {"foo": null}, [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "wrong sub-item", "data": [ [ {}, {"foo": null} ], [ {"foo": null}, {"foo": null} ], [ {"foo": null}, {"foo": null} ] ], "valid": false }, { "description": "fewer items is valid", "data": [ [ {"foo": null} ], [ {"foo": null} ] ], "valid": true } ] }, { "description": "nested items", "schema": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } } }, "tests": [ { "description": "valid nested array", "data": [[[[1]], [[2],[3]]], [[[4], [5], [6]]]], "valid": true }, { "description": "nested array with invalid type", "data": [[[["1"]], [[2],[3]]], [[[4], [5], [6]]]], "valid": false }, { "description": "not deep enough", "data": [[[1], [2],[3]], [[4], [5], [6]]], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/enum.json000640 000766 000024 00000014643 14163671560 024211 0ustar00etherstaff000000 000000 [ { "description": "simple enum validation", "schema": {"enum": [1, 2, 3]}, "tests": [ { "description": "one of the enum is valid", "data": 1, "valid": true }, { "description": "something else is invalid", "data": 4, "valid": false } ] }, { "description": "heterogeneous enum validation", "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, "tests": [ { "description": "one of the enum is valid", "data": [], "valid": true }, { "description": "something else is invalid", "data": null, "valid": false }, { "description": "objects are deep compared", "data": {"foo": false}, "valid": false }, { "description": "valid object matches", "data": {"foo": 12}, "valid": true }, { "description": "extra properties in object is invalid", "data": {"foo": 12, "boo": 42}, "valid": false } ] }, { "description": "heterogeneous enum-with-null validation", "schema": { "enum": [6, null] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "number is valid", "data": 6, "valid": true }, { "description": "something else is invalid", "data": "test", "valid": false } ] }, { "description": "enums in properties", "schema": { "type":"object", "properties": { "foo": {"enum":["foo"]}, "bar": {"enum":["bar"]} }, "required": ["bar"] }, "tests": [ { "description": "both properties are valid", "data": {"foo":"foo", "bar":"bar"}, "valid": true }, { "description": "wrong foo value", "data": {"foo":"foot", "bar":"bar"}, "valid": false }, { "description": "wrong bar value", "data": {"foo":"foo", "bar":"bart"}, "valid": false }, { "description": "missing optional property is valid", "data": {"bar":"bar"}, "valid": true }, { "description": "missing required property is invalid", "data": {"foo":"foo"}, "valid": false }, { "description": "missing all properties is invalid", "data": {}, "valid": false } ] }, { "description": "enum with escaped characters", "schema": { "enum": ["foo\nbar", "foo\rbar"] }, "tests": [ { "description": "member 1 is valid", "data": "foo\nbar", "valid": true }, { "description": "member 2 is valid", "data": "foo\rbar", "valid": true }, { "description": "another string is invalid", "data": "abc", "valid": false } ] }, { "description": "enum with false does not match 0", "schema": {"enum": [false]}, "tests": [ { "description": "false is valid", "data": false, "valid": true }, { "description": "integer zero is invalid", "data": 0, "valid": false }, { "description": "float zero is invalid", "data": 0.0, "valid": false } ] }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, "tests": [ { "description": "true is valid", "data": true, "valid": true }, { "description": "integer one is invalid", "data": 1, "valid": false }, { "description": "float one is invalid", "data": 1.0, "valid": false } ] }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, "tests": [ { "description": "false is invalid", "data": false, "valid": false }, { "description": "integer zero is valid", "data": 0, "valid": true }, { "description": "float zero is valid", "data": 0.0, "valid": true } ] }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, "tests": [ { "description": "true is invalid", "data": true, "valid": false }, { "description": "integer one is valid", "data": 1, "valid": true }, { "description": "float one is valid", "data": 1.0, "valid": true } ] }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, "tests": [ { "description": "match string with nul", "data": "hello\u0000there", "valid": true }, { "description": "do not match string lacking nul", "data": "hellothere", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/minProperties.json000640 000766 000024 00000001754 14163671560 026104 0ustar00etherstaff000000 000000 [ { "description": "minProperties validation", "schema": {"minProperties": 1}, "tests": [ { "description": "longer is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1}, "valid": true }, { "description": "too short is invalid", "data": {}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/properties.json000640 000766 000024 00000012034 14163671560 025431 0ustar00etherstaff000000 000000 [ { "description": "object properties validation", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"type": "string"} } }, "tests": [ { "description": "both properties present and valid is valid", "data": {"foo": 1, "bar": "baz"}, "valid": true }, { "description": "one property invalid is invalid", "data": {"foo": 1, "bar": {}}, "valid": false }, { "description": "both properties invalid is invalid", "data": {"foo": [], "bar": {}}, "valid": false }, { "description": "doesn't invalidate other properties", "data": {"quux": []}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "properties, patternProperties, additionalProperties interaction", "schema": { "properties": { "foo": {"type": "array", "maxItems": 3}, "bar": {"type": "array"} }, "patternProperties": {"f.o": {"minItems": 2}}, "additionalProperties": {"type": "integer"} }, "tests": [ { "description": "property validates property", "data": {"foo": [1, 2]}, "valid": true }, { "description": "property invalidates property", "data": {"foo": [1, 2, 3, 4]}, "valid": false }, { "description": "patternProperty invalidates property", "data": {"foo": []}, "valid": false }, { "description": "patternProperty validates nonproperty", "data": {"fxo": [1, 2]}, "valid": true }, { "description": "patternProperty invalidates nonproperty", "data": {"fxo": []}, "valid": false }, { "description": "additionalProperty ignores property", "data": {"bar": []}, "valid": true }, { "description": "additionalProperty validates others", "data": {"quux": 3}, "valid": true }, { "description": "additionalProperty invalidates others", "data": {"quux": "foo"}, "valid": false } ] }, { "description": "properties with boolean schema", "schema": { "properties": { "foo": true, "bar": false } }, "tests": [ { "description": "no property present is valid", "data": {}, "valid": true }, { "description": "only 'true' property present is valid", "data": {"foo": 1}, "valid": true }, { "description": "only 'false' property present is invalid", "data": {"bar": 2}, "valid": false }, { "description": "both properties present is invalid", "data": {"foo": 1, "bar": 2}, "valid": false } ] }, { "description": "properties with escaped characters", "schema": { "properties": { "foo\nbar": {"type": "number"}, "foo\"bar": {"type": "number"}, "foo\\bar": {"type": "number"}, "foo\rbar": {"type": "number"}, "foo\tbar": {"type": "number"}, "foo\fbar": {"type": "number"} } }, "tests": [ { "description": "object with all numbers is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1", "foo\\bar": "1", "foo\rbar": "1", "foo\tbar": "1", "foo\fbar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/maxLength.json000640 000766 000024 00000001600 14163671560 025161 0ustar00etherstaff000000 000000 [ { "description": "maxLength validation", "schema": {"maxLength": 2}, "tests": [ { "description": "shorter is valid", "data": "f", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too long is invalid", "data": "foo", "valid": false }, { "description": "ignores non-strings", "data": 100, "valid": true }, { "description": "two supplementary Unicode code points is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/infinite-loop-detection.json000640 000766 000024 00000001746 14163671560 027775 0ustar00etherstaff000000 000000 [ { "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", "schema": { "definitions": { "int": { "type": "integer" } }, "allOf": [ { "properties": { "foo": { "$ref": "#/definitions/int" } } }, { "additionalProperties": { "$ref": "#/definitions/int" } } ] }, "tests": [ { "description": "passing case", "data": { "foo": 1 }, "valid": true }, { "description": "failing case", "data": { "foo": "a string" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/exclusiveMaximum.json000640 000766 000024 00000001407 14163671560 026604 0ustar00etherstaff000000 000000 [ { "description": "exclusiveMaximum validation", "schema": { "exclusiveMaximum": 3.0 }, "tests": [ { "description": "below the exclusiveMaximum is valid", "data": 2.2, "valid": true }, { "description": "boundary point is invalid", "data": 3.0, "valid": false }, { "description": "above the exclusiveMaximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/minimum.json000640 000766 000024 00000003612 14163671560 024712 0ustar00etherstaff000000 000000 [ { "description": "minimum validation", "schema": {"minimum": 1.1}, "tests": [ { "description": "above the minimum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 1.1, "valid": true }, { "description": "below the minimum is invalid", "data": 0.6, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "minimum validation with signed integer", "schema": {"minimum": -2}, "tests": [ { "description": "negative above the minimum is valid", "data": -1, "valid": true }, { "description": "positive above the minimum is valid", "data": 0, "valid": true }, { "description": "boundary point is valid", "data": -2, "valid": true }, { "description": "boundary point with float is valid", "data": -2.0, "valid": true }, { "description": "float below the minimum is invalid", "data": -2.0001, "valid": false }, { "description": "int below the minimum is invalid", "data": -3, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/000770 000766 000024 00000000000 14163671560 024170 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/oneOf.json000640 000766 000024 00000016123 14163671560 024306 0ustar00etherstaff000000 000000 [ { "description": "oneOf", "schema": { "oneOf": [ { "type": "integer" }, { "minimum": 2 } ] }, "tests": [ { "description": "first oneOf valid", "data": 1, "valid": true }, { "description": "second oneOf valid", "data": 2.5, "valid": true }, { "description": "both oneOf valid", "data": 3, "valid": false }, { "description": "neither oneOf valid", "data": 1.5, "valid": false } ] }, { "description": "oneOf with base schema", "schema": { "type": "string", "oneOf" : [ { "minLength": 2 }, { "maxLength": 4 } ] }, "tests": [ { "description": "mismatch base schema", "data": 3, "valid": false }, { "description": "one oneOf valid", "data": "foobar", "valid": true }, { "description": "both oneOf valid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all true", "schema": {"oneOf": [true, true, true]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, one true", "schema": {"oneOf": [true, false, false]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "oneOf with boolean schemas, more than one true", "schema": {"oneOf": [true, true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf with boolean schemas, all false", "schema": {"oneOf": [false, false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "oneOf complex types", "schema": { "oneOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid (complex)", "data": {"bar": 2}, "valid": true }, { "description": "second oneOf valid (complex)", "data": {"foo": "baz"}, "valid": true }, { "description": "both oneOf valid (complex)", "data": {"foo": "baz", "bar": 2}, "valid": false }, { "description": "neither oneOf valid (complex)", "data": {"foo": 2, "bar": "quux"}, "valid": false } ] }, { "description": "oneOf with empty schema", "schema": { "oneOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "one valid - valid", "data": "foo", "valid": true }, { "description": "both valid - invalid", "data": 123, "valid": false } ] }, { "description": "oneOf with required", "schema": { "type": "object", "oneOf": [ { "required": ["foo", "bar"] }, { "required": ["foo", "baz"] } ] }, "tests": [ { "description": "both invalid - invalid", "data": {"bar": 2}, "valid": false }, { "description": "first valid - valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "second valid - valid", "data": {"foo": 1, "baz": 3}, "valid": true }, { "description": "both valid - invalid", "data": {"foo": 1, "bar": 2, "baz" : 3}, "valid": false } ] }, { "description": "oneOf with missing optional property", "schema": { "oneOf": [ { "properties": { "bar": true, "baz": true }, "required": ["bar"] }, { "properties": { "foo": true }, "required": ["foo"] } ] }, "tests": [ { "description": "first oneOf valid", "data": {"bar": 8}, "valid": true }, { "description": "second oneOf valid", "data": {"foo": "foo"}, "valid": true }, { "description": "both oneOf valid", "data": {"foo": "foo", "bar": 8}, "valid": false }, { "description": "neither oneOf valid", "data": {"baz": "quux"}, "valid": false } ] }, { "description": "nested oneOf, to check validation semantics", "schema": { "oneOf": [ { "oneOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/additionalItems.json000640 000766 000024 00000010373 14163671560 026353 0ustar00etherstaff000000 000000 [ { "description": "additionalItems as schema", "schema": { "items": [{}], "additionalItems": {"type": "integer"} }, "tests": [ { "description": "additional items match schema", "data": [ null, 2, 3, 4 ], "valid": true }, { "description": "additional items do not match schema", "data": [ null, 2, 3, "foo" ], "valid": false } ] }, { "description": "when items is schema, additionalItems does nothing", "schema": { "items": {}, "additionalItems": false }, "tests": [ { "description": "all items match schema", "data": [ 1, 2, 3, 4, 5 ], "valid": true } ] }, { "description": "array of items with no additionalItems permitted", "schema": { "items": [{}, {}, {}], "additionalItems": false }, "tests": [ { "description": "empty array", "data": [ ], "valid": true }, { "description": "fewer number of items present (1)", "data": [ 1 ], "valid": true }, { "description": "fewer number of items present (2)", "data": [ 1, 2 ], "valid": true }, { "description": "equal number of items present", "data": [ 1, 2, 3 ], "valid": true }, { "description": "additional items are not permitted", "data": [ 1, 2, 3, 4 ], "valid": false } ] }, { "description": "additionalItems as false without items", "schema": {"additionalItems": false}, "tests": [ { "description": "items defaults to empty schema so everything is valid", "data": [ 1, 2, 3, 4, 5 ], "valid": true }, { "description": "ignores non-arrays", "data": {"foo" : "bar"}, "valid": true } ] }, { "description": "additionalItems are allowed by default", "schema": {"items": [{"type": "integer"}]}, "tests": [ { "description": "only the first item is validated", "data": [1, "foo", false], "valid": true } ] }, { "description": "additionalItems should not look in applicators, valid case", "schema": { "allOf": [ { "items": [ { "type": "integer" } ] } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, null ], "valid": true } ] }, { "description": "additionalItems should not look in applicators, invalid case", "schema": { "allOf": [ { "items": [ { "type": "integer" }, { "type": "string" } ] } ], "items": [ {"type": "integer" } ], "additionalItems": { "type": "boolean" } }, "tests": [ { "description": "items defined in allOf are not examined", "data": [ 1, "hello" ], "valid": false } ] }, { "description": "items validation adjusts the starting index for additionalItems", "schema": { "items": [ { "type": "string" } ], "additionalItems": { "type": "integer" } }, "tests": [ { "description": "valid items", "data": [ "x", 2, 3 ], "valid": true }, { "description": "wrong type of second item", "data": [ "x", "y" ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/pattern.json000640 000766 000024 00000003003 14163671560 024706 0ustar00etherstaff000000 000000 [ { "description": "pattern validation", "schema": {"pattern": "^a*$"}, "tests": [ { "description": "a matching pattern is valid", "data": "aaa", "valid": true }, { "description": "a non-matching pattern is invalid", "data": "abc", "valid": false }, { "description": "ignores booleans", "data": true, "valid": true }, { "description": "ignores integers", "data": 123, "valid": true }, { "description": "ignores floats", "data": 1.0, "valid": true }, { "description": "ignores objects", "data": {}, "valid": true }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores null", "data": null, "valid": true } ] }, { "description": "pattern is not anchored", "schema": {"pattern": "a+"}, "tests": [ { "description": "matches a substring", "data": "xxaayy", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/definitions.json000640 000766 000024 00000001317 14163671560 025552 0ustar00etherstaff000000 000000 [ { "description": "validate definition against metaschema", "schema": {"$ref": "http://json-schema.org/draft-06/schema#"}, "tests": [ { "description": "valid definition schema", "data": { "definitions": { "foo": {"type": "integer"} } }, "valid": true }, { "description": "invalid definition schema", "data": { "definitions": { "foo": {"type": 1} } }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/maxProperties.json000640 000766 000024 00000002732 14163671560 026103 0ustar00etherstaff000000 000000 [ { "description": "maxProperties validation", "schema": {"maxProperties": 2}, "tests": [ { "description": "shorter is valid", "data": {"foo": 1}, "valid": true }, { "description": "exact length is valid", "data": {"foo": 1, "bar": 2}, "valid": true }, { "description": "too long is invalid", "data": {"foo": 1, "bar": 2, "baz": 3}, "valid": false }, { "description": "ignores arrays", "data": [1, 2, 3], "valid": true }, { "description": "ignores strings", "data": "foobar", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "maxProperties = 0 means the object is empty", "schema": { "maxProperties": 0 }, "tests": [ { "description": "no properties is valid", "data": {}, "valid": true }, { "description": "one property is invalid", "data": { "foo": 1 }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/required.json000640 000766 000024 00000005206 14163671560 025060 0ustar00etherstaff000000 000000 [ { "description": "required validation", "schema": { "properties": { "foo": {}, "bar": {} }, "required": ["foo"] }, "tests": [ { "description": "present required property is valid", "data": {"foo": 1}, "valid": true }, { "description": "non-present required property is invalid", "data": {"bar": 1}, "valid": false }, { "description": "ignores arrays", "data": [], "valid": true }, { "description": "ignores strings", "data": "", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "required default validation", "schema": { "properties": { "foo": {} } }, "tests": [ { "description": "not required by default", "data": {}, "valid": true } ] }, { "description": "required with empty array", "schema": { "properties": { "foo": {} }, "required": [] }, "tests": [ { "description": "property not required", "data": {}, "valid": true } ] }, { "description": "required with escaped characters", "schema": { "required": [ "foo\nbar", "foo\"bar", "foo\\bar", "foo\rbar", "foo\tbar", "foo\fbar" ] }, "tests": [ { "description": "object with all properties present is valid", "data": { "foo\nbar": 1, "foo\"bar": 1, "foo\\bar": 1, "foo\rbar": 1, "foo\tbar": 1, "foo\fbar": 1 }, "valid": true }, { "description": "object with some properties missing is invalid", "data": { "foo\nbar": "1", "foo\"bar": "1" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/id.json000640 000766 000024 00000003312 14163671560 023630 0ustar00etherstaff000000 000000 [ { "description": "id inside an enum is not a real identifier", "comment": "the implementation must not be confused by an id buried in the enum", "schema": { "definitions": { "id_in_enum": { "enum": [ { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } ] }, "real_id_in_schema": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "string" }, "zzz_id_in_const": { "const": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" } } }, "anyOf": [ { "$ref": "#/definitions/id_in_enum" }, { "$ref": "https://localhost:1234/id/my_identifier.json" } ] }, "tests": [ { "description": "exact match to enum, and type matches", "data": { "$id": "https://localhost:1234/id/my_identifier.json", "type": "null" }, "valid": true }, { "description": "match $ref to id", "data": "a string to match #/definitions/id_in_enum", "valid": true }, { "description": "no match on enum or $ref to id", "data": 1, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/type.json000640 000766 000024 00000032140 14163671560 024216 0ustar00etherstaff000000 000000 [ { "description": "integer type matches integers", "schema": {"type": "integer"}, "tests": [ { "description": "an integer is an integer", "data": 1, "valid": true }, { "description": "a float with zero fractional part is an integer", "data": 1.0, "valid": true }, { "description": "a float is not an integer", "data": 1.1, "valid": false }, { "description": "a string is not an integer", "data": "foo", "valid": false }, { "description": "a string is still not an integer, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not an integer", "data": {}, "valid": false }, { "description": "an array is not an integer", "data": [], "valid": false }, { "description": "a boolean is not an integer", "data": true, "valid": false }, { "description": "null is not an integer", "data": null, "valid": false } ] }, { "description": "number type matches numbers", "schema": {"type": "number"}, "tests": [ { "description": "an integer is a number", "data": 1, "valid": true }, { "description": "a float with zero fractional part is a number (and an integer)", "data": 1.0, "valid": true }, { "description": "a float is a number", "data": 1.1, "valid": true }, { "description": "a string is not a number", "data": "foo", "valid": false }, { "description": "a string is still not a number, even if it looks like one", "data": "1", "valid": false }, { "description": "an object is not a number", "data": {}, "valid": false }, { "description": "an array is not a number", "data": [], "valid": false }, { "description": "a boolean is not a number", "data": true, "valid": false }, { "description": "null is not a number", "data": null, "valid": false } ] }, { "description": "string type matches strings", "schema": {"type": "string"}, "tests": [ { "description": "1 is not a string", "data": 1, "valid": false }, { "description": "a float is not a string", "data": 1.1, "valid": false }, { "description": "a string is a string", "data": "foo", "valid": true }, { "description": "a string is still a string, even if it looks like a number", "data": "1", "valid": true }, { "description": "an empty string is still a string", "data": "", "valid": true }, { "description": "an object is not a string", "data": {}, "valid": false }, { "description": "an array is not a string", "data": [], "valid": false }, { "description": "a boolean is not a string", "data": true, "valid": false }, { "description": "null is not a string", "data": null, "valid": false } ] }, { "description": "object type matches objects", "schema": {"type": "object"}, "tests": [ { "description": "an integer is not an object", "data": 1, "valid": false }, { "description": "a float is not an object", "data": 1.1, "valid": false }, { "description": "a string is not an object", "data": "foo", "valid": false }, { "description": "an object is an object", "data": {}, "valid": true }, { "description": "an array is not an object", "data": [], "valid": false }, { "description": "a boolean is not an object", "data": true, "valid": false }, { "description": "null is not an object", "data": null, "valid": false } ] }, { "description": "array type matches arrays", "schema": {"type": "array"}, "tests": [ { "description": "an integer is not an array", "data": 1, "valid": false }, { "description": "a float is not an array", "data": 1.1, "valid": false }, { "description": "a string is not an array", "data": "foo", "valid": false }, { "description": "an object is not an array", "data": {}, "valid": false }, { "description": "an array is an array", "data": [], "valid": true }, { "description": "a boolean is not an array", "data": true, "valid": false }, { "description": "null is not an array", "data": null, "valid": false } ] }, { "description": "boolean type matches booleans", "schema": {"type": "boolean"}, "tests": [ { "description": "an integer is not a boolean", "data": 1, "valid": false }, { "description": "zero is not a boolean", "data": 0, "valid": false }, { "description": "a float is not a boolean", "data": 1.1, "valid": false }, { "description": "a string is not a boolean", "data": "foo", "valid": false }, { "description": "an empty string is not a boolean", "data": "", "valid": false }, { "description": "an object is not a boolean", "data": {}, "valid": false }, { "description": "an array is not a boolean", "data": [], "valid": false }, { "description": "true is a boolean", "data": true, "valid": true }, { "description": "false is a boolean", "data": false, "valid": true }, { "description": "null is not a boolean", "data": null, "valid": false } ] }, { "description": "null type matches only the null object", "schema": {"type": "null"}, "tests": [ { "description": "an integer is not null", "data": 1, "valid": false }, { "description": "a float is not null", "data": 1.1, "valid": false }, { "description": "zero is not null", "data": 0, "valid": false }, { "description": "a string is not null", "data": "foo", "valid": false }, { "description": "an empty string is not null", "data": "", "valid": false }, { "description": "an object is not null", "data": {}, "valid": false }, { "description": "an array is not null", "data": [], "valid": false }, { "description": "true is not null", "data": true, "valid": false }, { "description": "false is not null", "data": false, "valid": false }, { "description": "null is null", "data": null, "valid": true } ] }, { "description": "multiple types can be specified in an array", "schema": {"type": ["integer", "string"]}, "tests": [ { "description": "an integer is valid", "data": 1, "valid": true }, { "description": "a string is valid", "data": "foo", "valid": true }, { "description": "a float is invalid", "data": 1.1, "valid": false }, { "description": "an object is invalid", "data": {}, "valid": false }, { "description": "an array is invalid", "data": [], "valid": false }, { "description": "a boolean is invalid", "data": true, "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type as array with one item", "schema": { "type": ["string"] }, "tests": [ { "description": "string is valid", "data": "foo", "valid": true }, { "description": "number is invalid", "data": 123, "valid": false } ] }, { "description": "type: array or object", "schema": { "type": ["array", "object"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false }, { "description": "null is invalid", "data": null, "valid": false } ] }, { "description": "type: array, object or null", "schema": { "type": ["array", "object", "null"] }, "tests": [ { "description": "array is valid", "data": [1,2,3], "valid": true }, { "description": "object is valid", "data": {"foo": 123}, "valid": true }, { "description": "null is valid", "data": null, "valid": true }, { "description": "number is invalid", "data": 123, "valid": false }, { "description": "string is invalid", "data": "foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/default.json000640 000766 000024 00000004267 14163671560 024672 0ustar00etherstaff000000 000000 [ { "description": "invalid type for default", "schema": { "properties": { "foo": { "type": "integer", "default": [] } } }, "tests": [ { "description": "valid when property is specified", "data": {"foo": 13}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "invalid string value for default", "schema": { "properties": { "bar": { "type": "string", "minLength": 4, "default": "bad" } } }, "tests": [ { "description": "valid when property is specified", "data": {"bar": "good"}, "valid": true }, { "description": "still valid when the invalid default is used", "data": {}, "valid": true } ] }, { "description": "the default keyword does not do anything if the property is missing", "schema": { "type": "object", "properties": { "alpha": { "type": "number", "maximum": 3, "default": 5 } } }, "tests": [ { "description": "an explicit property value is checked against maximum (passing)", "data": { "alpha": 1 }, "valid": true }, { "description": "an explicit property value is checked against maximum (failing)", "data": { "alpha": 5 }, "valid": false }, { "description": "missing properties are not filled in with the default", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/multipleOf.json000640 000766 000024 00000003577 14163671560 025371 0ustar00etherstaff000000 000000 [ { "description": "by int", "schema": {"multipleOf": 2}, "tests": [ { "description": "int by int", "data": 10, "valid": true }, { "description": "int by int fail", "data": 7, "valid": false }, { "description": "ignores non-numbers", "data": "foo", "valid": true } ] }, { "description": "by number", "schema": {"multipleOf": 1.5}, "tests": [ { "description": "zero is multiple of anything", "data": 0, "valid": true }, { "description": "4.5 is multiple of 1.5", "data": 4.5, "valid": true }, { "description": "35 is not multiple of 1.5", "data": 35, "valid": false } ] }, { "description": "by small number", "schema": {"multipleOf": 0.0001}, "tests": [ { "description": "0.0075 is multiple of 0.0001", "data": 0.0075, "valid": true }, { "description": "0.00751 is not multiple of 0.0001", "data": 0.00751, "valid": false } ] }, { "description": "invalid instance should not raise error when float division = inf", "schema": {"type": "integer", "multipleOf": 0.123456789}, "tests": [ { "description": "always invalid, but naive implementations may raise an overflow error", "data": 1e308, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/patternProperties.json000640 000766 000024 00000011251 14163671560 026767 0ustar00etherstaff000000 000000 [ { "description": "patternProperties validates properties matching a regex", "schema": { "patternProperties": { "f.*o": {"type": "integer"} } }, "tests": [ { "description": "a single valid match is valid", "data": {"foo": 1}, "valid": true }, { "description": "multiple valid matches is valid", "data": {"foo": 1, "foooooo" : 2}, "valid": true }, { "description": "a single invalid match is invalid", "data": {"foo": "bar", "fooooo": 2}, "valid": false }, { "description": "multiple invalid matches is invalid", "data": {"foo": "bar", "foooooo" : "baz"}, "valid": false }, { "description": "ignores arrays", "data": ["foo"], "valid": true }, { "description": "ignores strings", "data": "foo", "valid": true }, { "description": "ignores other non-objects", "data": 12, "valid": true } ] }, { "description": "multiple simultaneous patternProperties are validated", "schema": { "patternProperties": { "a*": {"type": "integer"}, "aaa*": {"maximum": 20} } }, "tests": [ { "description": "a single valid match is valid", "data": {"a": 21}, "valid": true }, { "description": "a simultaneous match is valid", "data": {"aaaa": 18}, "valid": true }, { "description": "multiple matches is valid", "data": {"a": 21, "aaaa": 18}, "valid": true }, { "description": "an invalid due to one is invalid", "data": {"a": "bar"}, "valid": false }, { "description": "an invalid due to the other is invalid", "data": {"aaaa": 31}, "valid": false }, { "description": "an invalid due to both is invalid", "data": {"aaa": "foo", "aaaa": 31}, "valid": false } ] }, { "description": "regexes are not anchored by default and are case sensitive", "schema": { "patternProperties": { "[0-9]{2,}": { "type": "boolean" }, "X_": { "type": "string" } } }, "tests": [ { "description": "non recognized members are ignored", "data": { "answer 1": "42" }, "valid": true }, { "description": "recognized members are accounted for", "data": { "a31b": null }, "valid": false }, { "description": "regexes are case sensitive", "data": { "a_x_3": 3 }, "valid": true }, { "description": "regexes are case sensitive, 2", "data": { "a_X_3": 3 }, "valid": false } ] }, { "description": "patternProperties with boolean schemas", "schema": { "patternProperties": { "f.*": true, "b.*": false } }, "tests": [ { "description": "object with property matching schema true is valid", "data": {"foo": 1}, "valid": true }, { "description": "object with property matching schema false is invalid", "data": {"bar": 2}, "valid": false }, { "description": "object with both properties is invalid", "data": {"foo": 1, "bar": 2}, "valid": false }, { "description": "object with a property matching both true and false is invalid", "data": {"foobar":1}, "valid": false }, { "description": "empty object is valid", "data": {}, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/refRemote.json000640 000766 000024 00000012504 14163671560 025167 0ustar00etherstaff000000 000000 [ { "description": "remote ref", "schema": {"$ref": "http://localhost:1234/integer.json"}, "tests": [ { "description": "remote ref valid", "data": 1, "valid": true }, { "description": "remote ref invalid", "data": "a", "valid": false } ] }, { "description": "fragment within remote ref", "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, "tests": [ { "description": "remote fragment valid", "data": 1, "valid": true }, { "description": "remote fragment invalid", "data": "a", "valid": false } ] }, { "description": "ref within remote ref", "schema": { "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" }, "tests": [ { "description": "ref within ref valid", "data": 1, "valid": true }, { "description": "ref within ref invalid", "data": "a", "valid": false } ] }, { "description": "base URI change", "schema": { "$id": "http://localhost:1234/", "items": { "$id": "baseUriChange/", "items": {"$ref": "folderInteger.json"} } }, "tests": [ { "description": "base URI change ref valid", "data": [[1]], "valid": true }, { "description": "base URI change ref invalid", "data": [["a"]], "valid": false } ] }, { "description": "base URI change - change folder", "schema": { "$id": "http://localhost:1234/scope_change_defs1.json", "type" : "object", "properties": { "list": {"$ref": "#/definitions/baz"} }, "definitions": { "baz": { "$id": "baseUriChangeFolder/", "type": "array", "items": {"$ref": "folderInteger.json"} } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "base URI change - change folder in subschema", "schema": { "$id": "http://localhost:1234/scope_change_defs2.json", "type" : "object", "properties": { "list": {"$ref": "#/definitions/baz/definitions/bar"} }, "definitions": { "baz": { "$id": "baseUriChangeFolderInSubschema/", "definitions": { "bar": { "type": "array", "items": {"$ref": "folderInteger.json"} } } } } }, "tests": [ { "description": "number is valid", "data": {"list": [1]}, "valid": true }, { "description": "string is invalid", "data": {"list": ["a"]}, "valid": false } ] }, { "description": "root ref in remote ref", "schema": { "$id": "http://localhost:1234/object", "type": "object", "properties": { "name": {"$ref": "name.json#/definitions/orNull"} } }, "tests": [ { "description": "string is valid", "data": { "name": "foo" }, "valid": true }, { "description": "null is valid", "data": { "name": null }, "valid": true }, { "description": "object is invalid", "data": { "name": { "name": null } }, "valid": false } ] }, { "description": "remote ref with ref to definitions", "schema": { "$id": "http://localhost:1234/schema-remote-ref-ref-defs1.json", "allOf": [ { "$ref": "ref-and-definitions.json" } ] }, "tests": [ { "description": "invalid", "data": { "bar": 1 }, "valid": false }, { "description": "valid", "data": { "bar": "a" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/allOf.json000640 000766 000024 00000017147 14163671560 024304 0ustar00etherstaff000000 000000 [ { "description": "allOf", "schema": { "allOf": [ { "properties": { "bar": {"type": "integer"} }, "required": ["bar"] }, { "properties": { "foo": {"type": "string"} }, "required": ["foo"] } ] }, "tests": [ { "description": "allOf", "data": {"foo": "baz", "bar": 2}, "valid": true }, { "description": "mismatch second", "data": {"foo": "baz"}, "valid": false }, { "description": "mismatch first", "data": {"bar": 2}, "valid": false }, { "description": "wrong type", "data": {"foo": "baz", "bar": "quux"}, "valid": false } ] }, { "description": "allOf with base schema", "schema": { "properties": {"bar": {"type": "integer"}}, "required": ["bar"], "allOf" : [ { "properties": { "foo": {"type": "string"} }, "required": ["foo"] }, { "properties": { "baz": {"type": "null"} }, "required": ["baz"] } ] }, "tests": [ { "description": "valid", "data": {"foo": "quux", "bar": 2, "baz": null}, "valid": true }, { "description": "mismatch base schema", "data": {"foo": "quux", "baz": null}, "valid": false }, { "description": "mismatch first allOf", "data": {"bar": 2, "baz": null}, "valid": false }, { "description": "mismatch second allOf", "data": {"foo": "quux", "bar": 2}, "valid": false }, { "description": "mismatch both", "data": {"bar": 2}, "valid": false } ] }, { "description": "allOf simple types", "schema": { "allOf": [ {"maximum": 30}, {"minimum": 20} ] }, "tests": [ { "description": "valid", "data": 25, "valid": true }, { "description": "mismatch one", "data": 35, "valid": false } ] }, { "description": "allOf with boolean schemas, all true", "schema": {"allOf": [true, true]}, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "allOf with boolean schemas, some false", "schema": {"allOf": [true, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with boolean schemas, all false", "schema": {"allOf": [false, false]}, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with one empty schema", "schema": { "allOf": [ {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with two empty schemas", "schema": { "allOf": [ {}, {} ] }, "tests": [ { "description": "any data is valid", "data": 1, "valid": true } ] }, { "description": "allOf with the first empty schema", "schema": { "allOf": [ {}, { "type": "number" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "allOf with the last empty schema", "schema": { "allOf": [ { "type": "number" }, {} ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true }, { "description": "string is invalid", "data": "foo", "valid": false } ] }, { "description": "nested allOf, to check validation semantics", "schema": { "allOf": [ { "allOf": [ { "type": "null" } ] } ] }, "tests": [ { "description": "null is valid", "data": null, "valid": true }, { "description": "anything non-null is invalid", "data": 123, "valid": false } ] }, { "description": "allOf combined with anyOf, oneOf", "schema": { "allOf": [ { "multipleOf": 2 } ], "anyOf": [ { "multipleOf": 3 } ], "oneOf": [ { "multipleOf": 5 } ] }, "tests": [ { "description": "allOf: false, anyOf: false, oneOf: false", "data": 1, "valid": false }, { "description": "allOf: false, anyOf: false, oneOf: true", "data": 5, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: false", "data": 3, "valid": false }, { "description": "allOf: false, anyOf: true, oneOf: true", "data": 15, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: false", "data": 2, "valid": false }, { "description": "allOf: true, anyOf: false, oneOf: true", "data": 10, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: false", "data": 6, "valid": false }, { "description": "allOf: true, anyOf: true, oneOf: true", "data": 30, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/format.json000640 000766 000024 00000022525 14163671560 024533 0ustar00etherstaff000000 000000 [ { "description": "email format", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv4 format", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "ipv6 format", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "hostname format", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "date-time format", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "json-pointer format", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri format", "schema": { "format": "uri" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-reference format", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] }, { "description": "uri-template format", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/ref.json000640 000766 000024 00000043263 14163671560 024021 0ustar00etherstaff000000 000000 [ { "description": "root pointer ref", "schema": { "properties": { "foo": {"$ref": "#"} }, "additionalProperties": false }, "tests": [ { "description": "match", "data": {"foo": false}, "valid": true }, { "description": "recursive match", "data": {"foo": {"foo": false}}, "valid": true }, { "description": "mismatch", "data": {"bar": false}, "valid": false }, { "description": "recursive mismatch", "data": {"foo": {"bar": false}}, "valid": false } ] }, { "description": "relative pointer ref to object", "schema": { "properties": { "foo": {"type": "integer"}, "bar": {"$ref": "#/properties/foo"} } }, "tests": [ { "description": "match", "data": {"bar": 3}, "valid": true }, { "description": "mismatch", "data": {"bar": true}, "valid": false } ] }, { "description": "relative pointer ref to array", "schema": { "items": [ {"type": "integer"}, {"$ref": "#/items/0"} ] }, "tests": [ { "description": "match array", "data": [1, 2], "valid": true }, { "description": "mismatch array", "data": [1, "foo"], "valid": false } ] }, { "description": "escaped pointer ref", "schema": { "definitions": { "tilde~field": {"type": "integer"}, "slash/field": {"type": "integer"}, "percent%field": {"type": "integer"} }, "properties": { "tilde": {"$ref": "#/definitions/tilde~0field"}, "slash": {"$ref": "#/definitions/slash~1field"}, "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ { "description": "slash invalid", "data": {"slash": "aoeu"}, "valid": false }, { "description": "tilde invalid", "data": {"tilde": "aoeu"}, "valid": false }, { "description": "percent invalid", "data": {"percent": "aoeu"}, "valid": false }, { "description": "slash valid", "data": {"slash": 123}, "valid": true }, { "description": "tilde valid", "data": {"tilde": 123}, "valid": true }, { "description": "percent valid", "data": {"percent": 123}, "valid": true } ] }, { "description": "nested refs", "schema": { "definitions": { "a": {"type": "integer"}, "b": {"$ref": "#/definitions/a"}, "c": {"$ref": "#/definitions/b"} }, "allOf": [{ "$ref": "#/definitions/c" }] }, "tests": [ { "description": "nested ref valid", "data": 5, "valid": true }, { "description": "nested ref invalid", "data": "a", "valid": false } ] }, { "description": "ref overrides any sibling keywords", "schema": { "definitions": { "reffed": { "type": "array" } }, "properties": { "foo": { "$ref": "#/definitions/reffed", "maxItems": 2 } } }, "tests": [ { "description": "ref valid", "data": { "foo": [] }, "valid": true }, { "description": "ref valid, maxItems ignored", "data": { "foo": [ 1, 2, 3] }, "valid": true }, { "description": "ref invalid", "data": { "foo": "string" }, "valid": false } ] }, { "description": "$ref prevents a sibling $id from changing the base uri", "schema": { "$id": "http://localhost:1234/sibling_id/base/", "definitions": { "foo": { "$id": "http://localhost:1234/sibling_id/foo.json", "type": "string" }, "base_foo": { "$comment": "this canonical uri is http://localhost:1234/sibling_id/base/foo.json", "$id": "foo.json", "type": "number" } }, "allOf": [ { "$comment": "$ref resolves to http://localhost:1234/sibling_id/base/foo.json, not http://localhost:1234/sibling_id/foo.json", "$id": "http://localhost:1234/sibling_id/", "$ref": "foo.json" } ] }, "tests": [ { "description": "$ref resolves to /definitions/base_foo, data does not validate", "data": "a", "valid": false }, { "description": "$ref resolves to /definitions/base_foo, data validates", "data": 1, "valid": true } ] }, { "description": "remote ref, containing refs itself", "schema": {"$ref": "http://json-schema.org/draft-06/schema#"}, "tests": [ { "description": "remote ref valid", "data": {"minLength": 1}, "valid": true }, { "description": "remote ref invalid", "data": {"minLength": -1}, "valid": false } ] }, { "description": "property named $ref that is not a reference", "schema": { "properties": { "$ref": {"type": "string"} } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "property named $ref, containing an actual $ref", "schema": { "properties": { "$ref": {"$ref": "#/definitions/is-string"} }, "definitions": { "is-string": { "type": "string" } } }, "tests": [ { "description": "property named $ref valid", "data": {"$ref": "a"}, "valid": true }, { "description": "property named $ref invalid", "data": {"$ref": 2}, "valid": false } ] }, { "description": "$ref to boolean schema true", "schema": { "allOf": [{ "$ref": "#/definitions/bool" }], "definitions": { "bool": true } }, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true } ] }, { "description": "$ref to boolean schema false", "schema": { "allOf": [{ "$ref": "#/definitions/bool" }], "definitions": { "bool": false } }, "tests": [ { "description": "any value is invalid", "data": "foo", "valid": false } ] }, { "description": "Recursive references between schemas", "schema": { "$id": "http://localhost:1234/tree", "description": "tree of nodes", "type": "object", "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "required": ["meta", "nodes"], "definitions": { "node": { "$id": "http://localhost:1234/node", "description": "node", "type": "object", "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} }, "required": ["value"] } } }, "tests": [ { "description": "valid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": 1.1}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": true }, { "description": "invalid tree", "data": { "meta": "root", "nodes": [ { "value": 1, "subtree": { "meta": "child", "nodes": [ {"value": "string is invalid"}, {"value": 1.2} ] } }, { "value": 2, "subtree": { "meta": "child", "nodes": [ {"value": 2.1}, {"value": 2.2} ] } } ] }, "valid": false } ] }, { "description": "refs with quote", "schema": { "properties": { "foo\"bar": {"$ref": "#/definitions/foo%22bar"} }, "definitions": { "foo\"bar": {"type": "number"} } }, "tests": [ { "description": "object with numbers is valid", "data": { "foo\"bar": 1 }, "valid": true }, { "description": "object with strings is invalid", "data": { "foo\"bar": "1" }, "valid": false } ] }, { "description": "Location-independent identifier", "schema": { "allOf": [{ "$ref": "#foo" }], "definitions": { "A": { "$id": "#foo", "type": "integer" } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "Location-independent identifier with base URI change in subschema", "schema": { "$id": "http://localhost:1234/root", "allOf": [{ "$ref": "http://localhost:1234/nested.json#foo" }], "definitions": { "A": { "$id": "nested.json", "definitions": { "B": { "$id": "#foo", "type": "integer" } } } } }, "tests": [ { "data": 1, "description": "match", "valid": true }, { "data": "a", "description": "mismatch", "valid": false } ] }, { "description": "naive replacement of $ref with its destination is not correct", "schema": { "definitions": { "a_string": { "type": "string" } }, "enum": [ { "$ref": "#/definitions/a_string" } ] }, "tests": [ { "description": "do not evaluate the $ref inside the enum, matching any string", "data": "this is a string", "valid": false }, { "description": "do not evaluate the $ref inside the enum, definition exact match", "data": { "type": "string" }, "valid": false }, { "description": "match the enum exactly", "data": { "$ref": "#/definitions/a_string" }, "valid": true } ] }, { "description": "refs with relative uris and defs", "schema": { "$id": "http://example.com/schema-relative-uri-defs1.json", "properties": { "foo": { "$id": "schema-relative-uri-defs2.json", "definitions": { "inner": { "properties": { "bar": { "type": "string" } } } }, "allOf": [ { "$ref": "#/definitions/inner" } ] } }, "allOf": [ { "$ref": "schema-relative-uri-defs2.json" } ] }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] }, { "description": "relative refs with absolute uris and defs", "schema": { "$id": "http://example.com/schema-refs-absolute-uris-defs1.json", "properties": { "foo": { "$id": "http://example.com/schema-refs-absolute-uris-defs2.json", "definitions": { "inner": { "properties": { "bar": { "type": "string" } } } }, "allOf": [ { "$ref": "#/definitions/inner" } ] } }, "allOf": [ { "$ref": "schema-refs-absolute-uris-defs2.json" } ] }, "tests": [ { "description": "invalid on inner field", "data": { "foo": { "bar": 1 }, "bar": "a" }, "valid": false }, { "description": "invalid on outer field", "data": { "foo": { "bar": "a" }, "bar": 1 }, "valid": false }, { "description": "valid on both fields", "data": { "foo": { "bar": "a" }, "bar": "a" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/maximum.json000640 000766 000024 00000002704 14163671560 024715 0ustar00etherstaff000000 000000 [ { "description": "maximum validation", "schema": {"maximum": 3.0}, "tests": [ { "description": "below the maximum is valid", "data": 2.6, "valid": true }, { "description": "boundary point is valid", "data": 3.0, "valid": true }, { "description": "above the maximum is invalid", "data": 3.5, "valid": false }, { "description": "ignores non-numbers", "data": "x", "valid": true } ] }, { "description": "maximum validation with unsigned integer", "schema": {"maximum": 300}, "tests": [ { "description": "below the maximum is invalid", "data": 299.97, "valid": true }, { "description": "boundary point integer is valid", "data": 300, "valid": true }, { "description": "boundary point float is valid", "data": 300.00, "valid": true }, { "description": "above the maximum is invalid", "data": 300.5, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/minLength.json000640 000766 000024 00000001566 14163671560 025172 0ustar00etherstaff000000 000000 [ { "description": "minLength validation", "schema": {"minLength": 2}, "tests": [ { "description": "longer is valid", "data": "foo", "valid": true }, { "description": "exact length is valid", "data": "fo", "valid": true }, { "description": "too short is invalid", "data": "f", "valid": false }, { "description": "ignores non-strings", "data": 1, "valid": true }, { "description": "one supplementary Unicode code point is not long enough", "data": "\uD83D\uDCA9", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/maxItems.json000640 000766 000024 00000001302 14163671560 025020 0ustar00etherstaff000000 000000 [ { "description": "maxItems validation", "schema": {"maxItems": 2}, "tests": [ { "description": "shorter is valid", "data": [1], "valid": true }, { "description": "exact length is valid", "data": [1, 2], "valid": true }, { "description": "too long is invalid", "data": [1, 2, 3], "valid": false }, { "description": "ignores non-arrays", "data": "foobar", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/contains.json000640 000766 000024 00000007251 14163671560 025060 0ustar00etherstaff000000 000000 [ { "description": "contains keyword validation", "schema": { "contains": {"minimum": 5} }, "tests": [ { "description": "array with item matching schema (5) is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with item matching schema (6) is valid", "data": [3, 4, 6], "valid": true }, { "description": "array with two items matching schema (5, 6) is valid", "data": [3, 4, 5, 6], "valid": true }, { "description": "array without items matching schema is invalid", "data": [2, 3, 4], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "not array is valid", "data": {}, "valid": true } ] }, { "description": "contains keyword with const keyword", "schema": { "contains": { "const": 5 } }, "tests": [ { "description": "array with item 5 is valid", "data": [3, 4, 5], "valid": true }, { "description": "array with two items 5 is valid", "data": [3, 4, 5, 5], "valid": true }, { "description": "array without item 5 is invalid", "data": [1, 2, 3, 4], "valid": false } ] }, { "description": "contains keyword with boolean schema true", "schema": {"contains": true}, "tests": [ { "description": "any non-empty array is valid", "data": ["foo"], "valid": true }, { "description": "empty array is invalid", "data": [], "valid": false } ] }, { "description": "contains keyword with boolean schema false", "schema": {"contains": false}, "tests": [ { "description": "any non-empty array is invalid", "data": ["foo"], "valid": false }, { "description": "empty array is invalid", "data": [], "valid": false }, { "description": "non-arrays are valid", "data": "contains does not apply to strings", "valid": true } ] }, { "description": "items + contains", "schema": { "items": { "multipleOf": 2 }, "contains": { "multipleOf": 3 } }, "tests": [ { "description": "matches items, does not match contains", "data": [ 2, 4, 8 ], "valid": false }, { "description": "does not match items, matches contains", "data": [ 3, 6, 9 ], "valid": false }, { "description": "matches both items and contains", "data": [ 6, 12 ], "valid": true }, { "description": "matches neither items nor contains", "data": [ 1, 5 ], "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/bignum.json000640 000766 000024 00000005361 14163671560 026350 0ustar00etherstaff000000 000000 [ { "description": "integer", "schema": { "type": "integer" }, "tests": [ { "description": "a bignum is an integer", "data": 12345678910111213141516171819202122232425262728293031, "valid": true }, { "description": "a negative bignum is an integer", "data": -12345678910111213141516171819202122232425262728293031, "valid": true } ] }, { "description": "number", "schema": { "type": "number" }, "tests": [ { "description": "a bignum is a number", "data": 98249283749234923498293171823948729348710298301928331, "valid": true }, { "description": "a negative bignum is a number", "data": -98249283749234923498293171823948729348710298301928331, "valid": true } ] }, { "description": "string", "schema": { "type": "string" }, "tests": [ { "description": "a bignum is not a string", "data": 98249283749234923498293171823948729348710298301928331, "valid": false } ] }, { "description": "integer comparison", "schema": { "maximum": 18446744073709551615 }, "tests": [ { "description": "comparison works for high numbers", "data": 18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision", "schema": { "exclusiveMaximum": 972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for high numbers", "data": 972783798187987123879878123.188781371, "valid": false } ] }, { "description": "integer comparison", "schema": { "minimum": -18446744073709551615 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -18446744073709551600, "valid": true } ] }, { "description": "float comparison with high precision on negative numbers", "schema": { "exclusiveMinimum": -972783798187987123879878123.18878137 }, "tests": [ { "description": "comparison works for very negative numbers", "data": -972783798187987123879878123.188781371, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/unicode.json000644 000766 000024 00000000002 14163671560 026504 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/non-bmp-regex.json000640 000766 000024 00000004536 14163671560 027550 0ustar00etherstaff000000 000000 [ { "description": "Proper UTF-16 surrogate pair handling: pattern", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "pattern": "^🐲*$" }, "tests": [ { "description": "matches empty", "data": "", "valid": true }, { "description": "matches single", "data": "🐲", "valid": true }, { "description": "matches two", "data": "🐲🐲", "valid": true }, { "description": "doesn't match one", "data": "🐉", "valid": false }, { "description": "doesn't match two", "data": "🐉🐉", "valid": false }, { "description": "doesn't match one ASCII", "data": "D", "valid": false }, { "description": "doesn't match two ASCII", "data": "DD", "valid": false } ] }, { "description": "Proper UTF-16 surrogate pair handling: patternProperties", "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", "schema": { "patternProperties": { "^🐲*$": { "type": "integer" } } }, "tests": [ { "description": "matches empty", "data": { "": 1 }, "valid": true }, { "description": "matches single", "data": { "🐲": 1 }, "valid": true }, { "description": "matches two", "data": { "🐲🐲": 1 }, "valid": true }, { "description": "doesn't match one", "data": { "🐲": "hello" }, "valid": false }, { "description": "doesn't match two", "data": { "🐲🐲": "hello" }, "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/000770 000766 000024 00000000000 14163671560 025460 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/float-overflow.json000640 000766 000024 00000000551 14163671560 030031 0ustar00etherstaff000000 000000 [ { "description": "all integers are multiples of 0.5, if overflow is handled", "schema": {"type": "integer", "multipleOf": 0.5}, "tests": [ { "description": "valid if optional overflow handling is implemented", "data": 1e308, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/ecmascript-regex.json000640 000766 000024 00000044205 14163671560 030331 0ustar00etherstaff000000 000000 [ { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { "type": "string", "pattern": "^abc$" }, "tests": [ { "description": "matches in Python, but should not in jsonschema", "data": "abc\\n", "valid": false }, { "description": "should match", "data": "abc", "valid": true } ] }, { "description": "ECMA 262 regex converts \\t to horizontal tab", "schema": { "type": "string", "pattern": "^\\t$" }, "tests": [ { "description": "does not match", "data": "\\t", "valid": false }, { "description": "matches", "data": "\u0009", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and upper letter", "schema": { "type": "string", "pattern": "^\\cC$" }, "tests": [ { "description": "does not match", "data": "\\cC", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 regex escapes control codes with \\c and lower letter", "schema": { "type": "string", "pattern": "^\\cc$" }, "tests": [ { "description": "does not match", "data": "\\cc", "valid": false }, { "description": "matches", "data": "\u0003", "valid": true } ] }, { "description": "ECMA 262 \\d matches ascii digits only", "schema": { "type": "string", "pattern": "^\\d$" }, "tests": [ { "description": "ASCII zero matches", "data": "0", "valid": true }, { "description": "NKO DIGIT ZERO does not match (unlike e.g. Python)", "data": "߀", "valid": false }, { "description": "NKO DIGIT ZERO (as \\u escape) does not match", "data": "\u07c0", "valid": false } ] }, { "description": "ECMA 262 \\D matches everything but ascii digits", "schema": { "type": "string", "pattern": "^\\D$" }, "tests": [ { "description": "ASCII zero does not match", "data": "0", "valid": false }, { "description": "NKO DIGIT ZERO matches (unlike e.g. Python)", "data": "߀", "valid": true }, { "description": "NKO DIGIT ZERO (as \\u escape) matches", "data": "\u07c0", "valid": true } ] }, { "description": "ECMA 262 \\w matches ascii letters only", "schema": { "type": "string", "pattern": "^\\w$" }, "tests": [ { "description": "ASCII 'a' matches", "data": "a", "valid": true }, { "description": "latin-1 e-acute does not match (unlike e.g. Python)", "data": "é", "valid": false } ] }, { "description": "ECMA 262 \\W matches everything but ascii letters", "schema": { "type": "string", "pattern": "^\\W$" }, "tests": [ { "description": "ASCII 'a' does not match", "data": "a", "valid": false }, { "description": "latin-1 e-acute matches (unlike e.g. Python)", "data": "é", "valid": true } ] }, { "description": "ECMA 262 \\s matches whitespace", "schema": { "type": "string", "pattern": "^\\s$" }, "tests": [ { "description": "ASCII space matches", "data": " ", "valid": true }, { "description": "Character tabulation matches", "data": "\t", "valid": true }, { "description": "Line tabulation matches", "data": "\u000b", "valid": true }, { "description": "Form feed matches", "data": "\u000c", "valid": true }, { "description": "latin-1 non-breaking-space matches", "data": "\u00a0", "valid": true }, { "description": "zero-width whitespace matches", "data": "\ufeff", "valid": true }, { "description": "line feed matches (line terminator)", "data": "\u000a", "valid": true }, { "description": "paragraph separator matches (line terminator)", "data": "\u2029", "valid": true }, { "description": "EM SPACE matches (Space_Separator)", "data": "\u2003", "valid": true }, { "description": "Non-whitespace control does not match", "data": "\u0001", "valid": false }, { "description": "Non-whitespace does not match", "data": "\u2013", "valid": false } ] }, { "description": "ECMA 262 \\S matches everything but whitespace", "schema": { "type": "string", "pattern": "^\\S$" }, "tests": [ { "description": "ASCII space does not match", "data": " ", "valid": false }, { "description": "Character tabulation does not match", "data": "\t", "valid": false }, { "description": "Line tabulation does not match", "data": "\u000b", "valid": false }, { "description": "Form feed does not match", "data": "\u000c", "valid": false }, { "description": "latin-1 non-breaking-space does not match", "data": "\u00a0", "valid": false }, { "description": "zero-width whitespace does not match", "data": "\ufeff", "valid": false }, { "description": "line feed does not match (line terminator)", "data": "\u000a", "valid": false }, { "description": "paragraph separator does not match (line terminator)", "data": "\u2029", "valid": false }, { "description": "EM SPACE does not match (Space_Separator)", "data": "\u2003", "valid": false }, { "description": "Non-whitespace control matches", "data": "\u0001", "valid": true }, { "description": "Non-whitespace matches", "data": "\u2013", "valid": true } ] }, { "description": "unicode semantics should be used for all pattern matching", "schema": { "pattern": "\\p{Letter}cole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "\\w in patterns matches [A-Za-z0-9_], not unicode letters", "schema": { "pattern": "\\wcole" }, "tests": [ { "description": "ascii character in json string", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true }, { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode matching is case-sensitive", "data": "LES HIVERS DE MON ENFANCE ÉTAIENT DES SAISONS LONGUES, LONGUES. NOUS VIVIONS EN TROIS LIEUX: L'ÉCOLE, L'ÉGLISE ET LA PATINOIRE; MAIS LA VRAIE VIE ÉTAIT SUR LA PATINOIRE.", "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "pattern": "[a-z]cole" }, "tests": [ { "description": "literal unicode character in json string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "unicode character in hex format in string", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'\u00e9cole, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": false }, { "description": "ascii characters match", "data": "Les hivers de mon enfance etaient des saisons longues, longues. Nous vivions en trois lieux: l'ecole, l'eglise et la patinoire; mais la vraie vie etait sur la patinoire.", "valid": true } ] }, { "description": "\\d in pattern matches [0-9], not unicode digits", "schema": { "pattern": "^\\d+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "pattern": "^\\p{digit}+$" }, "tests": [ { "description": "ascii digits", "data": "42", "valid": true }, { "description": "ascii non-digits", "data": "-%#", "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": "৪২", "valid": true } ] }, { "description": "unicode semantics should be used for all patternProperties matching", "schema": { "type": "object", "patternProperties": { "\\p{Letter}cole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": true }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": true }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "\\w in patternProperties matches [A-Za-z0-9_], not unicode letters", "schema": { "type": "object", "patternProperties": { "\\wcole": true }, "additionalProperties": false }, "tests": [ { "description": "ascii character in json string", "data": { "l'ecole": "pas de vraie vie" }, "valid": true }, { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "unicode matching is case-sensitive", "data": { "L'ÉCOLE": "PAS DE VRAIE VIE" }, "valid": false } ] }, { "description": "unicode characters do not match ascii ranges", "schema": { "type": "object", "patternProperties": { "[a-z]cole": true }, "additionalProperties": false }, "tests": [ { "description": "literal unicode character in json string", "data": { "l'école": "pas de vraie vie" }, "valid": false }, { "description": "unicode character in hex format in string", "data": { "l'\u00e9cole": "pas de vraie vie" }, "valid": false }, { "description": "ascii characters match", "data": { "l'ecole": "pas de vraie vie" }, "valid": true } ] }, { "description": "\\d in patternProperties matches [0-9], not unicode digits", "schema": { "type": "object", "patternProperties": { "^\\d+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": false } ] }, { "description": "unicode digits are more than 0 through 9", "schema": { "type": "object", "patternProperties": { "^\\p{digit}+$": true }, "additionalProperties": false }, "tests": [ { "description": "ascii digits", "data": { "42": "life, the universe, and everything" }, "valid": true }, { "description": "ascii non-digits", "data": { "-%#": "spending the year dead for tax reasons" }, "valid": false }, { "description": "non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)", "data": { "৪২": "khajit has wares if you have coin" }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format.json000644 000766 000024 00000000002 14163671560 026346 0ustar00etherstaff000000 000000 []Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/json-pointer.json000640 000766 000024 00000015063 14163671560 031006 0ustar00etherstaff000000 000000 [ { "description": "validation of JSON-pointers (JSON String Representation)", "schema": { "format": "json-pointer" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid JSON-pointer", "data": "/foo/bar~0/baz~1/%a", "valid": true }, { "description": "not a valid JSON-pointer (~ not escaped)", "data": "/foo/bar~", "valid": false }, { "description": "valid JSON-pointer with empty segment", "data": "/foo//bar", "valid": true }, { "description": "valid JSON-pointer with the last empty segment", "data": "/foo/bar/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #1", "data": "", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #2", "data": "/foo", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #3", "data": "/foo/0", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #4", "data": "/", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #5", "data": "/a~1b", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #6", "data": "/c%d", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #7", "data": "/e^f", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #8", "data": "/g|h", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #9", "data": "/i\\j", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #10", "data": "/k\"l", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #11", "data": "/ ", "valid": true }, { "description": "valid JSON-pointer as stated in RFC 6901 #12", "data": "/m~0n", "valid": true }, { "description": "valid JSON-pointer used adding to the last array position", "data": "/foo/-", "valid": true }, { "description": "valid JSON-pointer (- used as object member name)", "data": "/foo/-/bar", "valid": true }, { "description": "valid JSON-pointer (multiple escaped characters)", "data": "/~1~0~0~1~1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #1", "data": "/~1.1", "valid": true }, { "description": "valid JSON-pointer (escaped with fraction part) #2", "data": "/~0.1", "valid": true }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #1", "data": "#", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #2", "data": "#/", "valid": false }, { "description": "not a valid JSON-pointer (URI Fragment Identifier) #3", "data": "#a", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #1", "data": "/~0~", "valid": false }, { "description": "not a valid JSON-pointer (some escaped, but not all) #2", "data": "/~0/~", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #1", "data": "/~2", "valid": false }, { "description": "not a valid JSON-pointer (wrong escape character) #2", "data": "/~-1", "valid": false }, { "description": "not a valid JSON-pointer (multiple characters not escaped)", "data": "/~~", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1", "data": "a", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2", "data": "0", "valid": false }, { "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3", "data": "a/a", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/uri.json000640 000766 000024 00000007165 14163671560 027162 0ustar00etherstaff000000 000000 [ { "description": "validation of URIs", "schema": { "format": "uri" }, "tests": [ { "description": "a valid URL with anchor tag", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid URL with anchor tag and parentheses", "data": "http://foo.com/blah_(wikipedia)_blah#cite-1", "valid": true }, { "description": "a valid URL with URL-encoded stuff", "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff", "valid": true }, { "description": "a valid puny-coded URL ", "data": "http://xn--nw2a.xn--j6w193g/", "valid": true }, { "description": "a valid URL with many special characters", "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com", "valid": true }, { "description": "a valid URL based on IPv4", "data": "http://223.255.255.254", "valid": true }, { "description": "a valid URL with ftp scheme", "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt", "valid": true }, { "description": "a valid URL for a simple text file", "data": "http://www.ietf.org/rfc/rfc2396.txt", "valid": true }, { "description": "a valid URL ", "data": "ldap://[2001:db8::7]/c=GB?objectClass?one", "valid": true }, { "description": "a valid mailto URI", "data": "mailto:John.Doe@example.com", "valid": true }, { "description": "a valid newsgroup URI", "data": "news:comp.infosystems.www.servers.unix", "valid": true }, { "description": "a valid tel URI", "data": "tel:+1-816-555-1212", "valid": true }, { "description": "a valid URN", "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", "valid": true }, { "description": "an invalid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": false }, { "description": "an invalid relative URI Reference", "data": "/abc", "valid": false }, { "description": "an invalid URI", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "an invalid URI though valid URI reference", "data": "abc", "valid": false }, { "description": "an invalid URI with spaces", "data": "http:// shouldfail.com", "valid": false }, { "description": "an invalid URI with spaces and missing scheme", "data": ":// should fail", "valid": false }, { "description": "an invalid URI with comma in scheme", "data": "bar,baz:foo", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/uri-template.json000640 000766 000024 00000003431 14163671560 030763 0ustar00etherstaff000000 000000 [ { "description": "format: uri-template", "schema": { "format": "uri-template" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid uri-template", "data": "http://example.com/dictionary/{term:1}/{term}", "valid": true }, { "description": "an invalid uri-template", "data": "http://example.com/dictionary/{term:1}/{term", "valid": false }, { "description": "a valid uri-template without variables", "data": "http://example.com/dictionary", "valid": true }, { "description": "a valid relative uri-template", "data": "dictionary/{term:1}/{term}", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/ipv4.json000640 000766 000024 00000005415 14163671560 027241 0ustar00etherstaff000000 000000 [ { "description": "validation of IP addresses", "schema": { "format": "ipv4" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IP address", "data": "192.168.0.1", "valid": true }, { "description": "an IP address with too many components", "data": "127.0.0.0.1", "valid": false }, { "description": "an IP address with out-of-range values", "data": "256.256.256.256", "valid": false }, { "description": "an IP address without 4 components", "data": "127.0", "valid": false }, { "description": "an IP address as an integer", "data": "0x7f000001", "valid": false }, { "description": "an IP address as an integer (decimal)", "data": "2130706433", "valid": false }, { "description": "leading zeroes should be rejected, as they are treated as octals", "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", "data": "087.10.0.1", "valid": false }, { "description": "value without leading zero is valid", "data": "87.10.0.1", "valid": true }, { "description": "non-ascii digits should be rejected", "data": "1২7.0.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/uri-reference.json000640 000766 000024 00000004237 14163671560 031113 0ustar00etherstaff000000 000000 [ { "description": "validation of URI References", "schema": { "format": "uri-reference" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid URI", "data": "http://foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid protocol-relative URI Reference", "data": "//foo.bar/?baz=qux#quux", "valid": true }, { "description": "a valid relative URI Reference", "data": "/abc", "valid": true }, { "description": "an invalid URI Reference", "data": "\\\\WINDOWS\\fileshare", "valid": false }, { "description": "a valid URI Reference", "data": "abc", "valid": true }, { "description": "a valid URI fragment", "data": "#fragment", "valid": true }, { "description": "an invalid URI fragment", "data": "#frag\\ment", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/ipv6.json000640 000766 000024 00000015440 14163671560 027242 0ustar00etherstaff000000 000000 [ { "description": "validation of IPv6 addresses", "schema": { "format": "ipv6" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid IPv6 address", "data": "::1", "valid": true }, { "description": "an IPv6 address with out-of-range values", "data": "12345::", "valid": false }, { "description": "trailing 4 hex symbols is valid", "data": "::abef", "valid": true }, { "description": "trailing 5 hex symbols is invalid", "data": "::abcef", "valid": false }, { "description": "an IPv6 address with too many components", "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", "valid": false }, { "description": "an IPv6 address containing illegal characters", "data": "::laptop", "valid": false }, { "description": "no digits is valid", "data": "::", "valid": true }, { "description": "leading colons is valid", "data": "::42:ff:1", "valid": true }, { "description": "trailing colons is valid", "data": "d6::", "valid": true }, { "description": "missing leading octet is invalid", "data": ":2:3:4:5:6:7:8", "valid": false }, { "description": "missing trailing octet is invalid", "data": "1:2:3:4:5:6:7:", "valid": false }, { "description": "missing leading octet with omitted octets later", "data": ":2:3:4::8", "valid": false }, { "description": "single set of double colons in the middle is valid", "data": "1:d6::42", "valid": true }, { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false }, { "description": "mixed format with the ipv4 section as decimal octets", "data": "1::d6:192.168.0.1", "valid": true }, { "description": "mixed format with double colons between the sections", "data": "1:2::192.168.0.1", "valid": true }, { "description": "mixed format with ipv4 section with octet out of range", "data": "1::2:192.168.256.1", "valid": false }, { "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false }, { "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", "data": "::ffff:192.168.0.1", "valid": true }, { "description": "triple colons is invalid", "data": "1:2:3:4:5:::8", "valid": false }, { "description": "8 octets", "data": "1:2:3:4:5:6:7:8", "valid": true }, { "description": "insufficient octets without double colons", "data": "1:2:3:4:5:6:7", "valid": false }, { "description": "no colons is invalid", "data": "1", "valid": false }, { "description": "ipv4 is not ipv6", "data": "127.0.0.1", "valid": false }, { "description": "ipv4 segment must have 4 octets", "data": "1:2:3:4:1.2.3", "valid": false }, { "description": "leading whitespace is invalid", "data": " ::1", "valid": false }, { "description": "trailing whitespace is invalid", "data": "::1 ", "valid": false }, { "description": "netmask is not a part of ipv6 address", "data": "fe80::/64", "valid": false }, { "description": "zone id is not a part of ipv6 address", "data": "fe80::a%eth1", "valid": false }, { "description": "a long valid ipv6", "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", "valid": true }, { "description": "a long invalid ipv6, below length limit, first", "data": "100:100:100:100:100:100:255.255.255.255.255", "valid": false }, { "description": "a long invalid ipv6, below length limit, second", "data": "100:100:100:100:100:100:100:255.255.255.255", "valid": false }, { "description": "non-ascii digits should be rejected", "data": "1:2:3:4:5:6:7:৪", "valid": false }, { "description": "non-ascii digits should be rejected in the ipv4 portion also", "data": "1:2::192.16৪.0.1", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/hostname.json000640 000766 000024 00000006224 14163671560 030174 0ustar00etherstaff000000 000000 [ { "description": "validation of host names", "schema": { "format": "hostname" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid host name", "data": "www.example.com", "valid": true }, { "description": "a valid punycoded IDN hostname", "data": "xn--4gbwdl.xn--wgbh1c", "valid": true }, { "description": "a host name starting with an illegal character", "data": "-a-host-name-that-starts-with--", "valid": false }, { "description": "a host name containing illegal characters", "data": "not_a_valid_host_name", "valid": false }, { "description": "a host name with a component too long", "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", "valid": false }, { "description": "starts with hyphen", "data": "-hostname", "valid": false }, { "description": "ends with hyphen", "data": "hostname-", "valid": false }, { "description": "starts with underscore", "data": "_hostname", "valid": false }, { "description": "ends with underscore", "data": "hostname_", "valid": false }, { "description": "contains underscore", "data": "host_name", "valid": false }, { "description": "maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", "valid": true }, { "description": "exceeds maximum label length", "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/email.json000640 000766 000024 00000005104 14163671560 027441 0ustar00etherstaff000000 000000 [ { "description": "validation of e-mail addresses", "schema": { "format": "email" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid e-mail address", "data": "joe.bloggs@example.com", "valid": true }, { "description": "an invalid e-mail address", "data": "2962", "valid": false }, { "description": "tilde in local part is valid", "data": "te~st@example.com", "valid": true }, { "description": "tilde before local part is valid", "data": "~test@example.com", "valid": true }, { "description": "tilde after local part is valid", "data": "test~@example.com", "valid": true }, { "description": "dot before local part is not valid", "data": ".test@example.com", "valid": false }, { "description": "dot after local part is not valid", "data": "test.@example.com", "valid": false }, { "description": "two separated dots inside local part are valid", "data": "te.s.t@example.com", "valid": true }, { "description": "two subsequent dots inside local part are not valid", "data": "te..st@example.com", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/share/tests/draft6/optional/format/date-time.json000640 000766 000024 00000011064 14163671560 030225 0ustar00etherstaff000000 000000 [ { "description": "validation of date-time strings", "schema": { "format": "date-time" }, "tests": [ { "description": "all string formats ignore integers", "data": 12, "valid": true }, { "description": "all string formats ignore floats", "data": 13.7, "valid": true }, { "description": "all string formats ignore objects", "data": {}, "valid": true }, { "description": "all string formats ignore arrays", "data": [], "valid": true }, { "description": "all string formats ignore booleans", "data": false, "valid": true }, { "description": "all string formats ignore nulls", "data": null, "valid": true }, { "description": "a valid date-time string", "data": "1963-06-19T08:30:06.283185Z", "valid": true }, { "description": "a valid date-time string without second fraction", "data": "1963-06-19T08:30:06Z", "valid": true }, { "description": "a valid date-time string with plus offset", "data": "1937-01-01T12:00:27.87+00:20", "valid": true }, { "description": "a valid date-time string with minus offset", "data": "1990-12-31T15:59:50.123-08:00", "valid": true }, { "description": "a valid date-time with a leap second, UTC", "data": "1998-12-31T23:59:60Z", "valid": true }, { "description": "a valid date-time with a leap second, with minus offset", "data": "1998-12-31T15:59:60.123-08:00", "valid": true }, { "description": "an invalid date-time past leap second, UTC", "data": "1998-12-31T23:59:61Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong minute, UTC", "data": "1998-12-31T23:58:60Z", "valid": false }, { "description": "an invalid date-time with leap second on a wrong hour, UTC", "data": "1998-12-31T22:59:60Z", "valid": false }, { "description": "an invalid day in date-time string", "data": "1990-02-31T15:59:59.123-08:00", "valid": false }, { "description": "an invalid offset in date-time string", "data": "1990-12-31T15:59:59-24:00", "valid": false }, { "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", "valid": false }, { "description": "case-insensitive T and Z", "data": "1963-06-19t08:30:06.283185z", "valid": true }, { "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false }, { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", "valid": false }, { "description": "non-ascii digits should be rejected in the date portion", "data": "1963-06-1৪T00:00:00Z", "valid": false }, { "description": "non-ascii digits should be rejected in the time portion", "data": "1963-06-11T0৪:00:00Z", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/lib/Test/000770 000766 000024 00000000000 14163671560 020376 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/lib/Test/JSON/000770 000766 000024 00000000000 14163671560 021147 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/lib/Test/JSON/Schema/000770 000766 000024 00000000000 14163671560 022347 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/lib/Test/JSON/Schema/Acceptance.pm000640 000766 000024 00000064115 14163671560 024741 0ustar00etherstaff000000 000000 use strict; use warnings; package Test::JSON::Schema::Acceptance; # git description: v1.014-9-gfc785a3 # vim: set ts=8 sts=2 sw=2 tw=100 et : # ABSTRACT: Acceptance testing for JSON-Schema based validators like JSON::Schema our $VERSION = '1.015'; use 5.020; use Moo; use strictures 2; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API (); use Test2::Todo; use Test2::Tools::Compare (); use JSON::MaybeXS 1.004001; use File::ShareDir 'dist_dir'; use Feature::Compat::Try; use MooX::TypeTiny 0.002002; use Types::Standard 1.010002 qw(Str InstanceOf ArrayRef HashRef Dict Any HasMethods Bool Optional); use Types::Common::Numeric 'PositiveOrZeroInt'; use Path::Tiny 0.069; use List::Util 1.33 qw(any max sum0); use Ref::Util qw(is_plain_arrayref is_plain_hashref is_ref); use namespace::clean; has specification => ( is => 'ro', isa => Str, lazy => 1, default => 'draft2020-12', predicate => '_has_specification', ); # specification version => metaschema URI use constant METASCHEMA => { 'draft-next' => 'https://json-schema.org/draft/next/schema', 'draft2020-12' => 'https://json-schema.org/draft/2020-12/schema', 'draft2019-09' => 'https://json-schema.org/draft/2019-09/schema', 'draft7' => 'http://json-schema.org/draft-07/schema#', 'draft6' => 'http://json-schema.org/draft-06/schema#', 'draft4' => 'http://json-schema.org/draft-04/schema#', }; has test_dir => ( is => 'ro', isa => InstanceOf['Path::Tiny'], coerce => sub { path($_[0])->absolute('.') }, lazy => 1, builder => '_build_test_dir', predicate => '_has_test_dir', ); sub _build_test_dir { path(dist_dir('Test-JSON-Schema-Acceptance'), 'tests', $_[0]->specification) }; has additional_resources => ( is => 'ro', isa => InstanceOf['Path::Tiny'], coerce => sub { path($_[0])->absolute('.') }, lazy => 1, default => sub { $_[0]->test_dir->parent->parent->child('remotes') }, ); has verbose => ( is => 'ro', isa => Bool, default => 0, ); has include_optional => ( is => 'ro', isa => Bool, default => 0, ); has skip_dir => ( is => 'ro', isa => ArrayRef[Str], coerce => sub { ref($_[0]) ? $_[0] : [ $_[0] ] }, lazy => 1, default => sub { [] }, ); has test_schemas => ( is => 'ro', isa => Bool, ); has results => ( is => 'rwp', init_arg => undef, isa => ArrayRef[Dict[ file => InstanceOf['Path::Tiny'], map +($_ => PositiveOrZeroInt), qw(pass todo_fail fail), ]], ); has results_text => ( is => 'ro', init_arg => undef, isa => Str, lazy => 1, builder => '_build_results_text', ); around BUILDARGS => sub ($orig, $class, @args) { my %args = @args % 2 ? ( specification => 'draft'.$args[0] ) : @args; $args{specification} = 'draft2020-12' if ($args{specification} // '') eq 'latest'; $class->$orig(\%args); }; sub BUILD ($self, @) { -d $self->test_dir or die 'test_dir does not exist: '.$self->test_dir; } sub acceptance { my $self = shift; my $options = +{ ref $_[0] eq 'CODE' ? (validate_json_string => @_) : @_ }; die 'require one or the other of "validate_data", "validate_json_string"' if not $options->{validate_data} and not $options->{validate_json_string}; die 'cannot provide both "validate_data" and "validate_json_string"' if $options->{validate_data} and $options->{validate_json_string}; warn "'skip_tests' option is deprecated" if $options->{skip_tests}; my $ctx = Test2::API::context; if ($options->{add_resource} and -d $self->additional_resources) { my $base = 'http://localhost:1234'; # TODO? make this customizable $ctx->note('adding resources from '.$self->additional_resources.' with the base URI "'.$base.'"...'); $self->additional_resources->visit( sub ($path, @) { return if not $path->is_file or $path !~ /\.json$/; my $data = $self->json_decoder->decode($path->slurp_raw); my $file = $path->relative($self->additional_resources); my $uri = $base.'/'.$file; $options->{add_resource}->($uri => $data); }, { recurse => 1 }, ); } $ctx->note('running tests in '.$self->test_dir.' against ' .($self->_has_specification ? $self->specification : 'unknown version').'...'); my $tests = $self->_test_data; # [ { file => .., pass => .., fail => .. }, ... ] my @results; foreach my $one_file (@$tests) { my %results; next if $options->{tests} and $options->{tests}{file} and not grep $_ eq $one_file->{file}, (ref $options->{tests}{file} eq 'ARRAY' ? $options->{tests}{file}->@* : $options->{tests}{file}); $ctx->note(''); foreach my $test_group ($one_file->{json}->@*) { next if $options->{tests} and $options->{tests}{group_description} and not grep $_ eq $test_group->{description}, (ref $options->{tests}{group_description} eq 'ARRAY' ? $options->{tests}{group_description}->@* : $options->{tests}{group_description}); my $todo; $todo = Test2::Todo->new(reason => 'Test marked TODO via "todo_tests"') if $options->{todo_tests} and any { my $o = $_; (not $o->{file} or grep $_ eq $one_file->{file}, (ref $o->{file} eq 'ARRAY' ? $o->{file}->@* : $o->{file})) and (not $o->{group_description} or grep $_ eq $test_group->{description}, (ref $o->{group_description} eq 'ARRAY' ? $o->{group_description}->@* : $o->{group_description})) and not $o->{test_description} } $options->{todo_tests}->@*; my $schema_fails; if ($self->test_schemas) { die 'specification_version unknown: cannot evaluate schema against metaschema' if not $self->_has_specification; my $metaspec_uri = METASCHEMA->{$self->specification}; my $result = $options->{validate_data} ? $options->{validate_data}->($metaspec_uri, $test_group->{schema}) # we use the decoder here so we don't prettify the string : $options->{validate_json_string}->($metaspec_uri, $self->json_decoder->encode($test_group->{schema})); if (not $result) { $ctx->fail('schema for '.$one_file->{file}.': "'.$test_group->{description}.'" fails to validate against '.$metaspec_uri.':'); $ctx->note($self->json_encoder->encode($result)); $schema_fails = 1; } } foreach my $test ($test_group->{tests}->@*) { next if $options->{tests} and $options->{tests}{test_description} and not grep $_ eq $test->{description}, (ref $options->{tests}{test_description} eq 'ARRAY' ? $options->{tests}{test_description}->@* : $options->{tests}{test_description}); my $todo; $todo = Test2::Todo->new(reason => 'Test marked TODO via deprecated "skip_tests"') if ref $options->{skip_tests} eq 'ARRAY' and grep +(($test_group->{description}.' - '.$test->{description}) =~ /$_/), $options->{skip_tests}->@*; $todo = Test2::Todo->new(reason => 'Test marked TODO via "todo_tests"') if $options->{todo_tests} and any { my $o = $_; (not $o->{file} or grep $_ eq $one_file->{file}, (ref $o->{file} eq 'ARRAY' ? $o->{file}->@* : $o->{file})) and (not $o->{group_description} or grep $_ eq $test_group->{description}, (ref $o->{group_description} eq 'ARRAY' ? $o->{group_description}->@* : $o->{group_description})) and (not $o->{test_description} or grep $_ eq $test->{description}, (ref $o->{test_description} eq 'ARRAY' ? $o->{test_description}->@* : $o->{test_description})) } $options->{todo_tests}->@*; my $result = $self->_run_test($one_file, $test_group, $test, $options); $result = 0 if $schema_fails; ++$results{ $result ? 'pass' : $todo ? 'todo_fail' : 'fail' }; } } push @results, { file => $one_file->{file}, pass => 0, 'todo_fail' => 0, fail => 0, %results }; } $self->_set_results(\@results); my $diag = $self->verbose ? 'diag' : 'note'; $ctx->$diag("\n\n".$self->results_text); $ctx->$diag(''); if ($self->test_dir !~ m{\boptional\b} and grep +($_->{file} !~ m{^optional/} && $_->{todo_fail} + $_->{fail}), @results) { # non-optional test failures will always be visible, even when not in verbose mode. $ctx->diag('WARNING: some non-optional tests are failing! This implementation is not fully compliant with the specification!'); $ctx->diag(''); } else { $ctx->$diag('Congratulations, all non-optional tests are passing!'); $ctx->$diag(''); } $ctx->release; } sub _run_test ($self, $one_file, $test_group, $test, $options) { my $test_name = $one_file->{file}.': "'.$test_group->{description}.'" - "'.$test->{description}.'"'; my $pass; # ignores TODO status Test2::API::run_subtest($test_name, sub { my ($result, $schema_before, $data_before, $schema_after, $data_after); try { # we use the decoder here so we don't prettify the string ($schema_before, $data_before) = map $self->json_decoder->encode($_), $test_group->{schema}, $test->{data}; $result = $options->{validate_data} ? $options->{validate_data}->($test_group->{schema}, $test->{data}) # we use the decoder here so we don't prettify the string : $options->{validate_json_string}->($test_group->{schema}, $self->json_decoder->encode($test->{data})); ($schema_after, $data_after) = map $self->json_decoder->encode($_), $test_group->{schema}, $test->{data}; my $ctx = Test2::API::context; # skip the ugly matrix comparison my $expected = $test->{valid} ? 'true' : 'false'; if ($result xor $test->{valid}) { my $got = $result ? 'true' : 'false'; $ctx->fail('evaluation result is incorrect', 'expected '.$expected.'; got '.$got); $pass = 0; } else { $ctx->ok(1, 'test passes: data is valid: '.$expected); $pass = 1; } my @mutated_data_paths = $self->_mutation_check($test->{data}); my @mutated_schema_paths = $self->_mutation_check($test_group->{schema}); # string check path check behaviour # 0 0 ::is(), and note. $pass = 0 # 0 1 ::is(). $pass = 0 # 1 0 ->fail and note. $pass = 0 # 1 1 no test. $pass does not change. if ($data_before ne $data_after) { Test2::Tools::Compare::is($data_after, $data_before, 'evaluator did not mutate data'); $pass = 0; } elsif (@mutated_data_paths) { $ctx->fail('evaluator did not mutate data'); $pass = 0 } $ctx->note('mutated data at location'.(@mutated_data_paths > 1 ? 's' : '').': '.join(', ', @mutated_data_paths)) if @mutated_data_paths; if ($schema_before ne $schema_after) { Test2::Tools::Compare::is($schema_after, $schema_before, 'evaluator did not mutate schema'); $pass = 0; } elsif (@mutated_schema_paths) { $ctx->fail('evaluator did not mutate schema'); $pass = 0; } $ctx->note('mutated schema at location'.(@mutated_schema_paths > 1 ? 's' : '').': '.join(', ', @mutated_schema_paths)) if @mutated_schema_paths; $ctx->release; } catch ($e) { chomp(my $exception = $e); my $ctx = Test2::API::context; $ctx->fail('died: '.$exception); $ctx->release; }; }, { buffered => 1, inherit_trace => 1 }, ); return $pass; } sub _mutation_check ($self, $data) { my @error_paths; # [ path => data ] my @nodes = ([ '', $data ]); while (my $node = shift @nodes) { if (not defined $node->[1]) { next; } if (is_plain_arrayref($node->[1])) { push @nodes, map [ $node->[0].'/'.$_, $node->[1][$_] ], 0 .. $node->[1]->$#*; push @error_paths, $node->[0] if tied($node->[1]->@*); } elsif (is_plain_hashref($node->[1])) { push @nodes, map [ $node->[0].'/'.(s/~/~0/gr =~ s!/!~1!gr), $node->[1]{$_} ], keys $node->[1]->%*; push @error_paths, $node->[0] if tied($node->[1]->%*); } elsif (is_ref($node->[1])) { next; # boolean or bignum } else { my $flags = B::svref_2object(\$node->[1])->FLAGS; push @error_paths, $node->[0] if not ($flags & B::SVf_POK xor $flags & (B::SVf_IOK | B::SVf_NOK)); } } return @error_paths; } # used for internal serialization also has json_decoder => ( is => 'ro', isa => HasMethods[qw(encode decode)], lazy => 1, default => sub { JSON::MaybeXS->new(allow_nonref => 1, utf8 => 1, allow_blessed => 1) }, ); # used for pretty-printing diagnostics has json_encoder => ( is => 'ro', isa => HasMethods['encode'], lazy => 1, default => sub { my $encoder = shift->json_decoder->convert_blessed->canonical->pretty; $encoder->indent_length(2) if $encoder->can('indent_length'); $encoder; }, ); # backcompat shims sub _json_decoder { shift->json_decoder(@_) } sub _json_encoder { shift->json_encoder(@_) } # see JSON::MaybeXS::is_bool my $json_bool = InstanceOf[qw(JSON::XS::Boolean Cpanel::JSON::XS::Boolean JSON::PP::Boolean)]; has _test_data => ( is => 'lazy', isa => ArrayRef[Dict[ file => InstanceOf['Path::Tiny'], json => ArrayRef[Dict[ # id => Optional[Str], description => Str, comment => Optional[Str], schema => $json_bool|HashRef, tests => ArrayRef[Dict[ # id => Optional[Str], data => Any, description => Str, comment => Optional[Str], valid => $json_bool, ]], ]], ]], ); sub _build__test_data ($self) { my @test_groups; $self->test_dir->visit( sub { my ($path) = @_; return if any { $self->test_dir->child($_)->subsumes($path) } $self->skip_dir->@*; return if not $path->is_file; return if $path !~ /\.json$/; my $data = $self->json_decoder->decode($path->slurp_raw); return if not @$data; # placeholder files for renamed tests my $file = $path->relative($self->test_dir); push @test_groups, [ scalar(split('/', $file)), { file => $file, json => $data, }, ]; }, { recurse => $self->include_optional }, ); return [ map $_->[1], sort { $a->[0] <=> $b->[0] || $a->[1]{file} cmp $b->[1]{file} } @test_groups ]; } sub _build_results_text ($self) { my @lines; push @lines, 'Results using '.ref($self).' '.$self->VERSION; my $test_dir = $self->test_dir; my $orig_dir = $self->_build_test_dir; my $submodule_status = path(dist_dir('Test-JSON-Schema-Acceptance'), 'submodule_status'); if ($submodule_status->exists and $submodule_status->parent->subsumes($self->test_dir)) { chomp(my ($commit, $url) = $submodule_status->lines); push @lines, 'with commit '.$commit; push @lines, 'from '.$url.':'; } elsif ($test_dir eq $orig_dir and not -d '.git') { die 'submodule_status file is missing - packaging error? cannot continue'; } push @lines, 'specification version: '.($self->specification//'unknown'); if ($test_dir ne $orig_dir) { if ($orig_dir->subsumes($test_dir)) { $test_dir = '/'.substr($test_dir, length($orig_dir)+1); } elsif (Path::Tiny->cwd->subsumes($test_dir)) { $test_dir = $test_dir->relative; } push @lines, 'using custom test directory: '.$test_dir; } push @lines, 'optional tests included: '.($self->include_optional ? 'yes' : 'no'); push @lines, map 'skipping directory: '.$_, $self->skip_dir->@*; push @lines, ''; my $length = max(40, map length $_->{file}, $self->results->@*); push @lines, sprintf('%-'.$length.'s pass todo-fail fail', 'filename'); push @lines, '-'x($length + 23); push @lines, map sprintf('%-'.$length.'s % 5d % 4d % 4d', $_->@{qw(file pass todo_fail fail)}), $self->results->@*; my $total = +{ map { my $type = $_; $type => sum0(map $_->{$type}, $self->results->@*) } qw(pass todo_fail fail) }; push @lines, '-'x($length + 23); push @lines, sprintf('%-'.$length.'s % 5d % 5d % 5d', 'TOTAL', $total->@{qw(pass todo_fail fail)}); return join("\n", @lines, ''); } 1; __END__ =pod =encoding UTF-8 =for stopwords validators Schemas ANDed ORed TODO =head1 NAME Test::JSON::Schema::Acceptance - Acceptance testing for JSON-Schema based validators like JSON::Schema =head1 VERSION version 1.015 =head1 SYNOPSIS This module allows the L tests to be used in perl to test a module that implements the JSON Schema specification ("json-schema"). These are the same tests that many modules (libraries, plugins, packages, etc.) use to confirm support of json-schema. Using this module to confirm support gives assurance of interoperability with other modules that run the same tests in different languages. In the JSON::Schema module, a test could look like the following: use Test::More; use JSON::Schema; use Test::JSON::Schema::Acceptance; my $accepter = Test::JSON::Schema::Acceptance->new(specification => 'draft3'); $accepter->acceptance( validate_data => sub ($schema, $input_data) { return JSON::Schema->new($schema)->validate($input_data); }, todo_tests => [ { file => 'dependencies.json' } ], ); done_testing(); This would determine if JSON::Schema's C method returns the right result for all of the cases in the JSON Schema Test Suite, except for those listed in C<$skip_tests>. =head1 DESCRIPTION L is an IETF draft (at time of writing) which allows you to define the structure of JSON. From the overview of the L: =over 4 This document proposes a new media type "application/schema+json" to identify a JSON Schema for describing JSON data. It also proposes a further optional media type, "application/schema-instance+json", to provide additional integration features. JSON Schemas are themselves JSON documents. This, and related specifications, define keywords allowing authors to describe JSON data in several ways. JSON Schema uses keywords to assert constraints on JSON instances or annotate those instances with additional information. Additional keywords are used to apply assertions and annotations to more complex JSON data structures, or based on some sort of condition. =back This module allows other perl modules (for example JSON::Schema) to test that they are JSON Schema-compliant, by running the tests from the official test suite, without having to manually convert them to perl tests. You are unlikely to want this module, unless you are attempting to write a module which implements JSON Schema the specification, and want to test your compliance. =head1 CONSTRUCTOR Test::JSON::Schema::Acceptance->new(specification => $specification_version) Create a new instance of Test::JSON::Schema::Acceptance. Available options (which are also available as accessor methods on the object) are: =head2 specification This determines the draft version of the schema to confirm compliance to. Possible values are: =over 4 =item * C =item * C =item * C =item * C =item * C =item * C =item * C (alias for C) =item * C =back The default is C, but in the synopsis example, L is testing draft 3 compliance. (For backwards compatibility, C can be called with a single numeric argument of 3 to 7, which maps to C through C.) =head2 test_dir Instead of specifying a draft specification to test against, which will select the most appropriate tests, you can pass in the name of a directory of tests to run directly. Files in this directory should be F<.json> files following the format described in L. =head2 additional_resources A directory of additional resources which should be made available to the implementation under the base URI C. This is automatically provided if you did not override C; otherwise, you need to supply it yourself, if any tests require it (for example by containing C<< {"$ref": "http://localhost:1234/foo.json/#a/b/c"} >>). If you supply an L value to L (see below), this will be done for you. =head2 verbose Optional. When true, prints version information and test result table such that it is visible during C or C. =head2 include_optional Optional. When true, tests in subdirectories (most notably F are also included. =head2 skip_dir Optional. Pass a string or arrayref consisting of relative path name(s) to indicate directories (within the test directory as specified above with C or C) which will be skipped. Note that this is only useful currently with C 1>, as otherwise all subdirectories would be skipped anyway. =head2 results After calling L, a list of test results are provided here. It is an arrayref of hashrefs with four keys: =over 4 =item * file - the filename =item * pass - the number of pass results for that file =item * todo_fail - the number of fail results for that file that were marked TODO =item * fail - the number of fail results for that file (not including TODO tests) =back =head2 results_text After calling L, a text string tabulating the test results are provided here. This is the same table that is printed at the end of the test run. =head2 test_schemas =for stopwords metaschema Optional. A boolean that, when true, will test every schema against its specification metaschema. (When set, C must also be set.) This normally should not be set as the official test suite has already been sanity-tested, but you may want to set this in development environments if you are using your own test files. Defaults to false. =head1 SUBROUTINES/METHODS =head2 acceptance =for stopwords truthy falsey Accepts a hash of options as its arguments. (Backwards-compatibility mode: accepts a subroutine which is used as C, and a hashref of arguments.) Available options are: =head3 validate_data A subroutine reference, which is passed two arguments: the JSON Schema, and the B data structure to be validated. The subroutine should return truthy or falsey depending on if the schema was valid for the input or not. Either C or C is required. =head3 validate_json_string A subroutine reference, which is passed two arguments: the JSON Schema, and the B containing the data to be validated. The subroutine should return truthy or falsey depending on if the schema was valid for the input or not. Either C or C is required. =head3 add_resource Optional. A subroutine reference, which will be called at the start of L multiple times, with two arguments: a URI (string), and a data structure containing schema data to be associated with that URI, for use in some tests that use additional resources (see above). If you do not provide this option, you will be responsible for ensuring that those additional resources are made available to your implementation for the successful execution of the tests that rely on them. For more information, see . =head3 tests Optional. Restricts tests to just those mentioned (the conditions are ANDed together, not ORed). The syntax can take one of many forms: # run tests in this file tests => { file => 'dependencies.json' } # run tests in these files tests => { file => [ 'dependencies.json', 'refRemote.json' ] } # run tests in this file with this group description tests => { file => 'refRemote.json', group_description => 'remote ref', } # run tests in this file with these group descriptions tests => { file => 'const.json', group_description => [ 'const validation', 'const with object' ], } # run tests in this file with this group description and test description tests => { file => 'const.json', group_description => 'const validation', test_description => 'another type is invalid', } # run tests in this file with this group description and these test descriptions tests => { file => 'const.json', group_description => 'const validation', test_description => [ 'same value is valid', 'another type is invalid' ], } =head3 todo_tests Optional. Mentioned tests will run as L<"TODO"|Test::More/TODO: BLOCK>. Uses arrayrefs of the same hashref structure as L above, which are ORed together. todo_tests => [ # all tests in this file are TODO { file => 'dependencies.json' }, # just some tests in this file are TODO { file => 'boolean_schema.json', test_description => 'array is invalid' }, # .. etc ] =head1 ACKNOWLEDGEMENTS =for stopwords Perrett Signes Daniel Perrett for the concept and help in design. Ricardo Signes for direction to and creation of Test::Fatal. Various others in #perl-help. =head1 SUPPORT Bugs may be submitted through L. =head1 AUTHOR Ben Hutton (@relequestual) =head1 CONTRIBUTORS =for stopwords Karen Etheridge Daniel Perrett =over 4 =item * Karen Etheridge =item * Daniel Perrett =back =head1 COPYRIGHT AND LICENCE This software is Copyright (c) 2015 by Ben Hutton. This is free software, licensed under: The MIT (X11) License This distribution includes data from the L test suite, which carries its own licence (see F). =for Pod::Coverage BUILDARGS BUILD =cut Test-JSON-Schema-Acceptance-1.015/examples/run_all_tests000644 000766 000024 00000001445 14163671560 023337 0ustar00etherstaff000000 000000 # vim: set ft=perl ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; no if "$]" >= 5.031009, feature => 'indirect'; # this line is only needed of Test::JSON::Schema::Acceptance is not installed (we will need to find # the test suite data in the local share/) use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test2::Tools::Basic; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new( specification => 'draft2020-12', verbose => 1, include_optional => 1, ); my $parser = SchemaParser->new; $accepter->acceptance( validate_data => sub { my ($schema, $input_data) = @_; return $parser->validate_data($input_data, $schema); }, ); Test2::Tools::Basic::done_testing; Test-JSON-Schema-Acceptance-1.015/xt/author/000770 000766 000024 00000000000 14163671560 020646 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/xt/release/000770 000766 000024 00000000000 14163671560 020764 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/xt/release/changes_has_content.t000644 000766 000024 00000002101 14163671560 025143 0ustar00etherstaff000000 000000 use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '1.015'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } Test-JSON-Schema-Acceptance-1.015/xt/release/cpan-changes.t000644 000766 000024 00000000344 14163671560 023504 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; Test-JSON-Schema-Acceptance-1.015/xt/author/mojibake.t000644 000766 000024 00000000151 14163671560 022614 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); Test-JSON-Schema-Acceptance-1.015/xt/author/kwalitee.t000644 000766 000024 00000000275 14163671560 022647 0ustar00etherstaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; Test-JSON-Schema-Acceptance-1.015/xt/author/no-tabs.t000644 000766 000024 00000004300 14163671560 022376 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'examples/run_all_tests', 'lib/Test/JSON/Schema/Acceptance.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01-basic.t', 't/02-constructor.t', 't/03-validate_data.t', 't/04-validate_json_string.t', 't/05-test-descriptions.t', 't/06-subset-of-tests.t', 't/07-skip-tests-deprecated.t', 't/08-todo-tests.t', 't/09-unicode.t', 't/10-exception.t', 't/11-additional-resources.t', 't/12-include-optional.t', 't/13-empty-test-dir.t', 't/14-add-resource.t', 't/15-mutation.t', 't/16-skip_dir.t', 't/99-sanity.t', 't/lib/SchemaParser.pm', 't/tests/add_resource/foo.json', 't/tests/add_resource/remotes/remote1.json', 't/tests/add_resource/remotes/subfolder/remote2.json', 't/tests/bad/invalid-schema.json', 't/tests/empty/keep', 't/tests/include_optional/extra/foo.json', 't/tests/include_optional/foo.json', 't/tests/include_optional/optional/alpha.json', 't/tests/include_optional/optional/beta.json', 't/tests/include_optional/zulu.json', 't/tests/mutation/hash.json', 't/tests/simple-booleans/bar.json', 't/tests/simple-booleans/foo.json', 't/tests/skip_dir/main.json', 't/tests/skip_dir/optional/alpha/test.json', 't/tests/skip_dir/optional/beta/test.json', 't/tests/skip_dir/optional/betadyne/test.json', 't/tests/skip_dir/optional/gamma/test.json', 't/tests/subset/bar.json', 't/tests/subset/baz.json', 't/tests/subset/foo.json', 't/tests/unicode/unicode.json', 'xt/author/00-compile.t', 'xt/author/clean-namespaces.t', 'xt/author/distmeta.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/live-data-sanity.t', 'xt/author/minimum-version.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-no404s.t', 'xt/author/pod-spell.t', 'xt/author/pod-syntax.t', 'xt/author/portability.t', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t' ); notabs_ok($_) foreach @files; done_testing; Test-JSON-Schema-Acceptance-1.015/xt/author/minimum-version.t000644 000766 000024 00000000152 14163671560 024172 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::MinimumVersion; all_minimum_version_ok( qq{5.020} ); Test-JSON-Schema-Acceptance-1.015/xt/author/live-data-sanity.t000640 000766 000024 00000001353 14163671560 024207 0ustar00etherstaff000000 000000 # vim: set ft=perl ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; no if "$]" >= 5.031009, feature => 'indirect'; use Test::More 0.88; use Test::Warnings; use Feature::Compat::Try; use Path::Tiny; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; my $test_dir = path(File::ShareDir::dist_dir('Test-JSON-Schema-Acceptance'), 'tests'); foreach my $draft (sort $test_dir->children) { my $accepter = Test::JSON::Schema::Acceptance->new(specification => $draft->basename); my $exception; try { $accepter->_test_data; } catch ($e) { $exception = $e; }; is($exception, undef, 'no errors loading data for '.$draft->basename); } done_testing; Test-JSON-Schema-Acceptance-1.015/xt/author/00-compile.t000644 000766 000024 00000005246 14163671560 022712 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More 0.94; plan tests => 3; my @module_files = ( 'Test/JSON/Schema/Acceptance.pm' ); my @scripts = ( 'examples/run_all_tests' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } foreach my $file (@scripts) { SKIP: { open my $fh, '<', $file or warn("Unable to open $file: $!"), next; my $line = <$fh>; close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/; @switches = (@switches, split(' ', $1)) if $1; close $fh and skip("$file uses -T; not testable with PERL5LIB", 1) if grep { $_ eq '-T' } @switches and $ENV{PERL5LIB}; my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-c', $file)) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-c', $file); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$file compiled ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; # in older perls, -c output is simply the file portion of the path being tested if (@_warnings = grep { !/\bsyntax OK$/ } grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_warnings) { warn @_warnings; push @warnings, @_warnings; } } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', explain(\@warnings); BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; Test-JSON-Schema-Acceptance-1.015/xt/author/eol.t000644 000766 000024 00000004332 14163671560 021617 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'examples/run_all_tests', 'lib/Test/JSON/Schema/Acceptance.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01-basic.t', 't/02-constructor.t', 't/03-validate_data.t', 't/04-validate_json_string.t', 't/05-test-descriptions.t', 't/06-subset-of-tests.t', 't/07-skip-tests-deprecated.t', 't/08-todo-tests.t', 't/09-unicode.t', 't/10-exception.t', 't/11-additional-resources.t', 't/12-include-optional.t', 't/13-empty-test-dir.t', 't/14-add-resource.t', 't/15-mutation.t', 't/16-skip_dir.t', 't/99-sanity.t', 't/lib/SchemaParser.pm', 't/tests/add_resource/foo.json', 't/tests/add_resource/remotes/remote1.json', 't/tests/add_resource/remotes/subfolder/remote2.json', 't/tests/bad/invalid-schema.json', 't/tests/empty/keep', 't/tests/include_optional/extra/foo.json', 't/tests/include_optional/foo.json', 't/tests/include_optional/optional/alpha.json', 't/tests/include_optional/optional/beta.json', 't/tests/include_optional/zulu.json', 't/tests/mutation/hash.json', 't/tests/simple-booleans/bar.json', 't/tests/simple-booleans/foo.json', 't/tests/skip_dir/main.json', 't/tests/skip_dir/optional/alpha/test.json', 't/tests/skip_dir/optional/beta/test.json', 't/tests/skip_dir/optional/betadyne/test.json', 't/tests/skip_dir/optional/gamma/test.json', 't/tests/subset/bar.json', 't/tests/subset/baz.json', 't/tests/subset/foo.json', 't/tests/unicode/unicode.json', 'xt/author/00-compile.t', 'xt/author/clean-namespaces.t', 'xt/author/distmeta.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/live-data-sanity.t', 'xt/author/minimum-version.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-no404s.t', 'xt/author/pod-spell.t', 'xt/author/pod-syntax.t', 'xt/author/portability.t', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Test-JSON-Schema-Acceptance-1.015/xt/author/pod-syntax.t000644 000766 000024 00000000252 14163671560 023143 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Test-JSON-Schema-Acceptance-1.015/xt/author/portability.t000644 000766 000024 00000000267 14163671560 023405 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); Test-JSON-Schema-Acceptance-1.015/xt/author/distmeta.t000644 000766 000024 00000000172 14163671560 022650 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Test-JSON-Schema-Acceptance-1.015/xt/author/pod-spell.t000644 000766 000024 00000000545 14163671560 022741 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( examples lib script t xt ) ); __DATA__ Acceptance Ben Daniel Etheridge Hutton JSON Karen Perrett Schema Test dp13 ether irc lib relequest relequestual Test-JSON-Schema-Acceptance-1.015/xt/author/pod-no404s.t000644 000766 000024 00000000527 14163671560 022651 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_NO404S AUTOMATED_TESTING ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::No404s"; if ( $@ ) { plan skip_all => 'Test::Pod::No404s required for testing POD'; } else { all_pod_files_ok(); } Test-JSON-Schema-Acceptance-1.015/xt/author/clean-namespaces.t000644 000766 000024 00000000361 14163671560 024235 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CleanNamespaces 0.006 use Test::More 0.94; use Test::CleanNamespaces 0.15; subtest all_namespaces_clean => sub { all_namespaces_clean() }; done_testing; Test-JSON-Schema-Acceptance-1.015/xt/author/pod-coverage.t000644 000766 000024 00000000334 14163671560 023411 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Test-JSON-Schema-Acceptance-1.015/t/11-additional-resources.t000640 000766 000024 00000001307 14163671560 023700 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; my $accepter = Test::JSON::Schema::Acceptance->new(specification => 'draft2020-12'); ok($accepter->additional_resources->is_dir, 'additional_resources directory exists'); ok($accepter->additional_resources->child('integer.json')->is_file, 'integer.json file exists'); done_testing; Test-JSON-Schema-Acceptance-1.015/t/06-subset-of-tests.t000640 000766 000024 00000005771 14163671560 022644 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::JSON::Schema::Acceptance; use List::Util 'sum'; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/subset'); my $parser = SchemaParser->new; # bar contains only failing tests (3x3) # baz contains only passing tests (3) # foo contains only passing tests (3x3) foreach my $test ( # run tests in this file { count => [0,0,9], tests => { file => 'foo.json' } }, # run tests in these files { count => [0,3,9], tests => { file => [ 'foo.json', 'baz.json' ] } }, # run tests in any file, with this group description { count => [3,'0 but true',3], tests => { group_description => 'false schema' } }, # run tests in this file with this group description { count => [0,0,3], tests => { file => 'foo.json', group_description => 'false schema' } }, # run tests in this file with these group descriptions { count => [0,0,3+3], tests => { file => 'foo.json', group_description => [ 'true schema', 'false schema' ], }, }, # run tests in this file with this group description and test description { count => [0,0,1], tests => { file => 'foo.json', group_description => 'true schema', test_description => 'boolean false', } }, # run tests in this file with this group description and these test descriptions { count => [2,0,0], tests => { file => 'bar.json', group_description => 'false schema', test_description => [ 'boolean true', 'boolean false' ], } }, # run tests in any file with this group description and this test description { count => [1,1,1], tests => { group_description => 'empty schema', test_description => [ 'boolean true' ], } }, # run tests in any file with any group description with this test description { count => [3,1,3], tests => { test_description => [ 'boolean true' ], } }, ) { my ($count, $test_options) = @{$test}{qw(count tests)}; my $events = intercept( sub { $accepter->acceptance( validate_data => sub ($schema, $data) { return $parser->validate_data($data, $schema); }, tests => $test_options, ); } ); my @tests = grep $_->isa('Test2::Event::Ok'), @$events; is(scalar(@tests), sum(@$count), 'ran ('.join('+',@$count).') tests'); cmp_deeply( $accepter->results, [ map +( $count->[$_] ? +{ file => str([ qw(bar.json baz.json foo.json) ]->[$_]), pass => ($_ ? 0+$count->[$_] : 0), todo_fail => 0, fail => ($_ ? 0 : 0+$count->[$_]), } : () ), (0..2) ], 'result data was populated', ); } done_testing; Test-JSON-Schema-Acceptance-1.015/t/04-validate_json_string.t000640 000766 000024 00000002503 14163671560 023771 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; # this is just like t/01-basic.t only it uses the non-deprecated form of the "validate as a # json string" interface. my $accepter = Test::JSON::Schema::Acceptance->new(specification => 'draft7'); my $parser = SchemaParser->new; my $events = intercept( sub { $accepter->acceptance(validate_json_string => sub ($schema, $data_string) { return $parser->validate_json_string($data_string, $schema); }); } ); my @bool_tests = grep $_->isa('Test2::Event::Ok') && $_->name =~ /boolean type matches booleans/, @$events; is(@bool_tests, 10, 'found all the tests that check for boolean type'); cmp_deeply( \@bool_tests, array_each(methods( pass => 1, effective_pass => 1, )), 'tests pass for checking schemas that test for boolean type', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/02-constructor.t000640 000766 000024 00000003351 14163671560 022146 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Fatal; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; is( Test::JSON::Schema::Acceptance->new->specification, 'draft2020-12', '"specification" defaults to latest draft' ); is( Test::JSON::Schema::Acceptance->new(specification => 'latest')->specification, 'draft2020-12', 'latest becomes draft2020-12', ); foreach my $version (3,4,6,7) { is( Test::JSON::Schema::Acceptance->new($version)->specification, 'draft'.$version, '->new('.$version.') becomes ->new(specification => \'draft'.$version.'\')', ); is( Test::JSON::Schema::Acceptance->new(specification => 'draft'.$version)->specification, 'draft'.$version, '->new(specification => '.$version.') passed through normally', ); } foreach my $version ('a', 2, 'foo') { like( exception { Test::JSON::Schema::Acceptance->new($version) }, qr/test_dir does not exist: .*draft$version/, 'does not accept version = '.$version, ); } like( exception { Test::JSON::Schema::Acceptance->new(test_dir => 'foo') }, qr/test_dir does not exist: .*foo/, 'explicit test_dir argument is checked', ); SKIP: { skip 'this test can only be run in the git repository', 1 if not -d '.git'; is(readlink('share/tests/latest'), 'draft2020-12', 'latest draft is still 2020-12') or warn 'a new draft has been released! update the "latest" munging in BUILDARGS!'; } done_testing; Test-JSON-Schema-Acceptance-1.015/t/15-mutation.t000640 000766 000024 00000005673 14163671560 021436 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Scalar::Util 'dualvar'; use Test::Deep; use Test::JSON::Schema::Acceptance; my $key = 'a'; foreach my $test ( [ 'autovivification' => sub ($thing) { $thing->{(keys %$thing)[0]}{$key++} = 'this should not be here'; } ], [ 'string->integer type mutation, explicit numification' => sub ($thing) { $thing->{foo}{string} += 0; } ], [ 'integer->string type mutation, explicit stringification' => sub ($thing) { $thing->{foo}{int} .= ''; } ], [ 'string->integer type mutation, used as a number' => sub ($thing) { my $str = sprintf('%d', $thing->{foo}{string}); } ], [ 'integer->string type mutation, used as a string' => sub ($thing) { my $str = sprintf('%s', $thing->{foo}{int}); } ], [ 'string->dualvar' => sub ($thing) { $thing->{foo}{string} = dualvar(1, 'one'); } ], [ 'integer->dualvar' => sub ($thing) { $thing->{foo}{int} = dualvar(1, 'one'); } ], [ 'blessed hash replacement' => sub ($thing) { $thing->{foo} = bless($thing->{foo}, 'MyHash'); } ], [ 'tied hash replacement' => sub ($thing) { my %hash; tie(%hash, 'Tie::StdHash'); @hash{keys %{$thing->{foo}}} = values %{$thing->{foo}}; $thing->{foo} = \%hash; } ], [ 'bigint' => sub ($thing) { $thing->{foo}{bigint} += 1; } ], [ 'bignum' => sub ($thing) { $thing->{foo}{bignum} += 1; } ], ) { my ($test_name, $mutator) = @$test; foreach my $type (qw(data schema)) { my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/mutation'); $accepter->json_decoder->allow_bignum; my $events = intercept( sub { $accepter->acceptance(validate_data => sub ($schema, $data) { $mutator->($type eq 'data' ? $data : $type eq 'schema' ? $schema : die "$type?!"); return 1; }); } ); cmp_deeply( [ map exists $_->{parent} ? { details => $_->{assert}{details}, pass => $_->{assert}{pass}, children => [ map exists $_->{assert} ? $_->{assert} : (), @{$_->{parent}{children}} ], } : (), map $_->facet_data, @$events ], [ { details => 'hash.json: "mutation of hashes" - "object of integers"', pass => 0, children => [ superhashof({ details => 'test passes: data is valid: true', pass => 1, }), superhashof({ details => 'evaluator did not mutate '.$type, pass => 0, }), ], }, ], $test_name.' in '.$type, ); } } done_testing; Test-JSON-Schema-Acceptance-1.015/t/16-skip_dir.t000640 000766 000024 00000002453 14163671560 021374 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new( test_dir => 't/tests/skip_dir', include_optional => 1, skip_dir => ['optional/beta'], ); my $parser = SchemaParser->new; my $events = intercept( sub { $accepter->acceptance(sub ($schema, $input_data) { return $parser->validate_data($input_data, $schema); }); } ); my @bool_tests = grep $_->isa('Test2::Event::Ok'), @$events; is(@bool_tests, 4, 'correct number of tests ran'); cmp_deeply( [ map $_->name, @bool_tests ], [ 'main.json: "test group" - "test"', 'optional/alpha/test.json: "test group" - "test"', 'optional/betadyne/test.json: "test group" - "test"', 'optional/gamma/test.json: "test group" - "test"', ], 'correct test files ran', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/09-unicode.t000640 000766 000024 00000006310 14163671560 021214 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use utf8; use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8 use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/unicode'); my $parser = SchemaParser->new; $accepter->acceptance( tests => { file => 'unicode.json', group_description => 'latin1 schema', test_description => 'latin1 data', }, validate_data => sub ($schema, $data) { note 'validate_data passed data "'.$data.'", schema "'.$schema->{const}.'"'; is(index($schema->{const}, 'Les hivers de mon enfance étaient'), 0, 'schema was decoded from data file correctly') && is(index($data, 'Les hivers de mon enfance étaient'), 0, 'data was decoded from file correctly') && is($data, $schema->{const}, 'data and schema decode identically'); }, ); $accepter->acceptance( tests => { file => 'unicode.json', group_description => 'very wide schema', test_description => 'very wide data', }, validate_data => sub ($schema, $data) { note 'validate_data passed data "'.$data.'", schema "'.$schema->{const}.'"'; is($schema->{const}, 'ಠ_ಠ', 'schema was decoded from data file correctly') && is($data, 'ಠ_ಠ', 'data was decoded from file correctly, and properly passed characters that occupy multiple bytes in unicode') && is($data, $schema->{const}, 'data and schema decode identically'); }, ); $accepter->acceptance( tests => { file => 'unicode.json', group_description => 'latin1 schema', test_description => 'latin1 data', }, validate_json_string => sub ($schema, $data) { note 'validate_data passed data "'.$data.'", schema "'.$schema->{const}.'"'; is(index($schema->{const}, 'Les hivers de mon enfance étaient'), 0, 'schema was decoded from data file correctly') && is(index($data, "\"Les hivers de mon enfance \x{c3}\x{a9}taient"), 0, 'data contains utf8-encoded data (latin-1 character is encoded as two bytes in utf8') && is(JSON::MaybeXS->new(utf8 => 1, allow_nonref => 1)->decode($data), $schema->{const}, 'data can be decoded and compares correctly'); }, ); $accepter->acceptance( tests => { file => 'unicode.json', group_description => 'very wide schema', test_description => 'very wide data', }, validate_json_string => sub ($schema, $data) { note 'validate_data passed data "'.$data.'", schema "'.$schema->{const}.'"'; is($schema->{const}, 'ಠ_ಠ', 'schema was decoded from data file correctly') && is($data, "\"\x{e0}\x{b2}\x{a0}_\x{e0}\x{b2}\x{a0}\"", 'data contains utf8-encoded data (each character is encoded as three bytes in utf8') && is(JSON::MaybeXS->new(utf8 => 1, allow_nonref => 1)->decode($data), $schema->{const}, 'data can be decoded and compares correctly'); }, ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/05-test-descriptions.t000640 000766 000024 00000002447 14163671560 023254 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/simple-booleans'); my $parser = SchemaParser->new; my $events = intercept( sub { $accepter->acceptance(sub ($schema, $input_data) { return $parser->validate_data($input_data, $schema); }); } ); my @bool_tests = grep $_->isa('Test2::Event::Ok'), @$events; is(@bool_tests, 18, 'found all the tests'); cmp_deeply( \@bool_tests, array_each(methods( pass => 1, effective_pass => 1, )), 'all tests pass', ); cmp_deeply( [ map $_->name, @bool_tests ], [ map { my $file = $_; map { my $group = $_; map $file.'.json: "'.$group.'" - "'.$_.'"', 'integer', 'boolean false', 'boolean true' } 'empty schema', 'false schema', 'true schema' } qw(bar foo) ], 'test names are shown correctly', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/tests/000770 000766 000024 00000000000 14163671560 020316 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/99-sanity.t000640 000766 000024 00000001532 14163671560 021107 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use File::ShareDir 'dist_dir'; use Path::Tiny; use Test::Fatal; use Test::JSON::Schema::Acceptance; foreach my $draft (path(dist_dir('Test-JSON-Schema-Acceptance'), 'tests')->children) { $draft = $draft->basename; my $accepter = Test::JSON::Schema::Acceptance->new(specification => $draft, include_optional => 1); is( exception { $accepter->_test_data }, undef, 'test data for '.$draft.' does not violate any type constraints', ); } done_testing; Test-JSON-Schema-Acceptance-1.015/t/14-add-resource.t000640 000766 000024 00000002177 14163671560 022146 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::JSON::Schema::Acceptance; use JSON::PP; my %additional_resources; my $accepter = Test::JSON::Schema::Acceptance->new( test_dir => 't/tests/add_resource', additional_resources => 't/tests/add_resource/remotes', include_optional => 0, ); $accepter->acceptance( validate_data => sub ($schema, $data) { return 1; # all schemas evaluate to true here }, add_resource => sub ($uri, $schema) { $additional_resources{$uri} = $schema; }, ); cmp_deeply( \%additional_resources, { 'http://localhost:1234/remote1.json' => { '$defs' => { foo => bool(1) } }, 'http://localhost:1234/subfolder/remote2.json' => { '$defs' => { bar => bool(0) } }, }, 'user-supplied subref is called with additional resources found in test directory', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/12-include-optional.t000640 000766 000024 00000001551 14163671560 023030 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::JSON::Schema::Acceptance; my $accepter = Test::JSON::Schema::Acceptance->new( test_dir => 't/tests/include_optional', include_optional => 1, ); cmp_deeply( $accepter->_test_data, [ { file => str('foo.json'), json => ignore }, { file => str('zulu.json'), json => ignore }, { file => str('extra/foo.json'), json => ignore }, { file => str('optional/alpha.json'), json => ignore }, { file => str('optional/beta.json'), json => ignore }, ], 'picked up optional files in test_data, in the correct order', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/13-empty-test-dir.t000640 000766 000024 00000001707 14163671560 022455 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new( test_dir => 't/tests/empty', include_optional => 1, ); is(@{$accepter->_test_data}, 0, 'an empty test directory means no test data'); my $parser = SchemaParser->new; my $events = intercept( sub { $accepter->acceptance(sub ($schema, $data) { return $parser->validate_data($data, $schema); }); } ); is( scalar(grep exists $_->{assert}, map $_->facet_data, @$events), 0, 'no tests are run when test directory is empty', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/08-todo-tests.t000640 000766 000024 00000013037 14163671560 021676 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use Test::Deep; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/subset'); my $parser = SchemaParser->new; # bar contains only failing tests (3x3) # baz contains only passing tests (3) # foo contains only passing tests (3x3) foreach my $test ( # match tests in this file { todo_count => 9, todo_tests => [ { file => 'foo.json' } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 0, fail => 9 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in these files { todo_count => 9+3, todo_tests => [ { file => [ 'foo.json', 'baz.json' ] } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 0, fail => 9 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in any file, with this group description { todo_count => 3+3, todo_tests => [ { group_description => 'false schema' } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 3, fail => 6 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in this file with this group description { todo_count => 3, todo_tests => [ { file => 'foo.json', group_description => 'false schema' } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 0, fail => 9 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in this file with these group descriptions { todo_count => 3+3, todo_tests => [ { file => 'foo.json', group_description => [ 'true schema', 'false schema' ] } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 0, fail => 9 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in this file with this group description and test description { todo_count => 1, todo_tests => [ { file => 'foo.json', group_description => 'true schema', test_description => 'boolean false', } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 0, fail => 9 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in this file with this group description and these test descriptions { todo_count => 2, todo_tests => [ { file => 'bar.json', group_description => 'false schema', test_description => [ 'boolean true', 'boolean false' ], } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 2, fail => 7 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in any file with this group description and this test description { todo_count => 1+1+1, todo_tests => [ { group_description => 'empty schema', test_description => [ 'boolean true' ], } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 1, fail => 8 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests in any file with any group description with this test description { todo_count => 3+3+1, todo_tests => [ { test_description => [ 'boolean true' ] } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 3, fail => 6 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, # match tests with multiple specifications at once { todo_count => 9+3, todo_tests => [ { file => 'foo.json' }, { group_description => 'true schema' } ], results => [ { file => str('bar.json'), pass => 0, todo_fail => 3, fail => 6 }, { file => str('baz.json'), pass => 3, todo_fail => 0, fail => 0 }, { file => str('foo.json'), pass => 9, todo_fail => 0, fail => 0 }, ], }, ) { my $todo_count = delete $test->{todo_count}; my $events = intercept( sub { $accepter->acceptance( validate_data => sub ($schema, $data) { return $parser->validate_data($data, $schema); }, %$test, ); } ); is(scalar(grep $_->isa('Test2::Event::Skip'), @$events), 0, 'skipped and todo_skipped no tests'); is( scalar( grep exists $_->{assert} && (grep $_->{tag} eq 'TODO', @{$_->{amnesty} // []}), map $_->facet_data, @$events ), $todo_count, 'right number of tests are marked TODO ('.$todo_count.')', ); cmp_deeply( $accepter->results, $test->{results}, 'result data was populated', ); } done_testing; Test-JSON-Schema-Acceptance-1.015/t/00-report-prereqs.t000644 000766 000024 00000013662 14163671560 022563 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( Encode File::Temp JSON::PP Module::Runtime Pod::Coverage Sub::Name YAML autodie JSON::PP Cpanel::JSON::XS JSON::XS ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: Test-JSON-Schema-Acceptance-1.015/t/01-basic.t000640 000766 000024 00000003103 14163671560 020634 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new(7); my $line; my $parser = SchemaParser->new; my $events = intercept( sub { $accepter->acceptance(sub ($schema, $data_string) { return $parser->validate_json_string($data_string, $schema); # we didn't adjust level, so test appears to originate where the subref ends }); $line = __LINE__; } ); cmp_deeply( $events->[0], all( isa('Test2::Event::Note'), methods(message => 'running tests in '.$accepter->test_dir.' against draft7...'), ), 'first test event is the note', ); my @bool_tests = grep $_->isa('Test2::Event::Ok') && $_->name =~ /boolean type matches booleans/, @$events; is(@bool_tests, 10, 'found all the tests that check for boolean type'); cmp_deeply( \@bool_tests, array_each(methods( pass => 1, effective_pass => 1, trace => methods( frame => [ 'main', __FILE__, $line, 'Test::JSON::Schema::Acceptance::acceptance' ], ), )), 'tests pass for checking schemas that test for boolean type', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/lib/000770 000766 000024 00000000000 14163671560 017722 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/07-skip-tests-deprecated.t000640 000766 000024 00000003563 14163671560 023777 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use Test::Warnings 'warnings'; use Test::Deep; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/subset'); my $parser = SchemaParser->new; foreach my $test ( # match tests by group description { todo_count => 3+3, skip_tests => [ 'true schema' ] }, { todo_count => 2*(3+3), skip_tests => [ 'true schema', 'false schema' ] }, # match tests by regexp on test description { todo_count => 2*(3+3), skip_tests => [ '(true|false) schema' ] }, # match tests on both descriptions { todo_count => 2*(1+3+1) + 1, skip_tests => [ 'false' ] }, # match tests on group description and test description { todo_count => 3*2, skip_tests => [ 'empty schema.*boolean' ] }, ) { my $todo_count = delete $test->{todo_count}; my @warnings; my $events = intercept( sub { @warnings = warnings { $accepter->acceptance( validate_data => sub ($schema, $data) { return $parser->validate_data($data, $schema); }, %$test, ); } } ); is(scalar(grep $_->isa('Test2::Event::Skip'), @$events), 0, 'skipped and todo_skipped no tests'); is( scalar( grep exists $_->{assert} && (grep $_->{tag} eq 'TODO', @{$_->{amnesty} // []}), map $_->facet_data, @$events ), $todo_count, $todo_count.' tests are marked TODO', ); cmp_deeply( \@warnings, [ re(qr/'skip_tests' option is deprecated at /) ], 'got deprecation warnings for skip_tests feature', ); } done_testing; Test-JSON-Schema-Acceptance-1.015/t/00-report-prereqs.dd000644 000766 000024 00000030125 14163671560 022700 0ustar00etherstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::ShareDir::Install' => '0.06', 'perl' => '5.020' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.162', 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007' }, 'requires' => { 'Encode' => '0', 'ExtUtils::HasCompiler' => '0.014', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::CleanNamespaces' => '0.15', 'Test::EOL' => '0', 'Test::File::ShareDir' => '0', 'Test::Kwalitee' => '1.21', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::No404s' => '0', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Warnings' => '0' } }, 'runtime' => { 'requires' => { 'Feature::Compat::Try' => '0', 'File::ShareDir' => '0', 'JSON::MaybeXS' => '1.004001', 'List::Util' => '1.33', 'Moo' => '0', 'MooX::TypeTiny' => '0.002002', 'Path::Tiny' => '0.069', 'Ref::Util' => '0', 'Test2::API' => '0', 'Test2::Todo' => '0', 'Test2::Tools::Compare' => '0', 'Types::Common::Numeric' => '0', 'Types::Standard' => '1.010002', 'constant' => '0', 'experimental' => '0', 'if' => '0', 'namespace::clean' => '0', 'perl' => '5.020', 'strict' => '0', 'strictures' => '2', 'warnings' => '0' }, 'suggests' => { 'Class::XSAccessor' => '0', 'Cpanel::JSON::XS' => '0', 'Ref::Util::XS' => '0', 'Type::Tiny::XS' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'JSON::PP' => '0', 'Scalar::Util' => '0', 'Test2::Suite' => '0.000131', 'Test::Deep' => '0', 'Test::Fatal' => '0', 'Test::File::ShareDir' => '0', 'Test::More' => '0.88', 'Test::Simple' => '1.302176', 'Test::Warnings' => '0', 'feature' => '0', 'lib' => '0', 'open' => '0', 'perl' => '5.020', 'utf8' => '0' } }, 'x_Dist_Zilla' => { 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Authority' => '1.009', 'Dist::Zilla::Plugin::AutoMetaResources' => '0', 'Dist::Zilla::Plugin::AutoPrereqs' => '5.038', 'Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional' => '0.004', 'Dist::Zilla::Plugin::CheckIssues' => '0', 'Dist::Zilla::Plugin::CheckMetaResources' => '0', 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0.019', 'Dist::Zilla::Plugin::CheckSelfDependency' => '0', 'Dist::Zilla::Plugin::CheckStrictVersion' => '0', 'Dist::Zilla::Plugin::ConfirmRelease' => '0', 'Dist::Zilla::Plugin::CopyFilesFromRelease' => '0', 'Dist::Zilla::Plugin::DynamicPrereqs' => '0.029', 'Dist::Zilla::Plugin::EnsureLatestPerl' => '0', 'Dist::Zilla::Plugin::FileFinder::ByName' => '0', 'Dist::Zilla::Plugin::GenerateFile' => '0', 'Dist::Zilla::Plugin::GenerateFile::FromShareDir' => '0', 'Dist::Zilla::Plugin::Git::Check' => '0', 'Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch' => '0.004', 'Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts' => '0', 'Dist::Zilla::Plugin::Git::Commit' => '2.020', 'Dist::Zilla::Plugin::Git::Contributors' => '0.029', 'Dist::Zilla::Plugin::Git::Describe' => '0.004', 'Dist::Zilla::Plugin::Git::GatherDir' => '2.016', 'Dist::Zilla::Plugin::Git::Push' => '0', 'Dist::Zilla::Plugin::Git::Remote::Check' => '0', 'Dist::Zilla::Plugin::Git::Tag' => '0', 'Dist::Zilla::Plugin::GitHub::Update' => '0.40', 'Dist::Zilla::Plugin::GithubMeta' => '0.54', 'Dist::Zilla::Plugin::InstallGuide' => '1.200005', 'Dist::Zilla::Plugin::Keywords' => '0.004', 'Dist::Zilla::Plugin::License' => '5.038', 'Dist::Zilla::Plugin::MakeMaker' => '0', 'Dist::Zilla::Plugin::Manifest' => '0', 'Dist::Zilla::Plugin::MetaConfig' => '0', 'Dist::Zilla::Plugin::MetaJSON' => '0', 'Dist::Zilla::Plugin::MetaNoIndex' => '0', 'Dist::Zilla::Plugin::MetaProvides::Package' => '1.15000002', 'Dist::Zilla::Plugin::MetaTests' => '0', 'Dist::Zilla::Plugin::MetaYAML' => '0', 'Dist::Zilla::Plugin::MinimumPerl' => '1.006', 'Dist::Zilla::Plugin::MojibakeTests' => '0.8', 'Dist::Zilla::Plugin::NextRelease' => '5.033', 'Dist::Zilla::Plugin::PodCoverageTests' => '5.040', 'Dist::Zilla::Plugin::PodSyntaxTests' => '5.040', 'Dist::Zilla::Plugin::PodWeaver' => '4.008', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0.006', 'Dist::Zilla::Plugin::PromptIfStale' => '0', 'Dist::Zilla::Plugin::Readme' => '0', 'Dist::Zilla::Plugin::ReadmeAnyFromPod' => '0.142180', 'Dist::Zilla::Plugin::RewriteVersion::Transitional' => '0.006', 'Dist::Zilla::Plugin::Run::AfterBuild' => '0.041', 'Dist::Zilla::Plugin::Run::AfterRelease' => '0.038', 'Dist::Zilla::Plugin::Run::BeforeBuild' => '0', 'Dist::Zilla::Plugin::Run::BeforeRelease' => '0', 'Dist::Zilla::Plugin::RunExtraTests' => '0.024', 'Dist::Zilla::Plugin::ShareDir' => '0', 'Dist::Zilla::Plugin::StaticInstall' => '0.005', 'Dist::Zilla::Plugin::Test::CPAN::Changes' => '0.012', 'Dist::Zilla::Plugin::Test::ChangesHasContent' => '0', 'Dist::Zilla::Plugin::Test::CleanNamespaces' => '0.006', 'Dist::Zilla::Plugin::Test::Compile' => '2.039', 'Dist::Zilla::Plugin::Test::EOL' => '0.17', 'Dist::Zilla::Plugin::Test::Kwalitee' => '2.10', 'Dist::Zilla::Plugin::Test::MinimumVersion' => '2.000010', 'Dist::Zilla::Plugin::Test::NoTabs' => '0.08', 'Dist::Zilla::Plugin::Test::Pod::No404s' => '1.003', 'Dist::Zilla::Plugin::Test::PodSpelling' => '2.006003', 'Dist::Zilla::Plugin::Test::Portability' => '2.000007', 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0.022', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', 'Dist::Zilla::Plugin::UseUnsafeInc' => '0', 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.154', 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007', 'Software::License::MIT' => '0' } } }; $x; }Test-JSON-Schema-Acceptance-1.015/t/10-exception.t000640 000766 000024 00000004333 14163671560 021557 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::JSON::Schema::Acceptance; my $accepter = Test::JSON::Schema::Acceptance->new(test_dir => 't/tests/bad'); my $events = intercept( sub { $accepter->acceptance( validate_data => sub ($schema, $data) { die 'ach I am slain' if $data->{exception}; return 1; }, tests => { file => 'invalid-schema.json' }, ); } ); cmp_deeply( [ map exists $_->{parent} ? { details => $_->{assert}{details}, pass => $_->{assert}{pass}, children => [ map exists $_->{assert} ? $_->{assert} : (), @{$_->{parent}{children}} ], } : (), map $_->facet_data, @$events ], [ { details => 'invalid-schema.json: "exception handling" - "no exception; expect invalid: want test failure"', pass => 0, children => [ superhashof({ details => 'evaluation result is incorrect', pass => 0, }), ], }, { details => 'invalid-schema.json: "exception handling" - "no exception; expect valid: want test pass"', pass => 1, children => [ superhashof({ details => 'test passes: data is valid: true', pass => 1, }), ], }, { details => 'invalid-schema.json: "exception handling" - "exception; expect invalid: want test failure (via exception)"', pass => 0, children => [ superhashof({ details => re(qr/^died: ach I am slain /), pass => 0, }), ], }, { details => 'invalid-schema.json: "exception handling" - "exception; expect valid: want test failure (via exception)"', pass => 0, children => [ superhashof({ details => re(qr/^died: ach I am slain /), pass => 0, }), ], }, ], 'four tests, all with correct results', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/03-validate_data.t000640 000766 000024 00000002437 14163671560 022350 0ustar00etherstaff000000 000000 # vim: set ts=8 sts=2 sw=2 tw=100 et : use strict; use warnings; use 5.020; use experimental qw(signatures postderef); no if "$]" >= 5.031009, feature => 'indirect'; no if "$]" >= 5.033001, feature => 'multidimensional'; no if "$]" >= 5.033006, feature => 'bareword_filehandles'; use Test2::API 'intercept'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Deep; use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } }; use Test::JSON::Schema::Acceptance; use lib 't/lib'; use SchemaParser; # this is similar to t/01-basic.t only it uses the new option to pass a "validate as inflated # data" subref. my $accepter = Test::JSON::Schema::Acceptance->new(specification => 'draft7'); my $parser = SchemaParser->new; my $events = intercept( sub { $accepter->acceptance(validate_data => sub ($schema, $data) { return $parser->validate_data($data, $schema); }); } ); my @bool_tests = grep $_->isa('Test2::Event::Ok') && $_->name =~ /boolean type matches booleans/, @$events; is(@bool_tests, 10, 'found all the tests that check for boolean type'); cmp_deeply( \@bool_tests, array_each(methods( pass => 1, effective_pass => 1, )), 'tests pass for checking schemas that test for boolean type', ); done_testing; Test-JSON-Schema-Acceptance-1.015/t/lib/SchemaParser.pm000640 000766 000024 00000001630 14163671560 022634 0ustar00etherstaff000000 000000 use strict; use warnings; package SchemaParser; use 5.020; use experimental qw(signatures postderef); use feature 'state'; use JSON::MaybeXS 1.002004 'is_bool'; sub new { return bless {}, __PACKAGE__; } # this is a very simple schema validator. # It only understands boolean schemas, or schemas that say {"type":"boolean"}. # Unrecognized keywords will be treated as the empty schema (i.e. a pass). sub validate_data ($self, $data, $schema) { return $schema if is_bool($schema); die 'unrecognized schema type '.ref $schema if ref $schema ne 'HASH'; return 1 if not exists $schema->{type} or ref $schema->{type} eq 'HASH'; return is_bool($data) ? 1 : 0 if $schema->{type} eq 'boolean'; return 1; } sub validate_json_string ($self, $data_string, $schema) { state $decoder = JSON::MaybeXS->new(utf8 => 1, allow_nonref => 1); return $self->validate_data($decoder->decode($data_string), $schema); } 1; Test-JSON-Schema-Acceptance-1.015/t/tests/subset/000770 000766 000024 00000000000 14163671560 021623 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/empty/000770 000766 000024 00000000000 14163671560 021454 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/unicode/000770 000766 000024 00000000000 14163671560 021744 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/mutation/000770 000766 000024 00000000000 14163671560 022156 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/000770 000766 000024 00000000000 14163671560 022122 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/bad/000770 000766 000024 00000000000 14163671560 021044 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/simple-booleans/000770 000766 000024 00000000000 14163671560 023407 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/add_resource/000770 000766 000024 00000000000 14163671560 022755 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/000770 000766 000024 00000000000 14163671560 023646 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/foo.json000644 000766 000024 00000000114 14163671560 025323 0ustar00etherstaff000000 000000 [ { "description": "hello", "schema": true, "tests": [] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/zulu.json000644 000766 000024 00000000114 14163671560 025537 0ustar00etherstaff000000 000000 [ { "description": "hello", "schema": true, "tests": [] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/optional/000770 000766 000024 00000000000 14163671560 025473 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/extra/000770 000766 000024 00000000000 14163671560 024771 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/extra/foo.json000644 000766 000024 00000000114 14163671560 026446 0ustar00etherstaff000000 000000 [ { "description": "hello", "schema": true, "tests": [] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/optional/beta.json000644 000766 000024 00000000114 14163671560 027300 0ustar00etherstaff000000 000000 [ { "description": "hello", "schema": true, "tests": [] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/include_optional/optional/alpha.json000644 000766 000024 00000000114 14163671560 027452 0ustar00etherstaff000000 000000 [ { "description": "hello", "schema": true, "tests": [] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/add_resource/foo.json000644 000766 000024 00000000351 14163671560 024435 0ustar00etherstaff000000 000000 [ { "description": "empty schema", "schema": {}, "tests": [ { "description": "integer", "data": 2, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/add_resource/remotes/000770 000766 000024 00000000000 14163671560 024433 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/add_resource/remotes/remote1.json000644 000766 000024 00000000053 14163671560 026703 0ustar00etherstaff000000 000000 { "$defs": { "foo": true } } Test-JSON-Schema-Acceptance-1.015/t/tests/add_resource/remotes/subfolder/000770 000766 000024 00000000000 14163671560 026420 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/add_resource/remotes/subfolder/remote2.json000644 000766 000024 00000000056 14163671560 030674 0ustar00etherstaff000000 000000 { "$defs": { "bar": false } } Test-JSON-Schema-Acceptance-1.015/t/tests/simple-booleans/foo.json000640 000766 000024 00000002776 14163671560 025100 0ustar00etherstaff000000 000000 [ { "description": "empty schema", "schema": {}, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] }, { "description": "false schema", "schema": false, "tests": [ { "description": "integer", "data": 2, "valid": false }, { "description": "boolean false", "data": "false", "valid": false }, { "description": "boolean true", "data": "true", "valid": false } ] }, { "description": "true schema", "schema": true, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/simple-booleans/bar.json000640 000766 000024 00000002776 14163671560 025061 0ustar00etherstaff000000 000000 [ { "description": "empty schema", "schema": {}, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] }, { "description": "false schema", "schema": false, "tests": [ { "description": "integer", "data": 2, "valid": false }, { "description": "boolean false", "data": "false", "valid": false }, { "description": "boolean true", "data": "true", "valid": false } ] }, { "description": "true schema", "schema": true, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/bad/invalid-schema.json000640 000766 000024 00000001540 14163671560 024622 0ustar00etherstaff000000 000000 [ { "description": "exception handling", "schema": true, "tests": [ { "description": "no exception; expect invalid: want test failure", "data": { "exception": false }, "valid": false }, { "description": "no exception; expect valid: want test pass", "data": { "exception": false }, "valid": true }, { "description": "exception; expect invalid: want test failure (via exception)", "data": { "exception": true }, "valid": false }, { "description": "exception; expect valid: want test failure (via exception)", "data": { "exception": true }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/main.json000640 000766 000024 00000000346 14163671560 023743 0ustar00etherstaff000000 000000 [ { "description": "test group", "schema": true, "tests": [ { "description": "test", "data": 1, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/000770 000766 000024 00000000000 14163671560 023747 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/beta/000770 000766 000024 00000000000 14163671560 024662 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/gamma/000770 000766 000024 00000000000 14163671560 025031 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/betadyne/000770 000766 000024 00000000000 14163671560 025542 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/alpha/000770 000766 000024 00000000000 14163671560 025034 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/alpha/test.json000640 000766 000024 00000000346 14163671560 026710 0ustar00etherstaff000000 000000 [ { "description": "test group", "schema": true, "tests": [ { "description": "test", "data": 1, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/betadyne/test.json000640 000766 000024 00000000346 14163671560 027416 0ustar00etherstaff000000 000000 [ { "description": "test group", "schema": true, "tests": [ { "description": "test", "data": 1, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/gamma/test.json000640 000766 000024 00000000346 14163671560 026705 0ustar00etherstaff000000 000000 [ { "description": "test group", "schema": true, "tests": [ { "description": "test", "data": 1, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/skip_dir/optional/beta/test.json000640 000766 000024 00000000346 14163671560 026536 0ustar00etherstaff000000 000000 [ { "description": "test group", "schema": true, "tests": [ { "description": "test", "data": 1, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/mutation/hash.json000640 000766 000024 00000000641 14163671560 023774 0ustar00etherstaff000000 000000 [ { "description": "mutation of hashes", "schema": { "foo": { "string": "1", "int": 1, "bigint": 99999999999999999999, "bignum": 0.2 } }, "tests": [ { "description": "object of integers", "data": { "foo": { "string": "1", "int": 1, "bigint": 99999999999999999999, "bignum": 0.2 } }, "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/unicode/unicode.json000644 000766 000024 00000004506 14163671560 024275 0ustar00etherstaff000000 000000 [ { "description": "ascii schema", "schema": { "const": "hello world" }, "tests": [ { "description": "ascii data", "data": "hello world", "valid": true }, { "description": "latin1 data", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "very wide data", "data": "ಠ_ಠ", "valid": true } ] }, { "description": "latin1 schema", "schema": { "const": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire." }, "tests": [ { "description": "ascii data", "data": "hello world", "valid": true }, { "description": "latin1 data", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "very wide data", "data": "ಠ_ಠ", "valid": true } ] }, { "description": "very wide schema", "schema": { "const": "ಠ_ಠ" }, "tests": [ { "description": "ascii data", "data": "hello world", "valid": true }, { "description": "latin1 data", "data": "Les hivers de mon enfance étaient des saisons longues, longues. Nous vivions en trois lieux: l'école, l'église et la patinoire; mais la vraie vie était sur la patinoire.", "valid": true }, { "description": "very wide data", "data": "ಠ_ಠ", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/empty/keep000644 000766 000024 00000000000 14163671560 022314 0ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/t/tests/subset/baz.json000640 000766 000024 00000000777 14163671560 023304 0ustar00etherstaff000000 000000 [ { "description": "empty schema", "schema": {}, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/subset/foo.json000640 000766 000024 00000002776 14163671560 023314 0ustar00etherstaff000000 000000 [ { "description": "empty schema", "schema": {}, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] }, { "description": "false schema", "schema": false, "tests": [ { "description": "integer", "data": 2, "valid": false }, { "description": "boolean false", "data": "false", "valid": false }, { "description": "boolean true", "data": "true", "valid": false } ] }, { "description": "true schema", "schema": true, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] } ] Test-JSON-Schema-Acceptance-1.015/t/tests/subset/bar.json000644 000766 000024 00000003001 14163671560 023257 0ustar00etherstaff000000 000000 [ { "description": "empty schema", "schema": {}, "tests": [ { "description": "integer", "data": 2, "valid": false }, { "description": "boolean false", "data": "false", "valid": false }, { "description": "boolean true", "data": "true", "valid": false } ] }, { "description": "false schema", "schema": false, "tests": [ { "description": "integer", "data": 2, "valid": true }, { "description": "boolean false", "data": "false", "valid": true }, { "description": "boolean true", "data": "true", "valid": true } ] }, { "description": "true schema", "schema": true, "tests": [ { "description": "integer", "data": 2, "valid": false }, { "description": "boolean false", "data": "false", "valid": false }, { "description": "boolean true", "data": "true", "valid": false } ] } ] Test-JSON-Schema-Acceptance-1.015/inc/OldShareDirFiles.pm000640 000766 000024 00000003351 14163671560 023144 0ustar00etherstaff000000 000000 use strict; use warnings; package inc::OldShareDirFiles; use Moose; with 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::BeforeRelease'; use Dist::Zilla::File::InMemory; use Capture::Tiny 'capture'; use Path::Tiny; use namespace::autoclean; # for every file leaving the test suite, we must replace it with an empty file so ->_test_data can # filter it out, because File::ShareDir::Install cannot remove old files when installing a new # sharedir over top. see https://rt.cpan.org/Ticket/Display.html?id=92084#txn-1324511 has removed => ( is => 'ro', isa => 'ArrayRef[Str]', required => 1 ); sub mvp_multivalue_args { qw(removed) }; sub gather_files { my $self = shift; foreach my $filename (@{$self->removed}) { my $content = path('share/tests')->subsumes($filename) ? '[]' : path('share/remotes')->subsumes($filename) ? '{}' : die "don't know how to handle filename '$filename'"; $self->add_file(Dist::Zilla::File::InMemory->new({ name => $filename, content => $content })) } return; } sub before_release { my $self = shift; my $distname = $self->zilla->name; my $version = $self->zilla->version; my ($diff, $error) = capture { system('diff', '-u', $distname.'-'.sprintf("%.3f", $version-0.001).'/MANIFEST', $distname.'-'.$version.'/MANIFEST'); }; die $error if $error; # skip old share/tests/draft-future -- not officially supported by any implementation # (now known as draft-next) $diff =~ s{^-share/tests/draft-future/.+\n}{}gm; if (my @missing = map s/^-//r, grep m{^-share/}, split /\n/, $diff) { $self->log_fatal(join "\n", '', 'These files were removed from the test suite and must be added to the config for [=inc::OldShareDirFiles]:', @missing, '', ); } } 1; Test-JSON-Schema-Acceptance-1.015/inc/ExtUtils/000770 000766 000024 00000000000 14163671560 021243 5ustar00etherstaff000000 000000 Test-JSON-Schema-Acceptance-1.015/inc/ExtUtils/HasCompiler.pm000644 000766 000024 00000022336 14163671560 024020 0ustar00etherstaff000000 000000 package ExtUtils::HasCompiler; $ExtUtils::HasCompiler::VERSION = '0.023'; use strict; use warnings; use base 'Exporter'; our @EXPORT_OK = qw/can_compile_loadable_object can_compile_static_library can_compile_extension/; our %EXPORT_TAGS = (all => \@EXPORT_OK); use Config; use Carp 'carp'; use File::Basename 'basename'; use File::Spec::Functions qw/catfile catdir rel2abs/; use File::Temp qw/tempdir tempfile/; my $tempdir = tempdir('HASCOMPILERXXXX', CLEANUP => 1, DIR => '.'); my $loadable_object_format = <<'END'; #define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #ifndef PERL_UNUSED_VAR #define PERL_UNUSED_VAR(var) #endif XS(exported) { #ifdef dVAR dVAR; #endif dXSARGS; PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ XSRETURN_IV(42); } #ifndef XS_EXTERNAL #define XS_EXTERNAL(foo) XS(foo) #endif /* we don't want to mess with .def files on mingw */ #if defined(WIN32) && defined(__GNUC__) # define EXPORT __declspec(dllexport) #else # define EXPORT #endif EXPORT XS_EXTERNAL(boot_%s) { #ifdef dVAR dVAR; #endif dXSARGS; PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ newXS("%s::exported", exported, __FILE__); } END my $counter = 1; my %prelinking = map { $_ => 1 } qw/MSWin32 VMS aix/; sub can_compile_loadable_object { my %args = @_; my $output = $args{output} || \*STDOUT; my $config = $args{config} || 'ExtUtils::HasCompiler::Config'; return if not $config->get('usedl'); my ($source_handle, $source_name) = tempfile('TESTXXXX', DIR => $tempdir, SUFFIX => '.c', UNLINK => 1); my $basename = basename($source_name, '.c'); my $abs_basename = catfile($tempdir, $basename); my ($cc, $ccflags, $optimize, $cccdlflags, $ld, $ldflags, $lddlflags, $libperl, $perllibs, $archlibexp, $_o, $dlext) = map { $config->get($_) } qw/cc ccflags optimize cccdlflags ld ldflags lddlflags libperl perllibs archlibexp _o dlext/; my $incdir = catdir($archlibexp, 'CORE'); my $object_file = $abs_basename.$_o; my $loadable_object = "$abs_basename.$dlext"; my @commands; if ($^O eq 'MSWin32' && $cc =~ /^cl/) { push @commands, qq{$cc $ccflags $cccdlflags $optimize /I "$incdir" /c $source_name /Fo$object_file}; push @commands, qq{$ld $object_file $lddlflags $libperl $perllibs /out:$loadable_object /def:$abs_basename.def /pdb:$abs_basename.pdb}; } elsif ($^O eq 'VMS') { # Mksymlists is only the beginning of the story. open my $opt_fh, '>>', "$abs_basename.opt" or do { carp "Couldn't append to '$abs_basename.opt'"; return }; print $opt_fh "PerlShr/Share\n"; close $opt_fh; my $incdirs = $ccflags =~ s{ /inc[^=]+ (?:=)+ (?:\()? ( [^\/\)]* ) }{}xi ? "$1,$incdir" : $incdir; push @commands, qq{$cc $ccflags $optimize /include=($incdirs) $cccdlflags $source_name /obj=$object_file}; push @commands, qq{$ld $ldflags $lddlflags=$loadable_object $object_file,$abs_basename.opt/OPTIONS,${incdir}perlshr_attr.opt/OPTIONS' $perllibs}; } else { my @extra; my $inc = qq{"-I$incdir"}; if ($^O eq 'MSWin32') { my $lib = '-l' . ($libperl =~ /lib([^.]+)\./)[0]; push @extra, "$abs_basename.def", $lib, $perllibs; } elsif ($^O =~ /^(cygwin|msys)$/) { push @extra, catfile($incdir, $config->get('useshrplib') ? 'libperl.dll.a' : 'libperl.a'); } elsif ($^O eq 'aix') { $lddlflags =~ s/\Q$(BASEEXT)\E/$abs_basename/; $lddlflags =~ s/\Q$(PERL_INC)\E/$incdir/; } elsif ($^O eq 'android') { push @extra, qq{"-L$incdir"}, '-lperl', $perllibs; } elsif ($^O eq 'darwin' && $config->get('perlpath') eq '/usr/bin/perl' && ($config->get('osvers') =~ /(\d+)/)[0] >= 18) { $inc = qq{-iwithsysroot "$incdir"}; } push @commands, qq{$cc $ccflags $optimize $inc $cccdlflags -c $source_name -o $object_file}; push @commands, qq{$ld $object_file -o $loadable_object $lddlflags @extra}; } if ($prelinking{$^O}) { require ExtUtils::Mksymlists; ExtUtils::Mksymlists::Mksymlists(NAME => $basename, FILE => $abs_basename, IMPORTS => {}); } my $shortname = '_Loadable' . $counter++; my $package = "ExtUtils::HasCompiler::$shortname"; printf $source_handle $loadable_object_format, $basename, $package or do { carp "Couldn't write to $source_name: $!"; return }; close $source_handle or do { carp "Couldn't close $source_name: $!"; return }; for my $command (@commands) { print $output "$command\n" if not $args{quiet}; system $command and do { carp "Couldn't execute $command: $!"; return }; } # Skip loading when cross-compiling return 1 if exists $args{skip_load} ? $args{skip_load} : $config->get('usecrosscompile'); require DynaLoader; local @DynaLoader::dl_require_symbols = "boot_$basename"; my $handle = DynaLoader::dl_load_file(rel2abs($loadable_object), 0); if ($handle) { my $symbol = DynaLoader::dl_find_symbol($handle, "boot_$basename") or do { carp "Couldn't find boot symbol for $basename"; return }; my $compilet = DynaLoader::dl_install_xsub('__ANON__::__ANON__', $symbol, $source_name); my $ret = eval { $compilet->(); $package->exported } or carp $@; delete $ExtUtils::HasCompiler::{"$shortname\::"}; eval { DynaLoader::dl_unload_file($handle) } or carp $@; return defined $ret && $ret == 42; } else { carp "Couldn't load $loadable_object: " . DynaLoader::dl_error(); return; } } my %static_unsupported_on = map { $_ => 1 } qw/VMS aix MSWin32 cygwin/; sub can_compile_static_library { my %args = @_; my $output = $args{output} || \*STDOUT; my $config = $args{config} || 'ExtUtils::HasCompiler::Config'; return if $config->get('useshrplib') eq 'true'; my ($source_handle, $source_name) = tempfile('TESTXXXX', DIR => $tempdir, SUFFIX => '.c', UNLINK => 1); my $basename = basename($source_name, '.c'); my $abs_basename = catfile($tempdir, $basename); my ($cc, $ccflags, $optimize, $ar, $full_ar, $ranlib, $archlibexp, $_o, $lib_ext) = map { $config->get($_) } qw/cc ccflags optimize ar full_ar ranlib archlibexp _o lib_ext/; my $incdir = catdir($archlibexp, 'CORE'); my $object_file = "$abs_basename$_o"; my $static_library = $abs_basename.$lib_ext; my @commands; if ($static_unsupported_on{$^O}) { return; } else { my $my_ar = length $full_ar ? $full_ar : $ar; push @commands, qq{$cc $ccflags $optimize "-I$incdir" -c $source_name -o $object_file}; push @commands, qq{$my_ar cr $static_library $object_file}; push @commands, qq{$ranlib $static_library} if $ranlib ne ':'; } my $shortname = '_Loadable' . $counter++; my $package = "ExtUtils::HasCompiler::$shortname"; printf $source_handle $loadable_object_format, $basename, $package or do { carp "Couldn't write to $source_name: $!"; return }; close $source_handle or do { carp "Couldn't close $source_name: $!"; return }; for my $command (@commands) { print $output "$command\n" if not $args{quiet}; system $command and do { carp "Couldn't execute $command: $!"; return }; } return 1; } sub can_compile_extension { my %args = @_; $args{config} ||= 'ExtUtils::HasCompiler::Config'; my $linktype = $args{linktype} || ($args{config}->get('usedl') ? 'dynamic' : 'static'); return $linktype eq 'static' ? can_compile_static_library(%args) : can_compile_loadable_object(%args); } sub ExtUtils::HasCompiler::Config::get { my (undef, $key) = @_; return $ENV{uc $key} || $Config{$key}; } 1; # ABSTRACT: Check for the presence of a compiler __END__ =pod =encoding UTF-8 =head1 NAME ExtUtils::HasCompiler - Check for the presence of a compiler =head1 VERSION version 0.023 =head1 SYNOPSIS use ExtUtils::HasCompiler 'can_compile_extension'; if (can_compile_extension()) { ... } else { ... } =head1 DESCRIPTION This module tries to check if the current system is capable of compiling, linking and loading an XS module. B: this is an early release, interface stability isn't guaranteed yet. =head1 FUNCTIONS =head2 can_compile_loadable_object(%opts) This checks if the system can compile, link and load a perl loadable object. It may take the following options: =over 4 =item * quiet Do not output the executed compilation commands. =item * config An L (compatible) object for configuration. =item * skip_load This causes can_compile_loadable_object to not try to load the generated object. This defaults to true on a cross-compiling perl. =back =head2 can_compile_static_library(%opts) This checks if the system can compile and link a perl static library. It does not check it it can compile a new perl with it. It may take the following options: =over 4 =item * quiet Do not output the executed compilation commands. =item * config An L (compatible) object for configuration. =back =head2 can_compile_extension(%opts) This will call either C, or C, depending on which is the default on your configuration. In addition to the arguments listed above, it can take one more optional argument: =over 4 =item * linktype This will force the linktype to be either static or dynamic. Dynamic compilation on a static perl won't work, but static libraries can be viable on a dynamic perl. =back =head1 AUTHOR Leon Timmermans =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014 by Leon Timmermans. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut