From bd49fa8c5daf6a8e03a723970403112ca4d6079e Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Thu, 5 Feb 2026 15:36:43 +0000 Subject: [PATCH] docs(generated): known issue for application/json attachments Generated SDK source code using: - Generator version 3.110.0 - Specification version 1.0.0-dev0.1.33 - Automation (cloudant-sdks) version 095458f --- KNOWN_ISSUES.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index afec4185..0e1a21b9 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -143,3 +143,26 @@ client = CloudantV1.new_instance(service_name="YOUR_SERVICE_NAME") client.set_enable_gzip_compression(False) ... ``` + +### Attachments with `content-type: application/json` + +Calling [`get_attachment`](https://ibm.github.io/cloudant-python-sdk/docs/latest/apidocs/ibmcloudant/ibmcloudant.cloudant_v1.html#ibmcloudant.cloudant_v1.CloudantV1.get_attachment) +typically returns a `DetailedResponse` with `BinaryIO` result. +For attachments uploaded with a `content-type: application/json` +header or as a `.json` file in the dashboard then calls to `get_attachment` +return a `DetailedResponse` with, for example, a `dict` result for a JSON +object. +The JSON is automatically loaded by the underlying SDK core +and client to the default Python object types. + +To get a `BinaryIO` result with an `application/json` attachment +pass `stream=True` on the `get_attachment` request. + +```python +json_attachment: bytes = service.get_attachment( + db='products', + doc_id='1000042', + attachment_name='product_details.json', + stream=True +).get_result().content # content bytes that can be decoded +```