FastAPI : Request File and Form(BaseModel)
from pydantic import BaseModel, Json, ValidationError
from fastapi import APIRouter, File, UploadFile, HTTPException, Form, Depends
class Box(BaseModel):
x: int
y: int
w: int
h: int
router = APIRouter()
@router.post("/test")
async def test(file: UploadFile = File(...),
mask: Json = Form(default=None),
n: int = Form(default=0)) -> str:
// ...