{
  "id": "python/pydantic-dict-key-type",
  "signature": "pydantic.errors.DictError: value is not a valid dict",
  "signature_zh": "pydantic.errors.DictError: 值不是有效的字典",
  "regex": "pydantic\\.errors\\.DictError:\\ value\\ is\\ not\\ a\\ valid\\ dict",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A field typed as Dict[str, int] receives a dict with non-string keys or non-int values, causing validation failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "类型为 Dict[str, int] 的字段接收到键不是字符串或值不是整数的字典，导致验证失败。",
  "versions": [
    {
      "version": "2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Key type must be str, integer keys fail.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Value type must be int, float fails.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Convert keys to strings: {str(k): v for k, v in data.items()}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Change type to Dict[str, Any] if flexible",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}