FastAPI returns `422 Unprocessable Entity` for a webhook from a third party.
BeginnerTroubleshootingConcurrency, async, tests, services & containers
Answer
Likely causes → The request body does not match the pydantic model: missing fields, wrong types, or the sender posts application/x-www-form-urlencoded (Slack slash commands do) instead of JSON.
Diagnose → Read the response body; FastAPI lists the failing fields and reasons. Log request.headers["content-type"].
Fix → Adjust the model (optional fields, correct types), or accept Form(...) parameters / raw Request body for non-JSON senders.
Prevent → Model webhooks from real sample payloads and test with them.
More on Concurrency, async, tests, services & containers
`RuntimeError: asyncio.run() cannot be called from a running event loop` in a Jupyter notebook or inside an async framework.Intermediate`RuntimeWarning: coroutine 'fetch' was never awaited` and nothing happens.BeginnerAn asyncio health-checker is no faster than a sequential loop.Advanced`Task was destroyed but it is pending!` at shutdown.Advanced`OSError: [Errno 24] Too many open files` from an asyncio scanner with 20,000 targets.IntermediateA `ThreadPoolExecutor` job finishes "successfully" but half the work is missing, with no errors logged.Intermediate