-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
Description
stac-fastapi/stac_fastapi/extensions/stac_fastapi/extensions/core/filter/request.py
Lines 19 to 29 in 753341f
| filter: Annotated[ | |
| Optional[str], | |
| Query( | |
| description="""A CQL filter expression for filtering items.\n | |
| Supports `CQL-JSON` as defined in https://portal.ogc.org/files/96288\n | |
| Remember to URL encode the CQL-JSON if using GET""", | |
| json_schema_extra={ | |
| "example": "id='LC08_L1TP_060247_20180905_20180912_01_T1_L1TP' AND collection='landsat8_l1tp'", # noqa: E501 | |
| }, | |
| ), | |
| ] = attr.ib(default=None) |
In ☝️ we use filter which internally can conflict with the python filter method
@attr.s
class FilterExtensionGetRequest(APIRequest):
"""Filter extension GET request model."""
filter_body: Annotated[
Optional[str],
Query(
alias="filter",
description="""A CQL filter expression for filtering items.\n
Supports `CQL-JSON` as defined in https://portal.ogc.org/files/96288\n
Remember to URL encode the CQL-JSON if using GET""",
json_schema_extra={
"example": "id='LC08_L1TP_060247_20180905_20180912_01_T1_L1TP' AND collection='landsat8_l1tp'", # noqa: E501
},
),
] = attr.ib(default=None)
...
class FilterExtensionPostRequest(BaseModel):
"""Filter extension POST request model."""
filter_body: Optional[Dict[str, Any]] = Field(
default=None,
alias="filter",
description="A CQL filter expression for filtering items.",
json_schema_extra={
"example": {
"op": "and",
"args": [
{
"op": "=",
"args": [
{"property": "id"},
"LC08_L1TP_060247_20180905_20180912_01_T1_L1TP",
],
},
{"op": "=", "args": [{"property": "collection"}, "landsat8_l1tp"]},
],
},
},
)
Reactions are currently unavailable