GitHub user nickva opened a pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/28

    Validate design documents.

    Jira: COUCHDB-2818
    
    Validates:
    
      * options,filters,lists,shows,updates,views values at
        top level of document are objects
    
      * validate_doc_upate,language are strings
    
      * rewrites is an array
    
      * each view inside the views object is an object
    
      * each view object has a map function that is a string
    
      * if a view object has a reduce function it is a string
    
    On validation error it returns a 400 error code with exact
    reason what field has failed to validate.
    
    Example:
    
    {code}
    http PUT $DB1/db2/_design/des1 views:='{ "m":"bad"  }'{"ok":true}
    HTTP/1.1 400 Bad Request
    {
        "error": "invalid_design_doc",
        "reason": "View m must be an object"
    }
    {code}

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nickva/couchdb-couch-mrview 
2818-validate-design-docs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch-mrview/pull/28.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #28
    
----
commit 629ada826fc712531e7ae826c9b7b1dfe5bafbbb
Author: Nick Vatamaniuc <[email protected]>
Date:   2015-09-18T15:27:39Z

    Validate design documents.
    
    Jira: COUCHDB-2818
    
    Validates:
    
      * options,filters,lists,shows,updates,views values at
        top level of document are objects
    
      * validate_doc_upate,language are strings
    
      * rewrites is an array
    
      * each view inside the views object is an object
    
      * each view object has a map function that is a string
    
      * if a view object has a reduce function it is a string
    
    On validation error it returns a 400 error code with exact
    reason what field has failed to validate.
    
    Example:
    
    {code}
    http PUT $DB1/db2/_design/des1 views:='{ "m":"bad"  }'{"ok":true}
    HTTP/1.1 400 Bad Request
    {
        "error": "invalid_design_doc",
        "reason": "View m must be an object"
    }
    {code}

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to