Skip to content

Commit e0a6fcc

Browse files
Merge pull request #52 from developmentseed/patch/stac-json-response
use JSONResponse
2 parents 36e0618 + cb97529 commit e0a6fcc

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

dockerfiles/Dockerfile.raster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PYTHON_VERSION=3.12
22

3-
FROM bitnami/python:${PYTHON_VERSION}
3+
FROM python:${PYTHON_VERSION}
44
RUN apt update && apt upgrade -y \
55
&& apt install curl -y \
66
&& rm -rf /var/lib/apt/lists/*

dockerfiles/Dockerfile.stac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PYTHON_VERSION=3.12
22

3-
FROM bitnami/python:${PYTHON_VERSION}
3+
FROM python:${PYTHON_VERSION}
44
RUN apt update && apt upgrade -y \
55
&& apt install curl -y \
66
&& rm -rf /var/lib/apt/lists/*

dockerfiles/Dockerfile.vector

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PYTHON_VERSION=3.12
22

3-
FROM bitnami/python:${PYTHON_VERSION}
3+
FROM python:${PYTHON_VERSION}
44
RUN apt update && apt upgrade -y \
55
&& apt install curl -y \
66
&& rm -rf /var/lib/apt/lists/*

runtimes/eoapi/stac/eoapi/stac/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import jinja2
77
from eoapi.auth_utils import OpenIdConnectAuth, OpenIdConnectSettings
88
from fastapi import FastAPI
9-
from fastapi.responses import ORJSONResponse
109
from stac_fastapi.api.models import (
1110
CollectionUri,
1211
ItemCollectionUri,
1312
ItemUri,
13+
JSONResponse,
1414
create_get_request_model,
1515
create_post_request_model,
1616
create_request_model,
@@ -82,7 +82,7 @@
8282
TransactionExtension(
8383
client=TransactionsClient(),
8484
settings=settings,
85-
response_class=ORJSONResponse,
85+
response_class=JSONResponse,
8686
)
8787
)
8888
application_extensions.append(
@@ -220,7 +220,7 @@ async def lifespan(app: FastAPI):
220220
collections_get_request_model=collections_get_model,
221221
search_get_request_model=search_get_model,
222222
search_post_request_model=search_post_model,
223-
response_class=ORJSONResponse,
223+
response_class=JSONResponse,
224224
middlewares=middlewares,
225225
)
226226
app = api.app

runtimes/eoapi/stac/eoapi/stac/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ async def item_collection(
547547
if fields.include or fields.exclude:
548548
return JSONResponse(item_collection) # type: ignore
549549

550-
return ItemCollection(**item_collection)
550+
return item_collection
551551

552552
# NOTE: We can't use `super.get_search(...)` because of the `fields` extension
553553
# which, when used, might return a JSONResponse directly instead of a ItemCollection (TypeDict)
@@ -657,7 +657,7 @@ async def get_search(
657657
if fields.include or fields.exclude:
658658
return JSONResponse(item_collection) # type: ignore
659659

660-
return ItemCollection(**item_collection)
660+
return item_collection
661661

662662
# NOTE: We can't use `super.post_search(...)` because of the `fields` extension
663663
# which, when used, might return a JSONResponse directly instead of a ItemCollection (TypeDict)
@@ -717,4 +717,4 @@ async def post_search(
717717
if fields.include or fields.exclude:
718718
return JSONResponse(item_collection) # type: ignore
719719

720-
return ItemCollection(**item_collection)
720+
return item_collection

runtimes/eoapi/stac/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
]
2121
dynamic = ["version"]
2222
dependencies = [
23+
"orjson",
2324
"stac-fastapi.pgstac>=5.0,<5.1",
2425
"jinja2>=2.11.2,<4.0.0",
2526
"starlette-cramjam>=0.4,<0.5",

0 commit comments

Comments
 (0)