Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- remove support of `cql-json` in Filter extension

## [5.2.1] - 2025-04-18

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from stac_fastapi.types.search import APIRequest

FilterLang = Literal["cql-json", "cql2-json", "cql2-text"]
FilterLang = Literal["cql2-json", "cql2-text"]


@attr.s
Expand All @@ -20,9 +20,9 @@ class FilterExtensionGetRequest(APIRequest):
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""",
description="""A CQL2 filter expression for filtering items.\n
Supports `CQL2-JSON` as defined in https://docs.ogc.org/is/21-065r2/21-065r2.htmln
Remember to URL encode the CQL2-JSON if using GET""",
openapi_examples={
"user-provided": {"value": None},
"landsat8-item": {
Expand Down Expand Up @@ -83,7 +83,7 @@ class FilterExtensionPostRequest(BaseModel):
alias="filter-crs",
description="The coordinate reference system (CRS) used by spatial literals in the 'filter' value. Default is `http://www.opengis.net/def/crs/OGC/1.3/CRS84`", # noqa: E501
)
filter_lang: Optional[Literal["cql-json", "cql2-json"]] = Field(
filter_lang: Optional[Literal["cql2-json"]] = Field(
"cql2-json",
alias="filter-lang",
description="The CQL filter encoding that the 'filter' value uses.",
Expand Down
20 changes: 0 additions & 20 deletions stac_fastapi/extensions/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,6 @@ def test_search_filter_post_filter_lang_default(client_name, request):
assert response_dict["filter_lang"] == "cql2-json"


@pytest.mark.parametrize("client_name", ["client", "client_multit_ext"])
def test_search_filter_post_filter_lang_non_default(client_name, request):
"""Test search POST endpoint with filter ext."""
client = request.getfixturevalue(client_name)

filter_lang_value = "cql-json"
response = client.post(
"/search",
json={
"collections": ["test"],
"filter": {"eq": [{"property": "test_property"}, "test-value"]},
"filter-lang": filter_lang_value,
},
)
assert response.is_success, response.json()
response_dict = response.json()
assert response_dict["filter_expr"]
assert response_dict["filter_lang"] == filter_lang_value


@pytest.mark.parametrize("client_name", ["client", "client_multit_ext"])
def test_search_filter_get(client_name, request):
"""Test search GET endpoint with filter ext."""
Expand Down