-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Description
Hey @tiangolo! I've been wondering why FastAPI doesn't use the function's return -> signature instead of the response_model argument? I think it would be a bit more natural to express the return schema like this:
@router.post("/")
def create_worker(
params: CreateWorker, auth_token: str = Depends(shared.get_authorization)
) -> CreateWorkerResponse:
# code
return CreateWorkerResponse(...)euri10