{
  "id": "python/fastapi-request-validation-query",
  "signature": "fastapi.exceptions.RequestValidationError: 1 validation error for Request\nquery -> page\n  Input should be a valid integer, unable to parse string as an integer",
  "signature_zh": "fastapi.exceptions.RequestValidationError: 请求出现 1 个验证错误\nquery -> page\n  输入应为有效整数，无法将字符串解析为整数",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ 1\\ validation\\ error\\ for\\ Request\\\nquery\\ \\->\\ page\\\n\\ \\ Input\\ should\\ be\\ a\\ valid\\ integer,\\ unable\\ to\\ parse\\ string\\ as\\ an\\ integer",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A query parameter declared as int received a non-numeric string (often empty or 'abc') from the client.",
  "root_cause_type": "generic",
  "root_cause_zh": "声明为 int 的查询参数收到了客户端传来的非数字字符串（通常是空值或 'abc'）。",
  "versions": [
    {
      "version": "0.100+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Clients keep sending bad data and pagination logic receives None.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Moves the failure to an uncaught ValueError deeper in the stack.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "from fastapi import Query\n@app.get('/items')\nasync def items(page: int = Query(1, ge=1)): ...",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "@app.exception_handler(RequestValidationError)\nasync def handler(req, exc):\n    return JSONResponse(status_code=422, content={'errors': exc.errors()})",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}