mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-30 09:39:20 -05:00
* ✨ Do not require default value in Query(), Path(), Header(), etc * 📝 Update source examples for docs with default and required values * ✅ Update tests with new default values and not required Ellipsis * 📝 Update docs for Query params and update info about default value, required, Ellipsis
9 lines
160 B
Python
9 lines
160 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}
|