DDL equivalent for JSON data?

1,068 views
Skip to first unread message

Carles Barrobés

unread,
May 14, 2012, 10:21:44 AM5/14/12
to django-res...@googlegroups.com
Hi guys, 

(Disclaimer: this question is not related to DRF, but since it falls within the realm of HTTP APIs I thought you might have some knowledge or insights.)

Do you know of any initiatives regarding defining schemas for JSON APIs, so that they can be used for generic data validation?
(the equivalent of DTD in the XML world?)

Thanks,
Carles

Max Arnold

unread,
May 14, 2012, 1:35:29 PM5/14/12
to django-res...@googlegroups.com
On Mon, May 14, 2012 at 07:21:44AM -0700, Carles Barrobés wrote:
> Do you know of any initiatives regarding defining schemas for JSON APIs, so
> that they can be used for generic data validation?
> (the equivalent of DTD in the XML world?)

There is IETF draft for JSON schema http://tools.ietf.org/html/draft-zyp-json-schema-03
(also see http://json-schema.org) and several python implementations:

https://github.com/zyga/json-schema-validator
https://github.com/sunlightlabs/validictory
http://code.google.com/p/jsonvalidator/
https://github.com/onyxfish/jsonschema

I haven't investigated them yet (some are old/unmaintained and may not conform to the latest draft),
but I think it is a good starting point.

Carles Barrobés

unread,
May 14, 2012, 5:06:40 PM5/14/12
to django-res...@googlegroups.com
Thanks! In the meantime I found this that looks promising, because of its low verbosity: http://orderly-json.org/

Has any of you actually used any of these?
Reply all
Reply to author
Forward
0 new messages