diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35a..d04f223 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.5.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 215938e..dea4d5c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 14 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/vitable%2Fvitable-connect-e61b9afbfd2525af28aea98d7b106979d1fa2e15af61a2a14d129d64ed6a0a77.yml openapi_spec_hash: 0ff58ff57f78739499e3781e6bf00ba1 -config_hash: d2ce0848d5b4f2e1461c01f6eafd9b19 +config_hash: 210414fb2c2a37b4b4e772c15d0d47eb diff --git a/CHANGELOG.md b/CHANGELOG.md index 3165303..accd6d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.5.1 (2026-04-08) + +Full Changelog: [v0.5.0...v0.5.1](https://github.com/Vitable-Inc/vitable-connect-python/compare/v0.5.0...v0.5.1) + +### Bug Fixes + +* **client:** preserve hardcoded query params when merging with user params ([a146ca8](https://github.com/Vitable-Inc/vitable-connect-python/commit/a146ca8b4396978eb085d9e35669b8de9b88eea6)) + ## 0.5.0 (2026-03-27) Full Changelog: [v0.4.0...v0.5.0](https://github.com/Vitable-Inc/vitable-connect-python/compare/v0.4.0...v0.5.0) diff --git a/pyproject.toml b/pyproject.toml index a1554e4..8be0322 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "vitable_connect" -version = "0.5.0" +version = "0.5.1" description = "The official Python library for the vitable-connect API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/vitable_connect/_base_client.py b/src/vitable_connect/_base_client.py index 094e74e..5c2ff6e 100644 --- a/src/vitable_connect/_base_client.py +++ b/src/vitable_connect/_base_client.py @@ -558,6 +558,10 @@ def _build_request( files = cast(HttpxRequestFiles, ForceMultipartDict()) prepared_url = self._prepare_url(options.url) + # preserve hard-coded query params from the url + if params and prepared_url.query: + params = {**dict(prepared_url.params.items()), **params} + prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0]) if "_" in prepared_url.host: # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} diff --git a/src/vitable_connect/_version.py b/src/vitable_connect/_version.py index 0c2b02e..7ad0efb 100644 --- a/src/vitable_connect/_version.py +++ b/src/vitable_connect/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "vitable_connect" -__version__ = "0.5.0" # x-release-please-version +__version__ = "0.5.1" # x-release-please-version diff --git a/tests/test_client.py b/tests/test_client.py index 4a271ae..2d04b70 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -429,6 +429,30 @@ def test_default_query_option(self) -> None: client.close() + def test_hardcoded_query_params_in_url(self, client: VitableConnect) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: VitableConnect) -> None: request = client._build_request( FinalRequestOptions( @@ -1350,6 +1374,30 @@ async def test_default_query_option(self) -> None: await client.close() + async def test_hardcoded_query_params_in_url(self, async_client: AsyncVitableConnect) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: VitableConnect) -> None: request = client._build_request( FinalRequestOptions(