{
  "id": "python/fastapi-typeerror-path-operation-not-callable",
  "signature": "TypeError: 'function' object is not callable in path operation",
  "signature_zh": "TypeError: 路径操作中的 'function' 对象不可调用",
  "regex": "TypeError:\\ 'function'\\ object\\ is\\ not\\ callable\\ in\\ path\\ operation",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A decorator is used without parentheses, e.g., @app.get instead of @app.get().",
  "root_cause_type": "generic",
  "root_cause_zh": "装饰器使用时不带括号，例如 @app.get 而不是 @app.get()。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding parentheses but not passing path",
      "why_fails": "Still missing required argument.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using class-based view incorrectly",
      "why_fails": "May conflict with function-based approach.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use decorator with parentheses and path",
      "success_rate": 0.95,
      "how": "@app.get('/items')\nasync def get_items():\n    return []",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check for missing parentheses in custom decorators",
      "success_rate": 0.9,
      "how": "def my_decorator(func):\n    return func\n# Use: @my_decorator\ndef my_func(): pass",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}