{
  "id": "python/fastapi-route-name-conflict-openapi",
  "signature": "fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that <class 'models.User'> is a valid Pydantic field type",
  "signature_zh": "fastapi.exceptions.FastAPIError: 响应字段参数无效！提示：请检查<class 'models.User'>是否为有效的Pydantic字段类型",
  "regex": "fastapi\\.exceptions\\.FastAPIError:\\ Invalid\\ args\\ for\\ response\\ field!\\ Hint:\\ check\\ that\\ <class\\ 'models\\.User'>\\ is\\ a\\ valid\\ Pydantic\\ field\\ type",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Passing a non-Pydantic class as response_model, or a Pydantic v1 BaseModel under v2.",
  "root_cause_type": "generic",
  "root_cause_zh": "将非Pydantic类作为response_model传递，或在v2下使用了Pydantic v1的BaseModel。",
  "versions": [
    {
      "version": "0.100.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.110.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Removes OpenAPI schema; clients lose type info.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Pydantic v2 uses __get_pydantic_core_schema__; v1 hook ignored.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "class UserOut(BaseModel):\\n    id: int\\n    name: str",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "class M(BaseModel):\\n    model_config = ConfigDict(arbitrary_types_allowed=True)\\n    obj: MyClass",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}