{
  "id": "python/fastapi-query-param-missing",
  "signature": "fastapi.exceptions.RequestValidationError: [{'loc': ['query', 'page'], 'msg': 'field required', 'type': 'value_error.missing'}]",
  "signature_zh": "FastAPI 请求验证错误：查询参数 'page' 缺失",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ \\[\\{'loc':\\ \\['query',\\ 'page'\\],\\ 'msg':\\ 'field\\ required',\\ 'type':\\ 'value_error\\.missing'\\}\\]",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A required query parameter is not provided in the request URL.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求 URL 中未提供必需的查询参数。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the default is set, FastAPI won't raise an error; the error occurs only when no default is given.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This handles the error but doesn't fix the missing parameter; the client still needs to send it.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Provide a default value: def read_items(page: int = 1)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Make it optional with Optional[int] = None and handle None in the function",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}