diff --git a/stac_fastapi/pgstac/app.py b/stac_fastapi/pgstac/app.py index bde0548..10b0537 100644 --- a/stac_fastapi/pgstac/app.py +++ b/stac_fastapi/pgstac/app.py @@ -85,7 +85,9 @@ else: collections_get_request_model = EmptyRequest -post_request_model = create_post_request_model(extensions, base_model=PgstacSearch) +post_request_model = create_post_request_model( + extensions + collection_extensions, base_model=PgstacSearch +) get_request_model = create_get_request_model(extensions + collection_extensions) api = StacApi( @@ -96,7 +98,6 @@ items_get_request_model=items_get_request_model, search_get_request_model=get_request_model, search_post_request_model=post_request_model, - collections_get_request_model=collections_get_request_model, ) app = api.app diff --git a/stac_fastapi/pgstac/core.py b/stac_fastapi/pgstac/core.py index d6aeb1e..56d150a 100644 --- a/stac_fastapi/pgstac/core.py +++ b/stac_fastapi/pgstac/core.py @@ -14,9 +14,6 @@ from pygeofilter.parsers.cql2_text import parse as parse_cql2_text from pypgstac.hydration import hydrate from stac_fastapi.api.models import JSONResponse -from stac_fastapi.extensions.core.collection_search.request import ( - BaseCollectionSearchPostRequest, -) from stac_fastapi.types.core import AsyncBaseCoreClient, Relations from stac_fastapi.types.errors import InvalidQueryParameter, NotFoundError from stac_fastapi.types.requests import get_base_url @@ -41,10 +38,6 @@ class CoreCrudClient(AsyncBaseCoreClient): """Client for core endpoints defined by stac.""" - collections_post_request_model: BaseCollectionSearchPostRequest = attr.ib( - default=BaseCollectionSearchPostRequest - ) - async def all_collections( # noqa: C901 self, request: Request, @@ -88,8 +81,7 @@ async def all_collections( # noqa: C901 # Do the request try: - search_request = self.collections_post_request_model(**clean) - # search_request = self.post_request_model(**clean) + search_request = self.post_request_model(**clean) except ValidationError as e: raise HTTPException( status_code=400, detail=f"Invalid parameters provided {e}"