Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 55594 invoked from network); 12 Apr 2011 20:21:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2011 20:21:08 -0000 Received: (qmail 55370 invoked by uid 500); 12 Apr 2011 20:21:07 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 55342 invoked by uid 500); 12 Apr 2011 20:21:07 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 55334 invoked by uid 99); 12 Apr 2011 20:21:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 20:21:07 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryan.ramage@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 20:21:01 +0000 Received: by wyj26 with SMTP id 26so8933269wyj.11 for ; Tue, 12 Apr 2011 13:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=NzWscYLTkgoUZQvi7pnabdOxDAj83zgrhrmJWOxqq3U=; b=BdXFyS71b/JGv817HKUd0Sm2TMZMO/ntsN7Z0MOJkrMOk0LirwjWK2D47Fj1gjzD9k TksCXoCrmS9H5swcu1Dvbsm8IDjFx5IWYf23SbfPny4Y0UWFZ06mBcF9TPiZ+fPjz9BF MJ75A/YlkBkCEoj6GCyMNHWnlyaMNLWn/+zag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ItOkjdRoM9/j2bZ1fb3aFFDA0EBp7HFiPgeQxRIW9erIYQzoMYeFPJe7peWWVVXnJS Ihgz8udx00ksrCoV7GKT80D2R7avIoMJYJjJ9saaf7VJeAsmZlSXbOHtN8ddICbZK3zl RgCZDEFLbyHy+/ZyvZe3ayckhoIjxyxA4QIuI= MIME-Version: 1.0 Received: by 10.227.197.201 with SMTP id el9mr113612wbb.22.1302639639729; Tue, 12 Apr 2011 13:20:39 -0700 (PDT) Received: by 10.227.69.198 with HTTP; Tue, 12 Apr 2011 13:20:39 -0700 (PDT) In-Reply-To: References: Date: Tue, 12 Apr 2011 14:20:39 -0600 Message-ID: Subject: Re: How does one validate CouchDB documents with JSON Schema? From: Ryan Ramage To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 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 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 >