{
  "id": "python/fastapi-multiple-body-params-error",
  "signature": "fastapi.exceptions.FastAPIError: Invalid args for response field",
  "signature_zh": "FastAPI错误：响应字段的参数无效",
  "regex": "fastapi\\.exceptions\\.FastAPIError:\\ Invalid\\ args\\ for\\ response\\ field",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Defining multiple body parameters without a Pydantic model causes FastAPI to misinterpret the request body, leading to validation issues.",
  "root_cause_type": "generic",
  "root_cause_zh": "在没有Pydantic模型的情况下定义多个主体参数，导致FastAPI误解请求体，引发验证问题。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Using dict as a body parameter type can cause serialization issues and unexpected validation errors.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding Body() to each parameter but not using a single model still confuses FastAPI.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Combine parameters into a single Pydantic model: class Item(BaseModel):\\n    name: str\\n    price: float\\nThen use item: Item as the body parameter.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "If multiple bodies are needed, embed them in a parent model: class RequestModel(BaseModel):\\n    item: Item\\n    user: User",
      "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-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}