{
  "id": "python/fastapi-response-model-validation-error",
  "signature": "fastapi.exceptions.ResponseValidationError: 1 validation error for Response\\nvalue is not a valid dict (type=type_error.dict)",
  "signature_zh": "FastAPI 响应验证错误：响应值不是有效的字典（类型=类型错误.字典）",
  "regex": "fastapi\\.exceptions\\.ResponseValidationError:\\ 1\\ validation\\ error\\ for\\ Response\\\\nvalue\\ is\\ not\\ a\\ valid\\ dict\\ \\(type=type_error\\.dict\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "响应模型与返回的数据类型不匹配。",
  "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": "可能丢失数据或引发其他错误。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "失去 API 文档和验证优势。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "from pydantic import BaseModel\\nclass Item(BaseModel):\\n    name: str\\n    price: float\\n@app.get('/items/{id}', response_model=Item)\\nasync def get_item(id: int):\\n    return {'name': 'Foo', 'price': 10.5}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "app.get('/items', 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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-04-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}