{
  "id": "python/fastapi-validation-error-missing-field",
  "signature": "fastapi.exceptions.RequestValidationError: field required (type=value_error.missing)",
  "signature_zh": "FastAPI请求验证错误：缺少必填字段 (类型=值错误.缺失)",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ field\\ required\\ \\(type=value_error\\.missing\\)",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A required field in the request body or query parameters is missing.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求体或查询参数中缺少必填字段。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting the field as Optional in the Pydantic model but not providing a default value.",
      "why_fails": "Optional without default still requires the field in validation; it only allows None.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignoring the error and sending the same request again without changes.",
      "why_fails": "The request is still malformed; the error will persist.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the missing field in the request body or query parameters with a valid value.",
      "success_rate": 0.95,
      "how": "{\"name\": \"John\", \"age\": 30}  # Include all required fields",
      "condition": "",
      "sources": []
    },
    {
      "action": "Modify the Pydantic model to make the field optional with a default value.",
      "success_rate": 0.85,
      "how": "from pydantic import BaseModel\nclass Item(BaseModel):\n    name: str = None  # Optional with default",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}