diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e4cc178..e8175f5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "7.11.0" + ".": "7.11.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 035a6ed..57882fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-d891c800ffe6b7eddce179c225367cedcb49dab758ebc03e352d945240918d96.yml openapi_spec_hash: 852d55192b8d7ad96c1f85cd9070ef64 -config_hash: a730d0e598dc108e89c016802008c9b3 +config_hash: ef56639a76a9e93201330e60dff4dbdc diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e306dc..e2946d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 7.11.1 (2026-04-11) + +Full Changelog: [v7.11.0...v7.11.1](https://github.com/trycourier/courier-python/compare/v7.11.0...v7.11.1) + +### Bug Fixes + +* ensure file data are only sent as 1 parameter ([ca4b529](https://github.com/trycourier/courier-python/commit/ca4b529bf902fa70de9776bd66154d9bb5783b2b)) + ## 7.11.0 (2026-04-08) Full Changelog: [v7.10.0...v7.11.0](https://github.com/trycourier/courier-python/compare/v7.10.0...v7.11.0) diff --git a/pyproject.toml b/pyproject.toml index e5428f9..f23035e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "trycourier" -version = "7.11.0" +version = "7.11.1" description = "The official Python library for the Courier API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/courier/_utils/_utils.py b/src/courier/_utils/_utils.py index eec7f4a..63b8cd6 100644 --- a/src/courier/_utils/_utils.py +++ b/src/courier/_utils/_utils.py @@ -86,8 +86,9 @@ def _extract_items( index += 1 if is_dict(obj): try: - # We are at the last entry in the path so we must remove the field - if (len(path)) == index: + # Remove the field if there are no more dict keys in the path, + # only "" traversal markers or end. + if all(p == "" for p in path[index:]): item = obj.pop(key) else: item = obj[key] diff --git a/src/courier/_version.py b/src/courier/_version.py index 7f12b90..a93f7c7 100644 --- a/src/courier/_version.py +++ b/src/courier/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "courier" -__version__ = "7.11.0" # x-release-please-version +__version__ = "7.11.1" # x-release-please-version diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 02fd18b..b1010d7 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -35,6 +35,15 @@ def test_multiple_files() -> None: assert query == {"documents": [{}, {}]} +def test_top_level_file_array() -> None: + query = {"files": [b"file one", b"file two"], "title": "hello"} + assert extract_files(query, paths=[["files", ""]]) == [ + ("files[]", b"file one"), + ("files[]", b"file two"), + ] + assert query == {"title": "hello"} + + @pytest.mark.parametrize( "query,paths,expected", [