summaryrefslogtreecommitdiff
path: root/docs/errors.rst
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2013-12-25 13:27:46 -0500
committerJulian Berman <Julian@GrayVines.com>2013-12-25 13:27:46 -0500
commit44b35706a7476fb42ac47520860b63aeebfe39e5 (patch)
treed500f356fefdeaaf7b4b6fd279578bc0c8ac19b3 /docs/errors.rst
parent8eae430d66d7032e76c57d36b69af79935e28ec1 (diff)
downloadjsonschema-44b35706a7476fb42ac47520860b63aeebfe39e5.tar.gz
Add absolute path and absolute schema path.
Closes #120
Diffstat (limited to 'docs/errors.rst')
-rw-r--r--docs/errors.rst37
1 files changed, 33 insertions, 4 deletions
diff --git a/docs/errors.rst b/docs/errors.rst
index d49954f..1956c35 100644
--- a/docs/errors.rst
+++ b/docs/errors.rst
@@ -49,16 +49,40 @@ raised or returned, depending on which method or function is used.
subschema from within the schema that was passed into the validator, or
even an entirely different schema if a :validator:`$ref` was followed.
- .. attribute:: schema_path
+ .. attribute:: relative_schema_path
A :class:`collections.deque` containing the path to the failed
validator within the schema.
+ .. attribute:: absolute_schema_path
+
+ A :class:`collections.deque` containing the path to the failed
+ validator within the schema, but always relative to the
+ *original* schema as opposed to any subschema (i.e. the one
+ originally passed into a validator, *not* :attr:`schema`\).
+
+ .. attribute:: schema_path
+
+ Same as :attr:`relative_schema_path`.
+
+ .. attribute:: relative_path
+
+ A :class:`collections.deque` containing the path to the
+ offending element within the instance. The deque can be empty if
+ the error happened at the root of the instance.
+
+ .. attribute:: absolute_path
+
+ A :class:`collections.deque` containing the path to the
+ offending element within the instance. The absolute path
+ is always relative to the *original* instance that was
+ validated (i.e. the one passed into a validation method, *not*
+ :attr:`instance`\). The deque can be empty if the error happened
+ at the root of the instance.
+
.. attribute:: path
- A :class:`collections.deque` containing the path to the offending
- element within the instance. The deque can be empty if the error
- happened at the root of the instance.
+ Same as :attr:`relative_path`.
.. attribute:: instance
@@ -82,6 +106,11 @@ raised or returned, depending on which method or function is used.
object will be here. Currently this is only used for the exception
raised by a failed format checker in :meth:`FormatChecker.check`.
+ .. attribute:: parent
+
+ A validation error which this error is the :attr:`context` of.
+ ``None`` if there wasn't one.
+
In case an invalid schema itself is encountered, a :exc:`SchemaError` is
raised.