summaryrefslogtreecommitdiff
path: root/jsonschema
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-08-20 11:28:57 +0300
committerJulian Berman <Julian@GrayVines.com>2022-08-20 11:28:59 +0300
commitedba224b2de94122d4009eef24163f3fd6e43ead (patch)
tree27ad2b5acb202136ff6068adb3c33c1ac4e97484 /jsonschema
parent28a8666e887cb25e14679a6eb4a3d912795946e1 (diff)
downloadjsonschema-edba224b2de94122d4009eef24163f3fd6e43ead.tar.gz
Standardize the format of Raises: in napolean docstrings.
Sphinx appears to 'helpfully' silently truncate the line if any text is put on the same line as the exception, i.e.: Raises: foo, if bar just silently produces: foo - and throws the line away...
Diffstat (limited to 'jsonschema')
-rw-r--r--jsonschema/_format.py5
-rw-r--r--jsonschema/_types.py3
-rw-r--r--jsonschema/protocols.py6
-rw-r--r--jsonschema/validators.py10
4 files changed, 14 insertions, 10 deletions
diff --git a/jsonschema/_format.py b/jsonschema/_format.py
index f687b74..e9d91b6 100644
--- a/jsonschema/_format.py
+++ b/jsonschema/_format.py
@@ -105,10 +105,11 @@ class FormatChecker:
The format that instance should conform to
-
Raises:
- FormatError: if the instance does not conform to ``format``
+ FormatError:
+
+ if the instance does not conform to ``format``
"""
if format not in self.checkers:
diff --git a/jsonschema/_types.py b/jsonschema/_types.py
index e858290..20ca418 100644
--- a/jsonschema/_types.py
+++ b/jsonschema/_types.py
@@ -112,7 +112,8 @@ class TypeChecker:
Raises:
`jsonschema.exceptions.UndefinedTypeCheck`:
- if type is unknown to this object.
+
+ if ``type`` is unknown to this object.
"""
try:
fn = self._type_checkers[type]
diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py
index 289cfa8..ac7b7b7 100644
--- a/jsonschema/protocols.py
+++ b/jsonschema/protocols.py
@@ -111,7 +111,7 @@ class Validator(Protocol):
Raises:
- `jsonschema.exceptions.SchemaError`
+ `jsonschema.exceptions.SchemaError`:
if the schema is invalid
"""
@@ -136,7 +136,7 @@ class Validator(Protocol):
Raises:
- `jsonschema.exceptions.UnknownType`
+ `jsonschema.exceptions.UnknownType`:
if ``type`` is not a known type
"""
@@ -176,7 +176,7 @@ class Validator(Protocol):
Raises:
- `jsonschema.exceptions.ValidationError`
+ `jsonschema.exceptions.ValidationError`:
if the instance is invalid
diff --git a/jsonschema/validators.py b/jsonschema/validators.py
index 39e2990..718c4bd 100644
--- a/jsonschema/validators.py
+++ b/jsonschema/validators.py
@@ -1076,11 +1076,13 @@ def validate(instance, schema, cls=None, *args, **kwargs):
Raises:
- `jsonschema.exceptions.ValidationError` if the instance
- is invalid
+ `jsonschema.exceptions.ValidationError`:
- `jsonschema.exceptions.SchemaError` if the schema itself
- is invalid
+ if the instance is invalid
+
+ `jsonschema.exceptions.SchemaError`:
+
+ if the schema itself is invalid
.. rubric:: Footnotes
.. [#] known by a validator registered with