Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.1.0"
".": "3.1.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openregister%2Fopenregister-cdea05542fb87dc7f00544bdd53fd82469ad985a48aa0d96fdd74011464e3a5d.yml
openapi_spec_hash: e49334a0e9b0d800974f7453910ab5ee
config_hash: 6b8c0142ef1c8e22e9ca6b5b834e2a04
config_hash: 37583af6a46faf905309043dc42cad52
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.1.1 (2026-04-08)

Full Changelog: [v3.1.0...v3.1.1](https://github.com/oregister/openregister-python/compare/v3.1.0...v3.1.1)

### Bug Fixes

* **client:** preserve hardcoded query params when merging with user params ([fa40ea6](https://github.com/oregister/openregister-python/commit/fa40ea6bd6af4dfe19c55e67a2dbb0c51098bc6e))


### Chores

* **client:** increase timeouts ([61f64e6](https://github.com/oregister/openregister-python/commit/61f64e689752e125cf887e8c5c0bd11ccc9c3843))

## 3.1.0 (2026-03-27)

Full Changelog: [v3.0.3...v3.1.0](https://github.com/oregister/openregister-python/compare/v3.0.3...v3.1.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ client.with_options(max_retries=5).company.get_details_v1(

### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
By default requests time out after 3 minutes. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from openregister import Openregister

# Configure the default for all requests:
client = Openregister(
# 20 seconds (default is 1 minute)
# 20 seconds (default is 3 minutes)
timeout=20.0,
)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openregister-sdk"
version = "3.1.0"
version = "3.1.1"
description = "The official Python library for the openregister API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
4 changes: 4 additions & 0 deletions src/openregister/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,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("_", "-")}
Expand Down
4 changes: 2 additions & 2 deletions src/openregister/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"

# default timeout is 1 minute
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
# default timeout is 3 minutes
DEFAULT_TIMEOUT = httpx.Timeout(timeout=180, connect=5.0)
DEFAULT_MAX_RETRIES = 2
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)

Expand Down
2 changes: 1 addition & 1 deletion src/openregister/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openregister"
__version__ = "3.1.0" # x-release-please-version
__version__ = "3.1.1" # x-release-please-version
48 changes: 48 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,30 @@ def test_default_query_option(self) -> None:

client.close()

def test_hardcoded_query_params_in_url(self, client: Openregister) -> 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: Openregister) -> None:
request = client._build_request(
FinalRequestOptions(
Expand Down Expand Up @@ -1336,6 +1360,30 @@ async def test_default_query_option(self) -> None:

await client.close()

async def test_hardcoded_query_params_in_url(self, async_client: AsyncOpenregister) -> 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: Openregister) -> None:
request = client._build_request(
FinalRequestOptions(
Expand Down