File tree Expand file tree Collapse file tree 4 files changed +30
-4
lines changed
Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 44
55- Fix Docker compose file, so example data can be loaded into database (author @zstatmanweil , < https://github.com/stac-utils/stac-fastapi-pgstac/pull/142 > )
66- Add collection search extension ([ #139 ] ( https://github.com/stac-utils/stac-fastapi-pgstac/pull/139 ) )
7-
7+ - keep ` /search ` and ` /collections ` extensions separate ( [ # 158 ] ( https://github.com/stac-utils/stac-fastapi-pgstac/pull/158 ) )
88- Fix ` filter ` extension implementation in ` CoreCrudClient `
99
1010## [ 3.0.0] - 2024-08-02
Original file line number Diff line number Diff line change 4949 "bulk_transactions" : BulkTransactionExtension (client = BulkTransactionsClient ()),
5050}
5151
52+ # some extensions are supported in combination with the collection search extension
53+ collection_extensions_map = {
54+ "query" : QueryExtension (),
55+ "sort" : SortExtension (),
56+ "fields" : FieldsExtension (),
57+ "filter" : FilterExtension (client = FiltersClient ()),
58+ }
59+
5260enabled_extensions = (
5361 os .environ ["ENABLED_EXTENSIONS" ].split ("," )
5462 if "ENABLED_EXTENSIONS" in os .environ
7078)
7179
7280collection_search_extension = (
73- CollectionSearchExtension .from_extensions (extensions )
81+ CollectionSearchExtension .from_extensions (
82+ [
83+ extension
84+ for key , extension in collection_extensions_map .items ()
85+ if key in enabled_extensions
86+ ]
87+ )
7488 if "collection_search" in enabled_extensions
7589 else None
7690)
91+
7792collections_get_request_model = (
7893 collection_search_extension .GET if collection_search_extension else EmptyRequest
7994)
Original file line number Diff line number Diff line change @@ -732,7 +732,9 @@ async def get_collection(
732732 get_request_model = create_get_request_model (extensions )
733733
734734 collection_search_extension = CollectionSearchExtension .from_extensions (
735- extensions = extensions
735+ extensions = [
736+ FieldsExtension (),
737+ ]
736738 )
737739
738740 api = StacApi (
Original file line number Diff line number Diff line change @@ -134,7 +134,16 @@ def api_client(request, database):
134134 FilterExtension (client = FiltersClient ()),
135135 BulkTransactionExtension (client = BulkTransactionsClient ()),
136136 ]
137- collection_search_extension = CollectionSearchExtension .from_extensions (extensions )
137+
138+ collection_extensions = [
139+ QueryExtension (),
140+ SortExtension (),
141+ FieldsExtension (),
142+ FilterExtension (client = FiltersClient ()),
143+ ]
144+ collection_search_extension = CollectionSearchExtension .from_extensions (
145+ collection_extensions
146+ )
138147
139148 items_get_request_model = create_request_model (
140149 model_name = "ItemCollectionUri" ,
You can’t perform that action at this time.
0 commit comments