Skip to content

Commit 9c2ab7d

Browse files
committed
remove cql-json support
1 parent 526ab42 commit 9c2ab7d

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
- remove support of `cql-json` in Filter extension
6+
57
## [5.2.1] - 2025-04-18
68

79
### Fixed

stac_fastapi/extensions/stac_fastapi/extensions/core/filter/request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from stac_fastapi.types.search import APIRequest
1111

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

1414

1515
@attr.s
@@ -20,9 +20,9 @@ class FilterExtensionGetRequest(APIRequest):
2020
Optional[str],
2121
Query(
2222
alias="filter",
23-
description="""A CQL filter expression for filtering items.\n
24-
Supports `CQL-JSON` as defined in https://portal.ogc.org/files/96288\n
25-
Remember to URL encode the CQL-JSON if using GET""",
23+
description="""A CQL2 filter expression for filtering items.\n
24+
Supports `CQL2-JSON` as defined in https://portal.ogc.org/files/96288\n
25+
Remember to URL encode the CQL2-JSON if using GET""",
2626
openapi_examples={
2727
"user-provided": {"value": None},
2828
"landsat8-item": {
@@ -83,7 +83,7 @@ class FilterExtensionPostRequest(BaseModel):
8383
alias="filter-crs",
8484
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
8585
)
86-
filter_lang: Optional[Literal["cql-json", "cql2-json"]] = Field(
86+
filter_lang: Optional[Literal["cql2-json"]] = Field(
8787
"cql2-json",
8888
alias="filter-lang",
8989
description="The CQL filter encoding that the 'filter' value uses.",

stac_fastapi/extensions/tests/test_filter.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,6 @@ def test_search_filter_post_filter_lang_default(client_name, request):
122122
assert response_dict["filter_lang"] == "cql2-json"
123123

124124

125-
@pytest.mark.parametrize("client_name", ["client", "client_multit_ext"])
126-
def test_search_filter_post_filter_lang_non_default(client_name, request):
127-
"""Test search POST endpoint with filter ext."""
128-
client = request.getfixturevalue(client_name)
129-
130-
filter_lang_value = "cql-json"
131-
response = client.post(
132-
"/search",
133-
json={
134-
"collections": ["test"],
135-
"filter": {"eq": [{"property": "test_property"}, "test-value"]},
136-
"filter-lang": filter_lang_value,
137-
},
138-
)
139-
assert response.is_success, response.json()
140-
response_dict = response.json()
141-
assert response_dict["filter_expr"]
142-
assert response_dict["filter_lang"] == filter_lang_value
143-
144-
145125
@pytest.mark.parametrize("client_name", ["client", "client_multit_ext"])
146126
def test_search_filter_get(client_name, request):
147127
"""Test search GET endpoint with filter ext."""

0 commit comments

Comments
 (0)