{
  "id": "python/fastapi-422-field-required",
  "signature": "fastapi.exceptions.RequestValidationError: 1 validation error for Item\nname\n  field required (type=value_error.missing)",
  "signature_zh": "fastapi.exceptions.RequestValidationError: Item 出现 1 个验证错误：name 字段缺失 (type=value_error.missing)",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ 1\\ validation\\ error\\ for\\ Item\\\nname\\\n\\ \\ field\\ required\\ \\(type=value_error\\.missing\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The Pydantic model declares a required field, but the incoming JSON body does not include it, so request parsing fails before the handler runs.",
  "root_cause_type": "generic",
  "root_cause_zh": "Pydantic 模型声明了一个必填字段，但传入的 JSON 请求体中没有该字段，因此在处理函数运行之前请求解析就失败了。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Validation happens in FastAPI's dependency layer before the handler, so the except never triggers.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This affects output serialization, not input validation.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "class Item(BaseModel):\n    name: str = ''",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.93,
      "how": "from typing import Optional\nclass Item(BaseModel):\n    name: Optional[str] = None",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}