Skip to content

Commit

Permalink
dont break on app startup when pagination extension is not included (#…
Browse files Browse the repository at this point in the history
…444)

* dont break on app startup when pagination extension is not included

* update changelog

* better variable names
  • Loading branch information
geospatial-jeff authored Aug 4, 2022
1 parent e6b353a commit 0d36b76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from the request body, if present, and falls back to using the path parameter if no `"collection"` property is found in the body
([#425](https://github.com/stac-utils/stac-fastapi/pull/425))
* PGStac Backend Transactions endpoints return added Item/Collection instead of Item/Collection from request ([#424](https://github.com/stac-utils/stac-fastapi/pull/424))
* Application no longer breaks on startup when pagination extension is not included ([#444](https://github.com/stac-utils/stac-fastapi/pull/444))

## [2.3.0]

Expand Down
8 changes: 6 additions & 2 deletions stac_fastapi/api/stac_fastapi/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,15 @@ def register_get_item_collection(self):
Returns:
None
"""
get_pagination_model = self.get_extension(self.pagination_extension).GET
pagination_extension = self.get_extension(self.pagination_extension)
if pagination_extension is not None:
mixins = [pagination_extension.GET]
else:
mixins = None
request_model = create_request_model(
"ItemCollectionURI",
base_model=ItemCollectionUri,
mixins=[get_pagination_model],
mixins=mixins,
)
self.router.add_api_route(
name="Get ItemCollection",
Expand Down

0 comments on commit 0d36b76

Please sign in to comment.