Skip to content

Commit ac0dee4

Browse files
committed
updating per feedback
updating per feedback
1 parent f9b1e32 commit ac0dee4

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

docs/validate.rst

+14-5
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,24 @@ implements.
185185
.. autoclass:: Draft4Validator
186186

187187
For example, if you wanted to validate a schema you created against the Draft 3
188-
json schema, you could use::
188+
json schema, you could use:
189189

190190
.. code-block:: python
191191
192192
193-
from jsonschema import Draft3Validator
194-
my_schema = json.loads(my_schema_file)
195-
Draft3Validator.check_schema(schema)
193+
from jsonschema import Draft4Validator
194+
195+
schema = {
196+
"$schema": "http://json-schema.org/schema#"
197+
198+
"type": "object",
199+
"properties": {
200+
"name": {"type": "string"},
201+
"email": {"type": "string"},
202+
}
203+
"required": ["email"],
204+
}
205+
Draft4Validator.check_schema(schema)
196206
197207
198208
Validating Formats
@@ -273,4 +283,3 @@ color requires webcolors_
273283
.. _rfc3987: http://pypi.python.org/pypi/rfc3987/
274284
.. _strict-rfc3339: http://pypi.python.org/pypi/strict-rfc3339/
275285
.. _webcolors: http://pypi.python.org/pypi/webcolors/
276-
.. _understanding_json_schema: http://spacetelescope.github.io/understanding-json-schema/

0 commit comments

Comments
 (0)