This repository was archived by the owner on Jul 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 11from fastapi import FastAPI
22
3+ from .item_collection import ItemCollection
34from .root import Root
45
56
@@ -14,4 +15,16 @@ async def root() -> Root:
1415
1516 return Root ()
1617
18+ @app .get ("/search" )
19+ async def get_search () -> ItemCollection :
20+ """Searches this STAC API via a GET request."""
21+
22+ return ItemCollection ()
23+
24+ @app .post ("/search" )
25+ async def post_search () -> ItemCollection :
26+ """Searches this STAC API via a POST request."""
27+
28+ return ItemCollection ()
29+
1730 return app
Original file line number Diff line number Diff line change 1+ from pydantic import BaseModel
2+
3+
4+ class ItemCollection (BaseModel ):
5+ """A STAC API item collection.
6+
7+ The features of this collection may not be valid STAC items, if the `fields`
8+ extension is used.
9+ """
Original file line number Diff line number Diff line change 1+ from fastapi .testclient import TestClient
2+
3+
4+ async def test_get_search (client : TestClient ) -> None :
5+ response = client .get ("/search" )
6+ assert response .status_code == 200
7+
8+
9+ async def test_post_search (client : TestClient ) -> None :
10+ response = client .post ("/search" )
11+ assert response .status_code == 200
You can’t perform that action at this time.
0 commit comments