File tree 5 files changed +8
-6
lines changed
extensions/stac_fastapi/extensions/core
5 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 5
5
### Fixed
6
6
7
7
- avoid future deprecation for pydantic.Field and use ` json_schema_extra ` instead of ` openapi_examples `
8
+ - use ` orjson ` based JSONResponse when available
8
9
9
10
## [ 5.2.0] - 2025-04-18
10
11
Original file line number Diff line number Diff line change 12
12
from stac_pydantic .shared import MimeTypes
13
13
from stac_pydantic .version import STAC_VERSION
14
14
from starlette .middleware import Middleware
15
- from starlette .responses import JSONResponse , Response
15
+ from starlette .responses import Response
16
16
17
17
from stac_fastapi .api .errors import DEFAULT_STATUS_CODES , add_exception_handlers
18
18
from stac_fastapi .api .middleware import CORSMiddleware , ProxyHeaderMiddleware
23
23
GeoJSONResponse ,
24
24
ItemCollectionUri ,
25
25
ItemUri ,
26
+ JSONResponse ,
26
27
)
27
28
from stac_fastapi .api .openapi import update_openapi
28
29
from stac_fastapi .api .routes import (
Original file line number Diff line number Diff line change 8
8
from fastapi .exceptions import RequestValidationError , ResponseValidationError
9
9
from starlette import status
10
10
from starlette .requests import Request
11
- from starlette .responses import JSONResponse
12
11
12
+ from stac_fastapi .api .models import JSONResponse
13
13
from stac_fastapi .types .errors import (
14
14
ConflictError ,
15
15
DatabaseError ,
Original file line number Diff line number Diff line change 2
2
3
3
from fastapi import FastAPI
4
4
from starlette .requests import Request
5
- from starlette .responses import JSONResponse , Response
5
+ from starlette .responses import Response
6
6
from starlette .routing import Route , request_response
7
7
8
8
@@ -22,7 +22,7 @@ def update_openapi(app: FastAPI) -> FastAPI:
22
22
# Create a patched endpoint function that modifies the content type of the response
23
23
async def patched_openapi_endpoint (req : Request ) -> Response :
24
24
# Get the response from the old endpoint function
25
- response : JSONResponse = await old_endpoint (req )
25
+ response = await old_endpoint (req )
26
26
# Update the content type header in place
27
27
response .headers ["content-type" ] = "application/vnd.oai.openapi+json;version=3.0"
28
28
# Return the updated response
Original file line number Diff line number Diff line change 7
7
from fastapi import APIRouter , Body , FastAPI
8
8
from stac_pydantic import Collection , Item , ItemCollection
9
9
from stac_pydantic .shared import MimeTypes
10
- from starlette .responses import JSONResponse , Response
10
+ from starlette .responses import Response
11
11
from typing_extensions import Annotated
12
12
13
- from stac_fastapi .api .models import CollectionUri , ItemUri
13
+ from stac_fastapi .api .models import CollectionUri , ItemUri , JSONResponse
14
14
from stac_fastapi .api .routes import create_async_endpoint
15
15
from stac_fastapi .types .config import ApiSettings
16
16
from stac_fastapi .types .core import AsyncBaseTransactionsClient , BaseTransactionsClient
You can’t perform that action at this time.
0 commit comments