{
  "id": "api/rest-api-version-mismatch-header",
  "signature": "400 Bad Request: API version header 'X-API-Version' is required and must be a valid semver",
  "signature_zh": "400 错误请求：API 版本标头 'X-API-Version' 是必需的，且必须为有效的语义化版本",
  "regex": "400 Bad Request: API version header 'X-API-Version' is required and must be a valid semver",
  "domain": "api",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The client did not include the required 'X-API-Version' header in the request, or the value does not conform to semantic versioning (e.g., '2.0' instead of '2.0.0').",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端未在请求中包含必需的 'X-API-Version' 标头，或者该值不符合语义化版本控制（例如，'2.0' 而非 '2.0.0'）。",
  "versions": [
    {
      "version": "REST API best practices 2023+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Spring Boot 3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "FastAPI 0.100+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Express.js 4.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The server strictly requires the header; omitting it results in a 400 error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The server expects a full semver string (e.g., '2.0.0'); partial versions are rejected.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The server specifically looks for 'X-API-Version'; other headers are ignored.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the 'X-API-Version' header with a valid semver value. Example in cURL:\ncurl -H 'X-API-Version: 2.0.0' https://api.example.com/resource",
      "success_rate": 0.95,
      "how": "Add the 'X-API-Version' header with a valid semver value. Example in cURL:\ncurl -H 'X-API-Version: 2.0.0' https://api.example.com/resource",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the API documentation for the exact version string required (e.g., '1.0.0', '2.1.3').",
      "success_rate": 0.9,
      "how": "Check the API documentation for the exact version string required (e.g., '1.0.0', '2.1.3').",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using an HTTP client library, set default headers. Example in Python requests:\nheaders = {'X-API-Version': '2.0.0'}\nresponse = requests.get('https://api.example.com/resource', headers=headers)",
      "success_rate": 0.95,
      "how": "If using an HTTP client library, set default headers. Example in Python requests:\nheaders = {'X-API-Version': '2.0.0'}\nresponse = requests.get('https://api.example.com/resource', headers=headers)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add the 'X-API-Version' header with a valid semver value. Example in cURL:\ncurl -H 'X-API-Version: 2.0.0' https://api.example.com/resource",
    "Check the API documentation for the exact version string required (e.g., '1.0.0', '2.1.3').",
    "If using an HTTP client library, set default headers. Example in Python requests:\nheaders = {'X-API-Version': '2.0.0'}\nresponse = requests.get('https://api.example.com/resource', headers=headers)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://semver.org/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}