Skip to content

Commit 0de6ace

Browse files
move response class in route definitions (#683)
1 parent e4e4120 commit 0de6ace

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Fix response model validation ([#625](https://github.com/stac-utils/stac-fastapi/pull/625))
1515
* Use status code 201 for Item/Collection creation ([#625](https://github.com/stac-utils/stac-fastapi/pull/625))
1616
* Replace Black with Ruff Format ([#625](https://github.com/stac-utils/stac-fastapi/pull/625))
17+
* add `response_class` in the route definitions for `FilterExtension`
1718

1819
## [2.5.5.post1] - 2024-04-25
1920

stac_fastapi/extensions/stac_fastapi/extensions/core/filter/filter.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,30 @@ def register(self, app: FastAPI) -> None:
9797
name="Queryables",
9898
path="/queryables",
9999
methods=["GET"],
100-
endpoint=create_async_endpoint(
101-
self.client.get_queryables, EmptyRequest, self.response_class
102-
),
100+
responses={
101+
200: {
102+
"content": {
103+
"application/schema+json": {},
104+
},
105+
# TODO: add output model in stac-pydantic
106+
},
107+
},
108+
response_class=self.response_class,
109+
endpoint=create_async_endpoint(self.client.get_queryables, EmptyRequest),
103110
)
104111
self.router.add_api_route(
105112
name="Collection Queryables",
106113
path="/collections/{collection_id}/queryables",
107114
methods=["GET"],
108-
endpoint=create_async_endpoint(
109-
self.client.get_queryables, CollectionUri, self.response_class
110-
),
115+
responses={
116+
200: {
117+
"content": {
118+
"application/schema+json": {},
119+
},
120+
# TODO: add output model in stac-pydantic
121+
},
122+
},
123+
response_class=self.response_class,
124+
endpoint=create_async_endpoint(self.client.get_queryables, CollectionUri),
111125
)
112126
app.include_router(self.router, tags=["Filter Extension"])

0 commit comments

Comments
 (0)