{
  "id": "python/fastapi-form-data-required",
  "signature": "fastapi.exceptions.RequestValidationError: value is not a valid dict (type=type_error.dict)",
  "signature_zh": "fastapi.exceptions.RequestValidationError：值不是有效的字典 (type=type_error.dict)",
  "regex": "fastapi\\.exceptions\\.RequestValidationError:\\ value\\ is\\ not\\ a\\ valid\\ dict\\ \\(type=type_error\\.dict\\)",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Sending form data but endpoint expects JSON, or vice versa.",
  "root_cause_type": "generic",
  "root_cause_zh": "发送表单数据但端点期望 JSON，或反之。",
  "versions": [
    {
      "version": "0.100.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.110.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If server expects form, JSON still fails.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Still expects JSON.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "from fastapi import Form\n@app.post('/login')\nasync def login(username: str = Form(...), password: str = Form(...)):",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "For JSON: `Content-Type: application/json`; for form: `application/x-www-form-urlencoded`.",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-01-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}