Release notes for v2.4.0

This commit is contained in:
Julian Berman 2014-08-18 20:53:47 -04:00
parent 470a8c6a90
commit a97473c1b6
No known key found for this signature in database
GPG Key ID: 3F8D9C8C011729F8
2 changed files with 16 additions and 27 deletions

View File

@ -1,7 +1,15 @@
v2.4.0
------
* Added a CLI (#134)
* Added absolute path and absolute schema path to errors (#120)
* Added ``relevance``
* Meta-schemas are now loaded via ``pkgutil``
v2.3.0
------
* Added by_relevance and best_match (#91)
* Added ``by_relevance`` and ``best_match`` (#91)
* Fixed ``format`` to allow adding formats for non-strings (#125)
* Fixed the ``uri`` format to reject URI references (#131)

View File

@ -49,33 +49,14 @@ Features
Release Notes
-------------
``v2.3.0`` removes the (improper) limitation of ``format`` to strings. It also
adds the `jsonschema.exceptions.best_match <https://python-jsonschema.readthedocs.org/en/latest/errors/#best-match-and-by-relevance>`_
function which can be used to guess at the best matching single validation
error for a given instance.
* A simple CLI was added for validation
* Validation errors now keep full absolute paths and absolute schema paths in
their ``absolute_path`` and ``absolute_schema_path`` attributes. The ``path``
and ``schema_path`` attributes are deprecated in favor of ``relative_path``
and ``relative_schema_path``\ .
.. code-block:: python
>>> from jsonschema.validators import Draft4Validator
>>> from jsonschema.exceptions import best_match
>>> schema = {
... "properties" : {
... "foo" : {"type" : "string"},
... "bar" : {"properties" : {"baz": {"type": "string"}}},
... },
... }
>>> instance = {"foo" : 12, "bar": {"baz" : 19}}
>>> print(best_match(Draft4Validator(schema).iter_errors(instance)).path)
deque(['foo'])
where the error closer to the top of the instance in ``foo`` was selected
as being more relevant.
Also, URI references are now properly rejected by the URI format validator
(i.e., it now only accepts full URIs, as defined in the specification).
*Note:* Support for Python 3.2 was dropped in this release, and installation
now uses setuptools.
Running the Test Suite