incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Ramage <ryan.ram...@gmail.com>
Subject Re: How does one validate CouchDB documents with JSON Schema?
Date Tue, 12 Apr 2011 20:20:39 GMT
Nothing explicit in couch to support json schemas (I think).

But you could create a validation function.
http://guide.couchdb.org/draft/validation.html

You would need to find a suitable javascript library that performed
schema validation and insert it into the design doc, and than call it
from the validation function based on the type on the document.

Ryan

On Tue, Apr 12, 2011 at 2:09 PM, Nebu Pookins <nebupookins@gmail.com> wrote:
> If I have some JSON Schemas
> (http://tools.ietf.org/html/draft-zyp-json-schema-03), is there a way
> to pass them onto CouchDB to have CouchDB automatically ensure
> documents of a given type (i.e. with their "type" property set to a
> specific string) adhere to a specific schema file? I tried some google
> searches, but the closest thing I could find to information on the
> topic was this blog post
> (http://dev.wavemaker.com/forums/?q=node/2618) which implies (but does
> not explicitly state) that CouchDB does not support JSON Schemas at
> all.
>
> - Nebu
>

Mime
View raw message