{
  "id": "python/fastapi-dependency-override",
  "signature": "fastapi.exceptions.FastAPIError: Dependency overrides are not supported for this dependency.",
  "signature_zh": "fastapi.exceptions.FastAPIError：此依赖项不支持依赖项覆盖。",
  "regex": "fastapi\\.exceptions\\.FastAPIError:\\ Dependency\\ overrides\\ are\\ not\\ supported\\ for\\ this\\ dependency\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Attempting to override a dependency that is not a function or callable, or using incorrect override syntax.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试覆盖不是函数或可调用的依赖项，或使用了错误的覆盖语法。",
  "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": "If dep is not a function, this fails.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Fragile and not recommended.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "def get_db():\n    return 'real'\napp.dependency_overrides[get_db] = lambda: 'fake'",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "class Dep:\n    def __call__(self):\n        return 'real'\napp.dependency_overrides[Dep()] = lambda: 'fake'",
      "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-05-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}