mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 10:36:39 +00:00
* 🏗️ Implement unique IDs for dynamic models like those used for composite bodies and responses. IDs based on path (not only on function name, as it can be duplicated in a different module). * ✅ Add tests for same function name and composite body * ✅ Update OpenAPI in tests with new dynamic model ID generation
8 lines
167 B
Python
8 lines
167 B
Python
from fastapi import APIRouter, Body
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.post("/compute/")
|
|
def compute(a: int = Body(...), b: str = Body(...)):
|
|
return {"a": a, "b": b}
|