Skip to content

Commit

Permalink
move response class in route definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed May 6, 2024
1 parent e4e4120 commit 501b3fd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Fix response model validation ([#625](https://github.com/stac-utils/stac-fastapi/pull/625))
* Use status code 201 for Item/Collection creation ([#625](https://github.com/stac-utils/stac-fastapi/pull/625))
* Replace Black with Ruff Format ([#625](https://github.com/stac-utils/stac-fastapi/pull/625))
* add `response_class` in the route definitions for `FilterExtension`

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,30 @@ def register(self, app: FastAPI) -> None:
name="Queryables",
path="/queryables",
methods=["GET"],
endpoint=create_async_endpoint(
self.client.get_queryables, EmptyRequest, self.response_class
),
responses={
200: {
"content": {
"application/schema+json": {},
},
# TODO: add output model in stac-pydantic
},
},
response_class=self.response_class,
endpoint=create_async_endpoint(self.client.get_queryables, EmptyRequest),
)
self.router.add_api_route(
name="Collection Queryables",
path="/collections/{collection_id}/queryables",
methods=["GET"],
endpoint=create_async_endpoint(
self.client.get_queryables, CollectionUri, self.response_class
),
responses={
200: {
"content": {
"application/schema+json": {},
},
# TODO: add output model in stac-pydantic
},
},
response_class=self.response_class,
endpoint=create_async_endpoint(self.client.get_queryables, CollectionUri),
)
app.include_router(self.router, tags=["Filter Extension"])

0 comments on commit 501b3fd

Please sign in to comment.