Skip to content

Commit 3d4c9bf

Browse files
committed
fix URL type after starlette update
1 parent 9031e41 commit 3d4c9bf

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
language_version: python
77

88
- repo: https://github.com/PyCQA/isort
9-
rev: 5.4.2
9+
rev: 5.12.0
1010
hooks:
1111
- id: isort
1212
language_version: python

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes
22

3+
## 0.1.0a4 (2023-03-15)
4+
5+
* fix factories `url_for` type (for starlette >=0.26)
6+
37
## 0.1.0a3 (2023-02-27)
48

59
* fix CRS for collection and extent (switch from `epsg4326` to `CRS84`)

tifeatures/factory.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def url_for(self, request: Request, name: str, **path_params: Any) -> str:
9999
if self.router_prefix:
100100
base_url += self.router_prefix.lstrip("/")
101101

102-
return url_path.make_absolute_url(base_url=base_url)
102+
return str(url_path.make_absolute_url(base_url=base_url))
103103

104104
def _create_html_response(
105105
self,
@@ -172,13 +172,13 @@ def landing(
172172
),
173173
model.Link(
174174
title="the API definition (JSON)",
175-
href=request.url_for("openapi"),
175+
href=str(request.url_for("openapi")),
176176
type=MediaType.openapi30_json,
177177
rel="service-desc",
178178
),
179179
model.Link(
180180
title="the API documentation",
181-
href=request.url_for("swagger_ui_html"),
181+
href=str(request.url_for("swagger_ui_html")),
182182
type=MediaType.html,
183183
rel="service-doc",
184184
),

0 commit comments

Comments
 (0)