Skip to content

Commit 086060e

Browse files
authored
fix(queryables): properly set $id (#40)
1 parent c14c86b commit 086060e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

stac_fastapi/eodag/extensions/filter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ async def get_queryables(
215215
protected_namespaces=(),
216216
json_schema_extra={
217217
"$schema": "https://json-schema.org/draft/2019-09/schema",
218-
"$id": f"{base_url}/queryables",
218+
"$id": base_url
219+
+ (f"collections/{collection_id}/queryables" if collection_id else "queryables"),
219220
"type": "object",
220-
"title": f"Queryables for {stac_fastapi_title}.",
221-
"description": f"Queryable names for the {stac_fastapi_title}.",
221+
"title": f"STAC queryables for {stac_fastapi_title}.",
222+
"description": f"Queryable names for {stac_fastapi_title}.",
222223
"additionalProperties": bool(not collection_id),
223224
},
224225
arbitrary_types_allowed=True,

tests/test_queryables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ async def test_basic_queryables(request_valid):
3232
assert "collection" in res["properties"]
3333
assert len(res["properties"]) == 1
3434
assert "additionalProperties" in res and res["additionalProperties"]
35-
assert "description" in res and res["description"] == "Queryable names for the stac-fastapi."
36-
assert "title" in res and res["title"] == "Queryables for stac-fastapi."
35+
assert "description" in res and res["description"] == "Queryable names for stac-fastapi."
36+
assert "title" in res and res["title"] == "STAC queryables for stac-fastapi."
3737
assert "type" in res and res["type"] == "object"
3838

3939

0 commit comments

Comments
 (0)