Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC69910BC2 for ; Mon, 16 Dec 2013 15:03:27 +0000 (UTC) Received: (qmail 93679 invoked by uid 500); 16 Dec 2013 15:03:26 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 93537 invoked by uid 500); 16 Dec 2013 15:03:21 -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 93524 invoked by uid 99); 16 Dec 2013 15:03:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Dec 2013 15:03:19 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of st.fankl.in@gmail.com designates 209.85.214.42 as permitted sender) Received: from [209.85.214.42] (HELO mail-bk0-f42.google.com) (209.85.214.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Dec 2013 15:03:15 +0000 Received: by mail-bk0-f42.google.com with SMTP id w11so2417172bkz.1 for ; Mon, 16 Dec 2013 07:02:53 -0800 (PST) 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=sFP1FinqY7dYPTq+fCake5LTbs/xeaprQeV5xrfFe78=; b=AOud7KkK5/B9ISXrSo6Xs+hvMrU5Xl6YGKYwrLziyb9FvFwtmkG8uZRwKC9tSyN9s+ 6dttHbgA3kIu9M5+/4MK+yGIgT5FKuDlFt+wKfhsuX92vw+IflzOajpVPchRv7VfZ5iR fcxdDN+Z2a2y3yGrjoLRPzACVbf6l1EQ9aBSB0oo3i7MqAy8bSugrwjuT0L7o7CewgCh n7WMH882NBRnkqRaI7o+adRaZRdXjfNexWtOtkYWcY/Yk7s8Q59U2QxSnTWJz88Nw7ud 1wDSNQ9bXbRmt/PAXPW8HDrfxRephuiOPR1SBFh4fbBGEWFERwxHeJtJ78Mfbv2v2LLp dlUA== MIME-Version: 1.0 X-Received: by 10.204.26.69 with SMTP id d5mr2855596bkc.47.1387206173740; Mon, 16 Dec 2013 07:02:53 -0800 (PST) Received: by 10.204.55.72 with HTTP; Mon, 16 Dec 2013 07:02:53 -0800 (PST) In-Reply-To: <52AB31CB.2090604@zynstra.com> References: <52AB31CB.2090604@zynstra.com> Date: Mon, 16 Dec 2013 16:02:53 +0100 Message-ID: Subject: Re: How do you document your document structure? From: Stefan Klein To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=047d7beb9076377fc104eda81b36 X-Virus-Checked: Checked by ClamAV on apache.org --047d7beb9076377fc104eda81b36 Content-Type: text/plain; charset=ISO-8859-1 2013/12/13 James Dingwall > Stefan Klein wrote: > >> all over my javascript source i got statements like >> if (doc.field === 'VALUE') { >> } >> somewhere else: >> if (doc.field === 'VALUE2') { >> } >> >> what id like to have is something like jsdoc which parses my source and >> tells me which fields i use and which values i expect. (Would be easy to >> spot typos etc. this way) >> I tried jsdoc, created fake classes, it kind of works but is ugly. >> >> Is there a better tool? >> > We are using json-schema to document our structure and have imported the > tv4 validator to perform validation tasks within couchdb. You can use > views to emit documents not conforming to the schema, reject non conforming > documents in validate_doc_update.... The json schema allows us to add > extra metadata around the various fields that say what they are for and we > could pull out such comments when building a ui to edit a document. > Thank you, thats probably a better approach than in-code documentation. --047d7beb9076377fc104eda81b36--