{
  "id": "python/fastapi-query-param-list-parsing",
  "signature": "fastapi.exceptions.RequestValidationError: 1 validation error for Request\nquery -> ids.0\n  value is not a valid integer (type=type_error.integer)",
  "signature_zh": "fastapi.exceptions.RequestValidationError: Request 出现 1 个验证错误\nquery -> ids.0\n  值不是有效的整数 (type=type_error.integer)",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ 1\\ validation\\ error\\ for\\ Request\\\nquery\\ \\->\\ ids\\.0\\\n\\ \\ value\\ is\\ not\\ a\\ valid\\ integer\\ \\(type=type_error\\.integer\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Client sent repeated query parameters (ids=1&ids=2) but the endpoint declared ids: List[int] with an older FastAPI or used ids[]=1 which is not parsed.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端发送了重复查询参数（ids=1&ids=2），但端点声明 ids: List[int] 使用了旧版 FastAPI，或使用了不被解析的 ids[]=1。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Loses validation and OpenAPI schema.",
      "fail_rate": 0.55,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "FastAPI does not strip brackets by default.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Declare ids: List[int] = Query(default=[]) and send ids=1&ids=2",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "Use a JSON body model with ids: List[int] instead of query params",
      "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-05-27",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}