File tree Expand file tree Collapse file tree 5 files changed +8
-6
lines changed
extensions/stac_fastapi/extensions/core Expand file tree Collapse file tree 5 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 55### Fixed
66
77- avoid future deprecation for pydantic.Field and use ` json_schema_extra ` instead of ` openapi_examples `
8+ - use ` orjson ` based JSONResponse when available
89
910## [ 5.2.0] - 2025-04-18
1011
Original file line number Diff line number Diff line change 1212from stac_pydantic .shared import MimeTypes
1313from stac_pydantic .version import STAC_VERSION
1414from starlette .middleware import Middleware
15- from starlette .responses import JSONResponse , Response
15+ from starlette .responses import Response
1616
1717from stac_fastapi .api .errors import DEFAULT_STATUS_CODES , add_exception_handlers
1818from stac_fastapi .api .middleware import CORSMiddleware , ProxyHeaderMiddleware
2323 GeoJSONResponse ,
2424 ItemCollectionUri ,
2525 ItemUri ,
26+ JSONResponse ,
2627)
2728from stac_fastapi .api .openapi import update_openapi
2829from stac_fastapi .api .routes import (
Original file line number Diff line number Diff line change 88from fastapi .exceptions import RequestValidationError , ResponseValidationError
99from starlette import status
1010from starlette .requests import Request
11- from starlette .responses import JSONResponse
1211
12+ from stac_fastapi .api .models import JSONResponse
1313from stac_fastapi .types .errors import (
1414 ConflictError ,
1515 DatabaseError ,
Original file line number Diff line number Diff line change 22
33from fastapi import FastAPI
44from starlette .requests import Request
5- from starlette .responses import JSONResponse , Response
5+ from starlette .responses import Response
66from starlette .routing import Route , request_response
77
88
@@ -22,7 +22,7 @@ def update_openapi(app: FastAPI) -> FastAPI:
2222 # Create a patched endpoint function that modifies the content type of the response
2323 async def patched_openapi_endpoint (req : Request ) -> Response :
2424 # Get the response from the old endpoint function
25- response : JSONResponse = await old_endpoint (req )
25+ response = await old_endpoint (req )
2626 # Update the content type header in place
2727 response .headers ["content-type" ] = "application/vnd.oai.openapi+json;version=3.0"
2828 # Return the updated response
Original file line number Diff line number Diff line change 77from fastapi import APIRouter , Body , FastAPI
88from stac_pydantic import Collection , Item , ItemCollection
99from stac_pydantic .shared import MimeTypes
10- from starlette .responses import JSONResponse , Response
10+ from starlette .responses import Response
1111from typing_extensions import Annotated
1212
13- from stac_fastapi .api .models import CollectionUri , ItemUri
13+ from stac_fastapi .api .models import CollectionUri , ItemUri , JSONResponse
1414from stac_fastapi .api .routes import create_async_endpoint
1515from stac_fastapi .types .config import ApiSettings
1616from stac_fastapi .types .core import AsyncBaseTransactionsClient , BaseTransactionsClient
You can’t perform that action at this time.
0 commit comments