Github user jaydoane commented on the pull request:

    
https://github.com/apache/couchdb-couch-replicator/pull/12#issuecomment-118463246
  
    It seems like the fundamental issue is that "null" is a string, but we're 
expecting an array. My inclination would be to return a response code 400 with 
the payload {"error":"parameter \`doc_ids\` must be an array"}.
    
    To make this work, we presumably change the function clause to this:
    ```
    convert_options([{<<"doc_ids">>, V} | _R]) when not is_list(V) ->
        throw({bad_request, <<"parameter `doc_ids` must be an array">>});
    ```
    but unfortunately, this also requires adding this additional try clause to 
chttpd_misc:handle_replicate_req:
    ```
        {bad_request, Reason} ->
            send_json(Req, 400, {[{error, Reason}]});
    ```
    to avoid sending the client a 500 try_clause error.
    
    Does this seem like the correct approach?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to