Skip to content

Commit e5c5c40

Browse files
committed
revert to post_request_model
1 parent 0e586dd commit e5c5c40

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

stac_fastapi/pgstac/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
else:
8686
collections_get_request_model = EmptyRequest
8787

88-
post_request_model = create_post_request_model(extensions, base_model=PgstacSearch)
88+
post_request_model = create_post_request_model(
89+
extensions + collection_extensions, base_model=PgstacSearch
90+
)
8991
get_request_model = create_get_request_model(extensions + collection_extensions)
9092

9193
api = StacApi(
@@ -96,7 +98,6 @@
9698
items_get_request_model=items_get_request_model,
9799
search_get_request_model=get_request_model,
98100
search_post_request_model=post_request_model,
99-
collections_get_request_model=collections_get_request_model,
100101
)
101102
app = api.app
102103

stac_fastapi/pgstac/core.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
from pygeofilter.parsers.cql2_text import parse as parse_cql2_text
1515
from pypgstac.hydration import hydrate
1616
from stac_fastapi.api.models import JSONResponse
17-
from stac_fastapi.extensions.core.collection_search.request import (
18-
BaseCollectionSearchPostRequest,
19-
)
2017
from stac_fastapi.types.core import AsyncBaseCoreClient, Relations
2118
from stac_fastapi.types.errors import InvalidQueryParameter, NotFoundError
2219
from stac_fastapi.types.requests import get_base_url
@@ -41,10 +38,6 @@
4138
class CoreCrudClient(AsyncBaseCoreClient):
4239
"""Client for core endpoints defined by stac."""
4340

44-
collections_post_request_model: BaseCollectionSearchPostRequest = attr.ib(
45-
default=BaseCollectionSearchPostRequest
46-
)
47-
4841
async def all_collections( # noqa: C901
4942
self,
5043
request: Request,
@@ -88,8 +81,7 @@ async def all_collections( # noqa: C901
8881

8982
# Do the request
9083
try:
91-
search_request = self.collections_post_request_model(**clean)
92-
# search_request = self.post_request_model(**clean)
84+
search_request = self.post_request_model(**clean)
9385
except ValidationError as e:
9486
raise HTTPException(
9587
status_code=400, detail=f"Invalid parameters provided {e}"

0 commit comments

Comments
 (0)