diff options
author | Julian Berman <Julian@GrayVines.com> | 2013-01-12 23:14:18 -0500 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2013-01-12 23:14:18 -0500 |
commit | 7e29d364811a3bf714f2ae39a9cdee380f1b32c0 (patch) | |
tree | 2649508d410590469d084f555fa97e0aed31e4ee /docs/index.rst | |
parent | 69025fda786e6d0a4af2c224153c88e10292b666 (diff) | |
download | jsonschema-7e29d364811a3bf714f2ae39a9cdee380f1b32c0.tar.gz |
Rename folder
Diffstat (limited to 'docs/index.rst')
-rw-r--r-- | docs/index.rst | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..f64e900 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,45 @@ +========== +jsonschema +========== + +``jsonschema`` is an implementation of `JSON Schema <http://json-schema.org>`_ +for Python (supporting 2.6+ including Python 3). + +.. code-block:: python + + >>> from jsonschema import validate + + >>> # A sample schema, like what we'd get from json.load() + >>> schema = { + ... "type" : "object", + ... "properties" : { + ... "price" : {"type" : "number"}, + ... "name" : {"type" : "string"}, + ... }, + ... } + + >>> # If no exception is raised by validate(), the instance is valid. + >>> validate({"name" : "Eggs", "price" : 34.99}, schema) + + >>> validate( + ... {"name" : "Eggs", "price" : "Invalid"}, schema + ... ) # doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + ValidationError: 'Invalid' is not of type 'number' + + +Contents: + +.. toctree:: + :maxdepth: 2 + + validate + errors + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` |