Skip to content

Commit 40dd083

Browse files
committed
fix: add required links to item collection
sqlalchemy
1 parent c46fdc0 commit 40dd083

File tree

1 file changed

+17
-1
lines changed
  • stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy

1 file changed

+17
-1
lines changed

stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/core.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,23 @@ def item_collection(
169169
else None
170170
)
171171

172-
links = []
172+
links = [
173+
{
174+
"rel": Relations.self.value,
175+
"type": "application/geo+json",
176+
"href": str(kwargs["request"].url),
177+
},
178+
{
179+
"rel": Relations.root.value,
180+
"type": "application/json",
181+
"href": str(kwargs["request"].base_url),
182+
},
183+
{
184+
"rel": Relations.parent.value,
185+
"type": "application/json",
186+
"href": str(kwargs["request"].base_url),
187+
},
188+
]
173189
if page.next:
174190
links.append(
175191
{

0 commit comments

Comments
 (0)