{
  "id": "python/pydantic-validator-wrong-signature",
  "signature": "pydantic.errors.ConfigError: Invalid validator signature",
  "signature_zh": "pydantic.errors.ConfigError: 无效的验证器签名",
  "regex": "pydantic\\.errors\\.ConfigError:\\ Invalid\\ validator\\ signature",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A @field_validator or @model_validator function has an incorrect number or names of arguments (e.g., missing cls or value).",
  "root_cause_type": "generic",
  "root_cause_zh": "@field_validator 或 @model_validator 函数的参数数量或名称不正确（例如缺少 cls 或 value）。",
  "versions": [
    {
      "version": "2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Pydantic expects at least two arguments: cls and value.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Validators are class methods, not instance methods.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Define correctly: @field_validator('field') def validate(cls, v): return v",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "For model validator: @model_validator(mode='after') def validate(self): return self",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}