{
  "id": "python/fastapi-422-missing-body",
  "signature": "422 Unprocessable Entity: {\"detail\":[{\"type\":\"missing\",\"loc\":[\"body\",\"email\"],\"msg\":\"Field required\"}]}",
  "signature_zh": "422 Unprocessable Entity: {\"detail\":[{\"type\":\"missing\",\"loc\":[\"body\",\"email\"],\"msg\":\"Field required\"}]}",
  "regex": "422\\ Unprocessable\\ Entity:\\ \\{\"detail\":\\[\\{\"type\":\"missing\",\"loc\":\\[\"body\",\"email\"\\],\"msg\":\"Field\\ required\"\\}\\]\\}",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The client sent a JSON body missing a required field, or sent form data where JSON was expected, so Pydantic validation rejects the request.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端发送的 JSON 正文缺少必填字段，或发送了表单数据而期望 JSON，导致 Pydantic 验证拒绝请求。",
  "versions": [
    {
      "version": "0.100+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides the real cause; clients still send invalid payloads and data is dropped.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Still required in Pydantic v2 unless a default is provided.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "class UserIn(BaseModel):\n    email: EmailStr\n    name: str = ''",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "from fastapi import Form\n@app.post('/u')\nasync def create(email: str = Form(...)): ...",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}