Skip to content

Commit 0d36b76

Browse files
dont break on app startup when pagination extension is not included (#444)
* dont break on app startup when pagination extension is not included * update changelog * better variable names
1 parent e6b353a commit 0d36b76

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from the request body, if present, and falls back to using the path parameter if no `"collection"` property is found in the body
4444
([#425](https://github.com/stac-utils/stac-fastapi/pull/425))
4545
* PGStac Backend Transactions endpoints return added Item/Collection instead of Item/Collection from request ([#424](https://github.com/stac-utils/stac-fastapi/pull/424))
46+
* Application no longer breaks on startup when pagination extension is not included ([#444](https://github.com/stac-utils/stac-fastapi/pull/444))
4647

4748
## [2.3.0]
4849

stac_fastapi/api/stac_fastapi/api/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,15 @@ def register_get_item_collection(self):
275275
Returns:
276276
None
277277
"""
278-
get_pagination_model = self.get_extension(self.pagination_extension).GET
278+
pagination_extension = self.get_extension(self.pagination_extension)
279+
if pagination_extension is not None:
280+
mixins = [pagination_extension.GET]
281+
else:
282+
mixins = None
279283
request_model = create_request_model(
280284
"ItemCollectionURI",
281285
base_model=ItemCollectionUri,
282-
mixins=[get_pagination_model],
286+
mixins=mixins,
283287
)
284288
self.router.add_api_route(
285289
name="Get ItemCollection",

0 commit comments

Comments
 (0)