Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

UNKNOWN

Project Description
.. image:: https://drone.io/bitbucket.org/eodolphi/json-hyper-schema/status.png
:target: https://drone.io/bitbucket.org/eodolphi/json-hyper-schema/latest


JSON Hyper Schema
=============

Implementation of json schema draft 03

http://tools.ietf.org/html/draft-zyp-json-schema-03

Installation
------------

$ pip install json_hyper_schema

Usage
------------

JSON Hyper Schema makes it possible to validate arbitrary json objects against a json schema.

>>> form json_hyper_schema import Schema

>>> schema = Schema(
{
'properties': {
'a': {'type': 'string', 'enum': ['a', 'b']},
'b': {
'type': 'array',
'items': {
'properties': {
'b': {'type': 'string', 'enum': ['c', 'd']},
'c': {'uuid': True}
}
}
},
'c': {'default': 'blabla'}
},
'links': [
{
'href': '/id/{a}',
'rel': 'self'
}]
})

>>> schema.validate({'a': 'b', 'b': [{'b': 'c'}, {'b': 'd'}]})

If the data is not valid against the schema a `json_schema.ValidationError` will be raised. This will contain a dictionary of errors. The keys of the dictionary are `json_pointer.Pointer` pointers to the invalid field
Release History

Release History

This version
History Node

0.4.1

History Node

0.4

History Node

0.3

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting