couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Dingwall <james.dingw...@zynstra.com>
Subject Re: How do you document your document structure?
Date Fri, 13 Dec 2013 16:11:55 GMT
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.

James

Mime
View raw message