diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 423c69f..e3fea21 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.37" + ".": "0.0.38" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index fc1b600..dab8a93 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 195 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-58749e1928f402cc3e236d38b53bce3b10530bfaccbe426181bba9b1bfc42498.yml -openapi_spec_hash: ecea6e6c4b93665aee5554839a26ded8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-e9540a2c6a24de8d53e634aa3ddfabb553b04c28fa8b592d864eadfa7180f187.yml +openapi_spec_hash: fde548cb3ce3fcd9dd77397d3b8627a3 config_hash: 2ceaf6cd488db626c181a1ca9460ace6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f7a9f..af868c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.0.38 (2026-04-13) + +Full Changelog: [v0.0.37...v0.0.38](https://github.com/whopio/whopsdk-python/compare/v0.0.37...v0.0.38) + +### Bug Fixes + +* ensure file data are only sent as 1 parameter ([0621a7d](https://github.com/whopio/whopsdk-python/commit/0621a7d6524577f1fd7d17a63ea5f1cc2d34bb3a)) + ## 0.0.37 (2026-04-10) Full Changelog: [v0.0.36...v0.0.37](https://github.com/whopio/whopsdk-python/compare/v0.0.36...v0.0.37) diff --git a/pyproject.toml b/pyproject.toml index 4719b5b..69df10c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "whop-sdk" -version = "0.0.37" +version = "0.0.38" description = "The official Python library for the Whop API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/whop_sdk/_utils/_utils.py b/src/whop_sdk/_utils/_utils.py index eec7f4a..63b8cd6 100644 --- a/src/whop_sdk/_utils/_utils.py +++ b/src/whop_sdk/_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/whop_sdk/_version.py b/src/whop_sdk/_version.py index a1018dc..dececef 100644 --- a/src/whop_sdk/_version.py +++ b/src/whop_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "whop_sdk" -__version__ = "0.0.37" # x-release-please-version +__version__ = "0.0.38" # x-release-please-version diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index a737e4c..f8ca177 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", [