{
  "id": "python/fastapi-pydantic-validationerror",
  "signature": "pydantic.error_wrappers.ValidationError: 1 validation error for User",
  "signature_zh": "pydantic.error_wrappers.ValidationError：User 有 1 个验证错误",
  "regex": "pydantic\\.error_wrappers\\.ValidationError:\\ 1\\ validation\\ error\\ for\\ User",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Data passed to a Pydantic model doesn't match its schema.",
  "root_cause_type": "generic",
  "root_cause_zh": "传递给 Pydantic 模型的数据与其模式不匹配。",
  "versions": [
    {
      "version": "2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.5.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Only ignores extra fields, not type errors.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Same validation applies.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "User(name='John', age=30)  # age must be int",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "@field_validator('age')\ndef parse_age(cls, v):\n    return int(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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-09-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}