{
  "id": "python/fastapi-query-param-validation-error",
  "signature": "fastapi.exceptions.RequestValidationError: value is not a valid integer",
  "signature_zh": "FastAPI请求验证错误：值不是有效的整数",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ value\\ is\\ not\\ a\\ valid\\ integer",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A query parameter expected to be an integer is provided as a non-numeric string or 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": "",
      "why_fails": "Using int() conversion in the function body can raise ValueError instead of a proper validation error.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Setting a default value of 0 masks the error but allows invalid data.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use type hints: def read_item(item_id: int = Query(...)):",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Catch RequestValidationError and return a custom message.",
      "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-03-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}