mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-24 22:59:32 -05:00
* ➕ Add docs to default_response_class * ✅ create a tip * ✅ fixing the tip * 🚑 grammar * 📝 Update docs for default response class Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
10 lines
205 B
Python
10 lines
205 B
Python
from fastapi import FastAPI
|
|
from fastapi.responses import ORJSONResponse
|
|
|
|
app = FastAPI(default_response_class=ORJSONResponse)
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items():
|
|
return [{"item_id": "Foo"}]
|