<NME> README.rst
<BEF> ==========
jsonschema
==========

|PyPI| |Pythons| |CI| |ReadTheDocs| |Precommit| |Zenodo|

.. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema.svg
   :alt: PyPI version
   :target: https://pypi.org/project/jsonschema/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema.svg
   :alt: Supported Python versions
   :target: https://pypi.org/project/jsonschema/

.. |CI| image:: https://github.com/python-jsonschema/jsonschema/workflows/CI/badge.svg
  :alt: Build status
  :target: https://github.com/python-jsonschema/jsonschema/actions?query=workflow%3ACI

.. |ReadTheDocs| image:: https://readthedocs.org/projects/python-jsonschema/badge/?version=stable&style=flat
   :alt: ReadTheDocs status
   :target: https://python-jsonschema.readthedocs.io/en/stable/

.. |Precommit| image:: https://results.pre-commit.ci/badge/github/python-jsonschema/jsonschema/main.svg
   :alt: pre-commit.ci status
    Traceback (most recent call last):
        ...
    ValidationError: 'Invalid' is not of type 'number'
.. code-block:: bash

    $ pip install jsonschema'[format]'

Be aware that the mere presence of these dependencies – or even the specification of ``format`` checks in a schema – do *not* activate format checks (as per the specification).
Please read the `format validation documentation <https://python-jsonschema.readthedocs.io/en/latest/validate/#validating-formats>`_ for further details.

.. start cut from PyPI

Running the Test Suite
----------------------

If you have ``tox`` installed (perhaps via ``pip install tox`` or your
package manager), running ``tox`` in the directory of your source
checkout will run ``jsonschema``'s test suite on all of the versions
of Python ``jsonschema`` supports. If you don't have all of the
versions that ``jsonschema`` is tested under, you'll likely want to run
using ``tox``'s ``--skip-missing-interpreters`` option.

Of course you're also free to just run the tests on a single version with your
favorite test runner. The tests live in the ``jsonschema.tests`` package.


Benchmarks
----------

``jsonschema``'s benchmarks make use of `pyperf
<https://pyperf.readthedocs.io>`_. Running them can be done via::

      $ tox -e perf


Community
---------

The JSON Schema specification has `a Slack
<https://json-schema.slack.com>`_, with an `invite link on its home page
<https://json-schema.org/>`_. Many folks knowledgeable on authoring
schemas can be found there.

Otherwise, asking questions on Stack Overflow is another means of
getting help if you're stuck.

.. end cut from PyPI


About
-----

I'm Julian Berman.

``jsonschema`` is on `GitHub <https://github.com/python-jsonschema/jsonschema>`_.

Get in touch, via GitHub or otherwise, if you've got something to contribute,
it'd be most welcome!

You can also generally find me on Libera (nick: ``Julian``) in various
channels, including ``#python``.

If you feel overwhelmingly grateful, you can also `sponsor me
<https://github.com/sponsors/Julian/>`_.

And for companies who appreciate ``jsonschema`` and its continued support
and growth, ``jsonschema`` is also now supportable via `TideLift
<https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-j
sonschema&utm_medium=referral&utm_campaign=readme>`_.

<MSG> Some more documentation

<DFF> @@ -25,3 +25,79 @@ jsonschema
     Traceback (most recent call last):
         ...
     ValidationError: 'Invalid' is not of type 'number'
+
+
+Features
+--------
+
+* Support for Draft 3 of the Schema with the exception of
+    * ``$ref``, and ``extends`` that use ``$ref``\s
+    * ``format``, though the schema does not mandate it anyhow. Note however
+      that by default, ``jsonschema`` is strict about unknown properties, so
+      using ``format`` without passing ``unknown_property="skip"`` to a
+      validator will raise a ``SchemaError`` until it is properly supported.
+
+* Validation that reports *all* errors, rather than short-circuiting on the
+  first validation error (off by default)::
+
+    >>> from jsonschema import ValidationError, validate
+    >>> schema = {
+    ...     "type" : "array",
+    ...     "items" : {"enum" : [1, 2, 3]},
+    ...     "maxItems" : 2,
+    ... }
+    >>> try:
+    ...     validate([2, 3, 4], schema, stop_on_error=False)
+    ... except ValidationError as e:
+    ...     print "Validation failed with errors:"
+    ...     for error in sorted(e.errors):
+    ...         print "    * " + error
+    Validation failed with errors:
+        * 4 is not one of [1, 2, 3]
+        * [2, 3, 4] is too long
+
+* Small, extensibile, strict! and has as clean of an API as is feasible
+
+Note: the API is still considered *unstable*, though no major changes are
+expected.
+
+
+Schema Versioning
+-----------------
+
+JSON Schema is, at the time of this writing, seemingly at draft 03, with
+preparations for draft 04 underway. The current plan is likely to have
+the validators in this module take a ``version`` argument, which will allow
+support for future versions. Whether draft 03 will remain the default version
+used or not is undecided, so to be safe, *explicitly* declare which version of
+the schema you will be validating with.
+
+
+A Quick Word on uniqueItems
+---------------------------
+
+Validating schemas with the ``uniqueItems`` property can leave you open to
+algorithmic complexity attacks. This may change in the future. For now,
+``jsonschema`` will warn you if you use ``uniqueitems`` without using the
+`Securetypes <http://github.com/ludios/Securetypes>`_ module, but will proceed
+anyhow if it couldn't be imported.
+
+
+TODO
+----
+
+* Optimize ``extends`` to prevent doing double work
+* Implement some time of prioritizing, to allow quick validation checks to run
+  first
+
+
+Contributing and Contact Info
+-----------------------------
+
+I'm Julian Berman :).
+
+You can generally find me on Freenode (nick: ``tos9``) in various channels,
+including ``#python``.
+
+Get in touch here or there if you've got something to contribute, it'd be most
+welcome!

{'addition_count': 76, 'commit_subject': 'Some more documentation', 'deletion_count': 0, 'file_extension': '.rst', 'lang': 'rst', 'license': 'mit', 'repo_name': 'Julian/jsonschema'}