Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/28#discussion_r39999971
  
    --- Diff: src/couch_mrview.erl ---
    @@ -46,16 +46,103 @@
     }).
     
     
    -validate(DbName, DDoc) ->
    -    {Fields} = DDoc#doc.body,
    -    case couch_util:get_value(<<"options">>, Fields, {[]}) of
    -        {_} -> ok;
    -        _ -> throw({invalid_design_doc, <<"`options` parameter must be an 
object.">>})
    +
    +%% Validate "views" name : value mapping.
    +%%
    +%% In the most common case name is the view name and
    +%% value is an object that must have a "map" function,
    +%% and an optional "reduce" function. "map" and "reduce"
    +%% values should be strings (function contents).
    +%%
    +%% "lib" is a special case. The value
    +%% of "lib" is an object that will contain libary code
    +%% so it not validated.
    +%%
    +validate_view(<<"lib">>, {Libs})->
    +    ok;
    +validate_view(VName, {Views}) ->
    +    case couch_util:get_value(<<"map">>, Views) of
    +        MapVal when is_binary(MapVal) ->
    +            ok;
    +        undefined ->
    +            ok;
    --- End diff --
    
    not ok.


---
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