Example: Usage of ORJSONResponse

from fastapi import FastAPI
from fastapi.responses import ORJSONResponse

app = FastAPI()

@app.get("/items/", response_class=ORJSONResponse)
async def read_items():
    data = {"item": [f"value {i}" for i in range(10000)]}
    return ORJSONResponse(content=data)
Powered by Codespace