{
  "id": "python/pydantic-json-load-error",
  "signature": "pydantic.errors.JsonError: Invalid JSON",
  "signature_zh": "pydantic.errors.JsonError: 无效的 JSON",
  "regex": "pydantic\\.errors\\.JsonError:\\ Invalid\\ JSON",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "When using Json type, the input string is not valid JSON, causing parsing failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用 Json 类型时，输入字符串不是有效的 JSON，导致解析失败。",
  "versions": [
    {
      "version": "2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If input is already a dict, json.loads fails; Pydantic expects string.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Empty string is not valid JSON.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use Json type: data: Json",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Validate with custom validator: @field_validator('data') def check_json(cls, v): json.loads(v); return v",
      "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.82,
  "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": []
}