File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -185,14 +185,24 @@ implements.
185185.. autoclass :: Draft4Validator
186186
187187For 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/
You can’t perform that action at this time.
0 commit comments