ycdemo / fastapi / tests/ test_modules_same_name_body/ app/ b.py

from fastapi import APIRouter, Body

router = APIRouter()


@router.post("/compute/")
def compute(a: int = Body(), b: str = Body()):
    return {"a": a, "b": b}