From 35b60f390098d3306c03eee27ceec8cf8a493579 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 2 Nov 2013 20:53:22 -0400 Subject: Release v2.3.0 --- CHANGELOG.rst | 7 +++++++ README.rst | 29 +++++++++++++++++++++++++++-- jsonschema/__init__.py | 2 +- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 00f35f7..5d626e8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,10 @@ +v2.3.0 +------ + +* 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) + v2.2.0 ------ diff --git a/README.rst b/README.rst index b4847f2..b1a1109 100644 --- a/README.rst +++ b/README.rst @@ -49,8 +49,33 @@ Features Release Notes ------------- -``v2.2.0`` contains a minor speedup for the ``host-name`` format and a small -change in draft 3's allowed types. +``v2.3.0`` removes the (improper) limitation of ``format`` to strings. It also +adds the `jsonschema.exceptions.best_match `_ +function which can be used to guess at the best matching single validation +error for a given instance. + + +.. 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). Running the Test Suite diff --git a/jsonschema/__init__.py b/jsonschema/__init__.py index bd2077d..c5fc46c 100644 --- a/jsonschema/__init__.py +++ b/jsonschema/__init__.py @@ -20,7 +20,7 @@ from jsonschema.validators import ( ) -__version__ = "2.3.0-dev" +__version__ = "2.3.0" # flake8: noqa -- cgit v1.2.1