{
  "id": "python/fastapi-response-model-mismatch",
  "signature": "pydantic.error_wrappers.ValidationError: 1 validation error for ResponseModel\nvalue is not a valid dict",
  "signature_zh": "Pydantic 验证错误：ResponseModel 的字段不是有效的字典。",
  "regex": "pydantic\\.error_wrappers\\.ValidationError:\\ 1\\ validation\\ error\\ for\\ ResponseModel\\\nvalue\\ is\\ not\\ a\\ valid\\ dict",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Response model expects a dict but function returns a different type (e.g., list or string).",
  "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": "Loses type safety and may cause runtime errors downstream.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May not match model fields exactly; still validation error.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Ensure return type matches response_model: @app.get('/item', response_model=Item)\nasync def get_item() -> Item:\n    return Item(name='test', price=10.0)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use response_model_exclude_unset=True to allow missing fields: @app.get('/item', response_model=Item, response_model_exclude_unset=True)",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}