From dev-return-22708-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Sun Jul 22 08:41:24 2012 Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52E57950B for ; Sun, 22 Jul 2012 08:41:24 +0000 (UTC) Received: (qmail 87592 invoked by uid 500); 22 Jul 2012 08:41:23 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 87555 invoked by uid 500); 22 Jul 2012 08:41:23 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 87527 invoked by uid 99); 22 Jul 2012 08:41:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2012 08:41:22 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kxepal@gmail.com designates 209.85.217.180 as permitted sender) Received: from [209.85.217.180] (HELO mail-lb0-f180.google.com) (209.85.217.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2012 08:41:16 +0000 Received: by lbbgj3 with SMTP id gj3so7215019lbb.11 for ; Sun, 22 Jul 2012 01:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=G7Kz5Mm2ENZMYsbH4NvK1WlbJW9XLnQEqj3Fo2ROjOI=; b=aiGTql1Cuv3+A6jLyEMHw67OytCY6oBIX07X0UuCPXR0S2NGEvbko87JIjUHKx2Via /S8bBZvYHqaC9pAIVEj+mNZa+yH96AxcfqdW/xMjWY/CireW0cOvHR0fqNEurwkxnpgC vpcnWt/chgYLonS8exm6gtixxI5oSqhZJeQxHfH4CEhBWimIAmlTRFDtdfbzaf5GDYwG ZC1AWogFM7YG26hst9clPb8B0L+F8HD8SCwKw2qb2/qLfqLlgBsg9EUuLGTljRkqPZRR U8W09mUtzH1/PkcXXnlPWK9//vPqqN6a0vxpQ4tPx7Srj6S07IBaAoHgZVHu6K+NPSIk epvA== MIME-Version: 1.0 Received: by 10.112.83.228 with SMTP id t4mr5929391lby.74.1342946455994; Sun, 22 Jul 2012 01:40:55 -0700 (PDT) Received: by 10.114.21.166 with HTTP; Sun, 22 Jul 2012 01:40:55 -0700 (PDT) In-Reply-To: References: Date: Sun, 22 Jul 2012 12:40:55 +0400 Message-ID: Subject: Re: validate_doc_update response? From: Alexander Shorin To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Hi Samuel! > 1/ I'm wondering what are valid responses to validate_doc_update? The query > services I've seen return either a hash {forbidden: "message"} or 1 > > Can I return true rather than 1? Seems more logical.. You could, but this would be invalid output. See for details: https://github.com/apache/couchdb/blob/master/src/couchdb/couch_query_servers.erl#L230 > 2/ Why is the name "validate_doc_update" so verbose when compared with > "lists", "filters", etc? Why not just "validates"? Initially it was "validate" command, but since any ddoc subcommand is a ddoc field, it eventually renamed to validate_doc_update. See first commit about it: https://github.com/apache/couchdb/commit/9044fc0234ed65056f087a86c7c117922f2a2c75 -- ,,,^..^,,, On Sun, Jul 22, 2012 at 12:07 PM, Samuel Williams wrote: > Hi, > > 1/ I'm wondering what are valid responses to validate_doc_update? The query > services I've seen return either a hash {forbidden: "message"} or 1 > > Can I return true rather than 1? Seems more logical.. > > How do I report multiple failures? e.g. Title required, Author required. > > 2/ Why is the name "validate_doc_update" so verbose when compared with > "lists", "filters", etc? Why not just "validates"? > > Thanks, > Samuel