Skip to content

Commit c13afc1

Browse files
committed
Didn't mean to remove the signatures.
1 parent 9a96193 commit c13afc1

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

docs/errors.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,31 @@ When an invalid instance is encountered, a :exc:`ValidationError` will be
88
raised or returned, depending on which method or function is used.
99

1010
.. autoexception:: ValidationError
11-
:members:
11+
12+
The instance didn't properly validate under the provided schema.
13+
14+
.. attribute:: message
15+
16+
A human readable message explaining the error.
17+
18+
.. attribute:: validator
19+
20+
The failed validator.
21+
22+
.. attribute:: path
23+
24+
A list containing the path to the offending element (or [] if the error
25+
happened globally) in *reverse* order (i.e. deepest index first).
26+
1227

1328
In case an invalid schema itself is encountered, a :exc:`SchemaError` is
1429
raised.
1530

1631
.. autoexception:: SchemaError
17-
:members:
32+
33+
The provided schema is malformed.
34+
35+
The same attributes are present as for :exc:`ValidationError`\s.
1836

1937
ErrorTrees
2038
----------

docs/validate.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Basics
1212
The simplest way to validate an instance under a given schema is to use the
1313
:func:`validate` function.
1414

15-
.. function:: validate
15+
.. autofunction:: validate
1616

1717
Validate an ``instance`` under the given ``schema``.
1818

@@ -258,7 +258,7 @@ any use for them. They are listed below, along with any limitations they come
258258
with.
259259

260260

261-
.. function:: is_date
261+
.. autofunction:: is_date
262262

263263
Check if the instance is a date in ``YYYY-MM-DD`` format.
264264

@@ -269,7 +269,7 @@ with.
269269
>>> is_date("0000-13-32")
270270
False
271271

272-
.. function:: is_time
272+
.. autofunction:: is_time
273273

274274
Check if the instance is a time in ``hh:mm:ss`` format.
275275

@@ -280,7 +280,7 @@ with.
280280
>>> is_time("59:60:61")
281281
False
282282

283-
.. function:: is_regex
283+
.. autofunction:: is_regex
284284

285285
Check if the instance is a well-formed regular expression.
286286

@@ -289,7 +289,7 @@ with.
289289
>>> is_ipv6("^(bob?cat$")
290290
False
291291

292-
.. function:: is_uri
292+
.. autofunction:: is_uri
293293

294294
Check if the instance is a valid URI.
295295

@@ -304,7 +304,7 @@ with.
304304
>>> is_uri("#/properties/foo")
305305
True
306306

307-
.. function:: is_email
307+
.. autofunction:: is_email
308308

309309
Check if the instance is a valid e-mail address.
310310

@@ -317,7 +317,7 @@ with.
317317

318318
.. _RFC 2822: http://tools.ietf.org/html/rfc2822
319319

320-
.. function:: is_host_name
320+
.. autofunction:: is_host_name
321321

322322
Check if the instance is a valid host name.
323323

@@ -336,7 +336,7 @@ with.
336336
>>> is_host_name("www.example.doesnotexist")
337337
True
338338

339-
.. function:: is_ip_address
339+
.. autofunction:: is_ip_address
340340

341341
Check if the instance is a valid IP address.
342342

@@ -350,7 +350,7 @@ with.
350350
On OSes with the ``socket.inet_pton`` function, an additional checker for
351351
``ipv6`` will be enabled:
352352

353-
.. function:: is_ipv6
353+
.. function:: is_ipv6(instance)
354354

355355
Check if the instance is a valid IPv6 address.
356356

@@ -364,7 +364,7 @@ On OSes with the ``socket.inet_pton`` function, an additional checker for
364364

365365
If the isodate_ library is present, a date-time checker will also be present.
366366

367-
.. function:: is_date_time
367+
.. function:: is_date_time(instance)
368368

369369
Check if the instance is in ISO 8601 ``YYYY-MM-DDThh:mm:ssZ`` format.
370370

@@ -377,7 +377,7 @@ If the isodate_ library is present, a date-time checker will also be present.
377377
Additionally, if the webcolors_ library is present, some checkers related to
378378
CSS will be enabled:
379379

380-
.. function:: is_css21_color
380+
.. function:: is_css21_color(instance)
381381

382382
Check if the instance is a valid CSS 2.1 color name or code.
383383

@@ -388,7 +388,7 @@ CSS will be enabled:
388388
>>> is_css_color_code("#CC8899")
389389
True
390390

391-
.. function:: is_css3_color
391+
.. function:: is_css3_color(instance)
392392

393393
Check if the instance is a valid CSS 3 color name or code.
394394

jsonschema.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ class RefResolutionError(Exception):
8787

8888

8989
class SchemaError(Exception):
90-
"""
91-
The provided schema is malformed.
92-
93-
The same attributes are present as for :exc:`ValidationError`\s.
94-
95-
"""
96-
9790
def __init__(self, message, validator=None, path=()):
9891
super(SchemaError, self).__init__(message, validator, path)
9992
self.message = message
@@ -105,17 +98,6 @@ def __str__(self):
10598

10699

107100
class ValidationError(Exception):
108-
"""
109-
The instance didn't properly validate under the provided schema.
110-
111-
Relevant attributes are:
112-
* ``message`` : a human readable message explaining the error
113-
* ``path`` : a list containing the path to the offending element (or []
114-
if the error happened globally) in *reverse* order (i.e.
115-
deepest index first).
116-
117-
"""
118-
119101
def __init__(self, message, validator=None, path=()):
120102
# Any validator that recurses (e.g. properties and items) must append
121103
# to the ValidationError's path to properly maintain where in the

0 commit comments

Comments
 (0)