cloudant / java-cloudant

A Java client for Cloudant
Apache License 2.0
79 stars 68 forks source link

Don't over-write reason for bulk() #436

Closed tomblench closed 6 years ago

tomblench commented 6 years ago

What

Preserve the original value of the reason value from the response array in the json returned from _bulk_docs. This can be queried through getReason()

This allows users to retrieve the message from failed validation functions, etc.

Note that the overall HTTP status code is still preserved in each result document and can be queried through getStatusCode(). It is therefore the same across all result documents. It should not be relied upon to detect failure:

"The return code from a successful bulk insertion is 201. The content of the returned structure indicates success or other information messages on a per-document basis." (from the IBM Cloudant documentation).

Testing

New test bulkRejectedByValidation

Issues

See #428