@@ -152,34 +152,28 @@ def ItemIdParams(
152152 )
153153
154154
155- def STACSearchParams (
156- request : Request ,
157- collection_id : Annotated [
158- str ,
159- Path (description = "STAC Collection Identifier" ),
160- ],
161- ids : Annotated [Optional [str ], Query (description = "Filter by Ids." )] = None ,
155+ def STACQueryParams (
162156 bbox : Annotated [
163157 Optional [str ],
164158 Query (description = "Spatial Filter." ),
165159 ] = None ,
166160 datetime : Annotated [Optional [str ], Query (description = "Temporal Filter." )] = None ,
167- # sortby: Annotated[
168- # Optional[str],
169- # Query(
170- # description="Column Sort the items by Column (ascending (default) or descending).",
171- # ),
172- # ] = None,
173- # query: Annotated[
174- # Optional[str], Query(description="CQL2 Filter", alias="filter")
175- # ] = None,
176- # filter_lang: Annotated[
177- # Optional[Literal["cql2-text", "cql2-json"]],
178- # Query(
179- # description="CQL2 Language (cql2-text, cql2-json). Defaults to cql2-text.",
180- # alias="filter-lang",
181- # ),
182- # ] = None,
161+ sortby : Annotated [
162+ Optional [str ],
163+ Query (
164+ description = "Column Sort the items by Column (ascending (default) or descending)." ,
165+ ),
166+ ] = None ,
167+ query : Annotated [
168+ Optional [str ], Query (description = "CQL2 Filter" , alias = "filter" )
169+ ] = None ,
170+ filter_lang : Annotated [
171+ Optional [Literal ["cql2-text" , "cql2-json" ]],
172+ Query (
173+ description = "CQL2 Language (cql2-text, cql2-json). Defaults to cql2-text." ,
174+ alias = "filter-lang" ,
175+ ),
176+ ] = None ,
183177 limit : Annotated [
184178 Optional [int ],
185179 Query (description = "Limit the number of items per page search (default: 10)" ),
@@ -191,13 +185,28 @@ def STACSearchParams(
191185) -> Dict :
192186 """Dependency to construct STAC API Search Query."""
193187 return {
194- "collections" : [collection_id ],
195- "ids" : ids .split ("," ) if ids else None ,
196188 "bbox" : list (map (float , bbox .split ("," ))) if bbox else None ,
197189 "datetime" : datetime ,
198- # "sortby": sortby,
199- # "filter": query,
200- # "filter-lang": filter_lang,
190+ "sortby" : sortby ,
191+ "filter" : query ,
192+ "filter-lang" : filter_lang ,
201193 "limit" : limit or 10 ,
202194 "max_items" : max_items or 100 ,
203195 }
196+
197+
198+ def STACSearchParams (
199+ request : Request ,
200+ collection_id : Annotated [
201+ str ,
202+ Path (description = "STAC Collection Identifier" ),
203+ ],
204+ ids : Annotated [Optional [str ], Query (description = "Filter by Ids." )] = None ,
205+ query_params = Depends (STACQueryParams ),
206+ ) -> Dict :
207+ """Dependency to construct STAC API Search Query."""
208+ return {
209+ "collections" : [collection_id ],
210+ "ids" : ids .split ("," ) if ids else None ,
211+ ** query_params ,
212+ }
0 commit comments