Repository: stac-utils/stac-fastapi (language: python)

Issue:
Datetime no longer a parameter option in GET /search
In a recent [PR](https://github.com/stac-utils/stac-fastapi/pull/308/files),`Dict` was added as a type option for datetime in `BaseSearchGetRequest` 
https://github.com/stac-utils/stac-fastapi/blob/2f8e96bbdbad588e3b5df7f28dda5bd737228fcc/stac_fastapi/types/stac_fastapi/types/search.py#L76

After this change, for some reason `datetime` is no longer registering as a parameter in the GET /search endpoint for sqlalchemy or pgstac backend. You can confirm this by running it locally, and looking at the `/docs` or `/api` pages.  Alternatively, you can run a GET request on this URL and see that the item returned should actually be filtered out based on the datetime:

```http://0.0.0.0:8082/search?collections=joplin&ids=f2cca2a3-288b-4518-8a3e-a4492bb60b08&datetime=2021-02-02T00:00:00Z/2022-02-02T00:00:00Z```

I removed the `Dict` option and datetime reappeared as a parameter. 

Since this was made as part of the pgstac upgrade to 0.4.0, I assume it has something to do with that, but downstream all the functions expect a `str` or `datetime` so I haven't been able to figure it out. I see that cql2-json can take a dictionary for datetime within the filter parameter, but since the `datetime` parameter is not available in cql2-json, I don't think that applies here. 



Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index 8ffdcebaa..407d0fe9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ tests/logging.ini
 # Distribution / packaging
 .Python
 env/
+venv/
 build/
 develop-eggs/
 dist/
@@ -106,7 +107,7 @@ celerybeat-schedule
 *.sage.py
 
 # dotenv
-.env
+**/.env
 
 # Spyder project settings
 .spyderproject
diff --git a/CHANGES.md b/CHANGES.md
index 441c79a36..d6f0e6731 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -23,6 +23,8 @@
 * The minimum `limit` value for searches is now 1 ([#296](https://github.com/stac-utils/stac-fastapi/pull/296))
 * Links stored with Collections and Items (e.g. license links) are now returned with those STAC objects ([#282](https://github.com/stac-utils/stac-fastapi/pull/282))
 * Content-type response headers for the /api endpoint now reflect those expected in the STAC api spec ([#287](https://github.com/stac-utils/stac-fastapi/pull/287))
+* Changed type options for datetime in BaseSearchGetRequest ([#315](https://github.com/stac-utils/stac-fastapi/pull/318))
+* Expanded on tests to ensure properly testing get and post searches ([#315](https://github.com/stac-utils/stac-fastapi/pull/318))
 
 ## [2.2.0]
 
diff --git a/stac_fastapi/types/stac_fastapi/types/search.py b/stac_fastapi/types/stac_fastapi/types/search.py
index ec1bb9579..b7ca69f40 100644
--- a/stac_fastapi/types/stac_fastapi/types/search.py
+++ b/stac_fastapi/types/stac_fastapi/types/search.py
@@ -73,7 +73,7 @@ class BaseSearchGetRequest(APIRequest):
     ids: Optional[str] = attr.ib(default=None, converter=str2list)
     bbox: Optional[str] = attr.ib(default=None, converter=str2list)
     intersects: Optional[str] = attr.ib(default=None, converter=str2list)
-    datetime: Optional[Union[str, Dict]] = attr.ib(default=None)
+    datetime: Optional[str] = attr.ib(default=None)
     limit: Optional[int] = attr.ib(default=10)
 
 


Test patch:
diff --git a/stac_fastapi/pgstac/tests/data/test_item2.json b/stac_fastapi/pgstac/tests/data/test_item2.json
new file mode 100644
index 000000000..0d8ec7630
--- /dev/null
+++ b/stac_fastapi/pgstac/tests/data/test_item2.json
@@ -0,0 +1,646 @@
+{
+  "type": "Feature",
+  "id": "test_item2",
+  "stac_version": "1.0.0",
+  "stac_extensions": [
+    "https://stac-extensions.github.io/eo/v1.0.0/schema.json",
+    "https://stac-extensions.github.io/projection/v1.0.0/schema.json"
+  ],
+  "bbox": [
+    -123.37257493384075,
+    46.35430508465464,
+    -120.21745704411174,
+    48.51504491534536
+  ],
+  "links": [
+    {
+      "rel": "collection",
+      "type": "application/json",
+      "href": "http://localhost:8081/api/stac/v1/collections/landsat-8-c2-l2"
+    },
+    {
+      "rel": "parent",
+      "type": "application/json",
+      "href": "http://localhost:8081/api/stac/v1/collections/landsat-8-c2-l2"
+    },
+    {
+      "rel": "root",
+      "type": "application/json",
+      "href": "http://localhost:8081/api/stac/v1/"
+    },
+    {
+      "rel": "self",
+      "type": "application/geo+json",
+      "href": "http://localhost:8081/api/stac/v1/collections/landsat-8-c2-l2/items/LC08_L2SP_046027_20200908_02_T1"
+    },
+    {
+      "rel": "alternate",
+      "type": "application/json",
+      "title": "tiles",
+      "href": "http://localhost:8081/api/stac/v1/collections/landsat-8-c2-l2/items/LC08_L2SP_046027_20200908_02_T1/tiles"
+    },
+    {
+      "rel": "alternate",
+      "href": "https://landsatlook.usgs.gov/stac-browser/collection02/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_02_T1",
+      "type": "text/html",
+      "title": "USGS stac-browser page"
+    },
+    {
+      "rel": "preview",
+      "href": "http://localhost:8081/api/data/v1/item/map?collection=landsat-8-c2-l2&item=LC08_L2SP_046027_20200908_02_T1",
+      "title": "Map of item",
+      "type": "text/html"
+    }
+  ],
+  "assets": {
+    "ANG": {
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ANG.txt",
+      "type": "text/plain",
+      "title": "Angle Coefficients File",
+      "description": "Collection 2 Level-1 Angle Coefficients File (ANG)"
+    },
+    "SR_B1": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B1.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Coastal/Aerosol Band (B1)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B1",
+          "common_name": "coastal",
+          "center_wavelength": 0.44,
+          "full_width_half_max": 0.02
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Coastal/Aerosol Band (B1) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "SR_B2": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B2.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Blue Band (B2)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B2",
+          "common_name": "blue",
+          "center_wavelength": 0.48,
+          "full_width_half_max": 0.06
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Blue Band (B2) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "SR_B3": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B3.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Green Band (B3)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B3",
+          "common_name": "green",
+          "center_wavelength": 0.56,
+          "full_width_half_max": 0.06
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Green Band (B3) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "SR_B4": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B4.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Red Band (B4)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B4",
+          "common_name": "red",
+          "center_wavelength": 0.65,
+          "full_width_half_max": 0.04
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Red Band (B4) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "SR_B5": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B5.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Near Infrared Band 0.8 (B5)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B5",
+          "common_name": "nir08",
+          "center_wavelength": 0.86,
+          "full_width_half_max": 0.03
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Near Infrared Band 0.8 (B5) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "SR_B6": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B6.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Short-wave Infrared Band 1.6 (B6)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B6",
+          "common_name": "swir16",
+          "center_wavelength": 1.6,
+          "full_width_half_max": 0.08
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Short-wave Infrared Band 1.6 (B6) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "SR_B7": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_B7.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Short-wave Infrared Band 2.2 (B7)",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "SR_B7",
+          "common_name": "swir22",
+          "center_wavelength": 2.2,
+          "full_width_half_max": 0.2
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Short-wave Infrared Band 2.2 (B7) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_QA": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_QA.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Surface Temperature Quality Assessment Band",
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Surface Temperature Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_B10": {
+      "gsd": 100,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_B10.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Surface Temperature Band (B10)",
+      "eo:bands": [
+        {
+          "gsd": 100,
+          "name": "ST_B10",
+          "common_name": "lwir11",
+          "center_wavelength": 10.9,
+          "full_width_half_max": 0.8
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Surface Temperature Band (B10) Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "MTL.txt": {
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_MTL.txt",
+      "type": "text/plain",
+      "title": "Product Metadata File",
+      "description": "Collection 2 Level-1 Product Metadata File (MTL)"
+    },
+    "MTL.xml": {
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_MTL.xml",
+      "type": "application/xml",
+      "title": "Product Metadata File (xml)",
+      "description": "Collection 2 Level-1 Product Metadata File (xml)"
+    },
+    "ST_DRAD": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_DRAD.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Downwelled Radiance Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_DRAD",
+          "description": "downwelled radiance"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Downwelled Radiance Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_EMIS": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_EMIS.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Emissivity Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_EMIS",
+          "description": "emissivity"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Emissivity Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_EMSD": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_EMSD.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Emissivity Standard Deviation Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_EMSD",
+          "description": "emissivity standard deviation"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Emissivity Standard Deviation Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_TRAD": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_TRAD.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Thermal Radiance Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_TRAD",
+          "description": "thermal radiance"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Thermal Radiance Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_URAD": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_URAD.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Upwelled Radiance Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_URAD",
+          "description": "upwelled radiance"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Upwelled Radiance Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "MTL.json": {
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_MTL.json",
+      "type": "application/json",
+      "title": "Product Metadata File (json)",
+      "description": "Collection 2 Level-1 Product Metadata File (json)"
+    },
+    "QA_PIXEL": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_QA_PIXEL.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Pixel Quality Assessment Band",
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-1 Pixel Quality Assessment Band",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_ATRAN": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_ATRAN.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Atmospheric Transmittance Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_ATRAN",
+          "description": "atmospheric transmission"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Atmospheric Transmittance Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "ST_CDIST": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_ST_CDIST.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Cloud Distance Band",
+      "eo:bands": [
+        {
+          "gsd": 30,
+          "name": "ST_CDIST",
+          "description": "distance to nearest cloud"
+        }
+      ],
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Landsat Collection 2 Level-2 Cloud Distance Band Surface Temperature Product",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "QA_RADSAT": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_QA_RADSAT.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Radiometric Saturation Quality Assessment Band",
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-1 Radiometric Saturation Quality Assessment Band",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "thumbnail": {
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_thumb_small.jpeg",
+      "type": "image/jpeg",
+      "title": "Thumbnail image"
+    },
+    "SR_QA_AEROSOL": {
+      "gsd": 30,
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_SR_QA_AEROSOL.TIF",
+      "type": "image/tiff; application=geotiff; profile=cloud-optimized",
+      "title": "Aerosol Quality Analysis Band",
+      "proj:shape": [
+        7891,
+        7771
+      ],
+      "description": "Collection 2 Level-2 Aerosol Quality Analysis Band (ANG) Surface Reflectance",
+      "proj:transform": [
+        30,
+        0,
+        472485,
+        0,
+        -30,
+        5373615
+      ]
+    },
+    "reduced_resolution_browse": {
+      "href": "https://landsateuwest.blob.core.windows.net/landsat-c2/level-2/standard/oli-tirs/2020/046/027/LC08_L2SP_046027_20200908_20200919_02_T1/LC08_L2SP_046027_20200908_20200919_02_T1_thumb_large.jpeg",
+      "type": "image/jpeg",
+      "title": "Reduced resolution browse image"
+    },
+    "tilejson": {
+      "title": "TileJSON with default rendering",
+      "href": "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=landsat-8-c2-l2&items=LC08_L2SP_046027_20200908_02_T1&assets=SR_B4,SR_B3,SR_B2&color_formula=gamma+RGB+2.7%2C+saturation+1.5%2C+sigmoidal+RGB+15+0.55",
+      "type": "application/json",
+      "roles": [
+        "tiles"
+      ]
+    },
+    "rendered_preview": {
+      "title": "Rendered preview",
+      "rel": "preview",
+      "href": "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=landsat-8-c2-l2&items=LC08_L2SP_046027_20200908_02_T1&assets=SR_B4,SR_B3,SR_B2&color_formula=gamma+RGB+2.7%2C+saturation+1.5%2C+sigmoidal+RGB+15+0.55",
+      "roles": [
+        "overview"
+      ],
+      "type": "image/png"
+    }
+  },
+  "geometry": {
+    "type": "Polygon",
+    "coordinates": [
+      [
+        [
+          -122.73659863,
+          48.512551
+        ],
+        [
+          -120.21828301,
+          48.09736515
+        ],
+        [
+          -120.85665503,
+          46.35688928
+        ],
+        [
+          -123.37063967,
+          46.78158223
+        ],
+        [
+          -122.73659863,
+          48.512551
+        ]
+      ]
+    ]
+  },
+  "collection": "test-collection",
+  "properties": {
+    "datetime": "2020-09-08T18:55:51.575595Z",
+    "platform": "landsat-8",
+    "proj:bbox": [
+      472485,
+      5136885,
+      705615,
+      5373615
+    ],
+    "proj:epsg": 32610,
+    "description": "Landsat Collection 2 Level-2 Surface Reflectance Product",
+    "instruments": [
+      "oli",
+      "tirs"
+    ],
+    "eo:cloud_cover": 0.19,
+    "view:off_nadir": 0,
+    "landsat:wrs_row": "027",
+    "landsat:scene_id": "LC80460272020252LGN00",
+    "landsat:wrs_path": "046",
+    "landsat:wrs_type": "2",
+    "view:sun_azimuth": 155.2327918,
+    "view:sun_elevation": 45.33819766,
+    "landsat:cloud_cover_land": 0.21,
+    "landsat:processing_level": "L2SP",
+    "landsat:collection_number": "02",
+    "landsat:collection_category": "T1"
+  }
+}
\ No newline at end of file
diff --git a/stac_fastapi/pgstac/tests/resources/test_item.py b/stac_fastapi/pgstac/tests/resources/test_item.py
index baa8b2b82..0d6bde634 100644
--- a/stac_fastapi/pgstac/tests/resources/test_item.py
+++ b/stac_fastapi/pgstac/tests/resources/test_item.py
@@ -366,6 +366,13 @@ async def test_item_search_spatial_query_post(
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     params = {
         "collections": [test_item["collection"]],
         "intersects": test_item["geometry"],
@@ -373,6 +380,7 @@ async def test_item_search_spatial_query_post(
     resp = await app_client.post("/search", json=params)
     assert resp.status_code == 200
     resp_json = resp.json()
+    assert len(resp_json["features"]) == 1
     assert resp_json["features"][0]["id"] == test_item["id"]
 
 
@@ -387,6 +395,13 @@ async def test_item_search_temporal_query_post(
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     item_date = datetime.strptime(test_item["properties"]["datetime"], DATETIME_RFC339)
     print(item_date)
     item_date = item_date + timedelta(seconds=1)
@@ -400,6 +415,7 @@ async def test_item_search_temporal_query_post(
     resp = await app_client.post("/search", json=params)
     print(resp.content)
     resp_json = resp.json()
+    assert len(resp_json["features"]) == 1
     assert resp_json["features"][0]["id"] == test_item["id"]
 
 
@@ -414,17 +430,24 @@ async def test_item_search_temporal_window_post(
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     item_date = datetime.strptime(test_item["properties"]["datetime"], DATETIME_RFC339)
     item_date_before = item_date - timedelta(seconds=1)
     item_date_after = item_date + timedelta(seconds=1)
 
     params = {
         "collections": [test_item["collection"]],
-        "intersects": test_item["geometry"],
         "datetime": f"{item_date_before.strftime(DATETIME_RFC339)}/{item_date_after.strftime(DATETIME_RFC339)}",
     }
     resp = await app_client.post("/search", json=params)
     resp_json = resp.json()
+    assert len(resp_json["features"]) == 1
     assert resp_json["features"][0]["id"] == test_item["id"]
 
 
@@ -439,14 +462,20 @@ async def test_item_search_temporal_open_window(
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     params = {
         "collections": [test_item["collection"]],
-        "intersects": test_item["geometry"],
         "datetime": "../..",
     }
     resp = await app_client.post("/search", json=params)
     resp_json = resp.json()
-    assert resp_json["features"][0]["id"] == test_item["id"]
+    assert len(resp_json["features"]) == 2
 
 
 @pytest.mark.asyncio
@@ -508,6 +537,13 @@ async def test_item_search_bbox_get(app_client, load_test_data, load_test_collec
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     params = {
         "collections": test_item["collection"],
         "bbox": ",".join([str(coord) for coord in test_item["bbox"]]),
@@ -515,6 +551,7 @@ async def test_item_search_bbox_get(app_client, load_test_data, load_test_collec
     resp = await app_client.get("/search", params=params)
     assert resp.status_code == 200
     resp_json = resp.json()
+    assert len(resp_json["features"]) == 1
     assert resp_json["features"][0]["id"] == test_item["id"]
 
 
@@ -529,12 +566,20 @@ async def test_item_search_get_without_collections(
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     params = {
         "bbox": ",".join([str(coord) for coord in test_item["bbox"]]),
     }
     resp = await app_client.get("/search", params=params)
     assert resp.status_code == 200
     resp_json = resp.json()
+    assert len(resp_json["features"]) == 1
     assert resp_json["features"][0]["id"] == test_item["id"]
 
 
@@ -549,17 +594,24 @@ async def test_item_search_temporal_window_get(
     )
     assert resp.status_code == 200
 
+    # Add second item with a different datetime.
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     item_date = datetime.strptime(test_item["properties"]["datetime"], DATETIME_RFC339)
     item_date_before = item_date - timedelta(seconds=1)
     item_date_after = item_date + timedelta(seconds=1)
 
     params = {
         "collections": test_item["collection"],
-        "bbox": ",".join([str(coord) for coord in test_item["bbox"]]),
         "datetime": f"{item_date_before.strftime(DATETIME_RFC339)}/{item_date_after.strftime(DATETIME_RFC339)}",
     }
     resp = await app_client.get("/search", params=params)
     resp_json = resp.json()
+    assert len(resp_json["features"]) == 1
     assert resp_json["features"][0]["id"] == test_item["id"]
 
 
@@ -600,6 +652,12 @@ async def test_item_search_post_without_collection(
     )
     assert resp.status_code == 200
 
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     params = {
         "bbox": test_item["bbox"],
     }
@@ -620,6 +678,12 @@ async def test_item_search_properties_jsonb(
     )
     assert resp.status_code == 200
 
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     # EPSG is a JSONB key
     params = {"query": {"proj:epsg": {"gt": test_item["properties"]["proj:epsg"] - 1}}}
     print(params)
@@ -640,7 +704,13 @@ async def test_item_search_properties_field(
     )
     assert resp.status_code == 200
 
-    params = {"query": {"platform": {"eq": "landsat-8"}}}
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
+    params = {"query": {"eo:cloud_cover": {"eq": 0}}}
     print(params)
     resp = await app_client.post("/search", json=params)
     assert resp.status_code == 200
@@ -659,6 +729,12 @@ async def test_item_search_get_query_extension(
     )
     assert resp.status_code == 200
 
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     # EPSG is a JSONB key
     params = {
         "collections": [test_item["collection"]],
@@ -694,6 +770,12 @@ async def test_item_search_get_filter_extension_cql(
     )
     assert resp.status_code == 200
 
+    second_test_item = load_test_data("test_item2.json")
+    resp = await app_client.post(
+        f"/collections/{test_item['collection']}/items", json=second_test_item
+    )
+    assert resp.status_code == 200
+
     # EPSG is a JSONB key
     params = {
         "collections": [test_item["collection"]],