{
  "id": "data/json-schema-unknown-format",
  "signature": "JSON Schema validation rejects valid date strings due to unknown format 'date-time'",
  "signature_zh": "JSON Schema 验证因未知格式 'date-time' 拒绝有效日期字符串",
  "regex": "(?i)(unknown format.*date-time|format.*date-time.*not supported)",
  "domain": "data",
  "category": "validation_error",
  "subcategory": null,
  "root_cause": "JSON Schema draft-04 uses 'date-time' format, but newer drafts (draft-06+) split into 'date' and 'time', and some validators fail to recognize the combined format.",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON Schema draft-04 使用 'date-time' 格式，但更新版本（draft-06+）拆分为 'date' 和 'time'，部分验证器无法识别组合格式。",
  "versions": [
    {
      "version": "JSON Schema draft-04",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "JSON Schema draft-06",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ajv 8.12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "jsonschema 4.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding 'format': 'date-time' to schema definitions",
      "why_fails": "This is the problematic format itself; validators that don't support it will still reject it.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using 'pattern' instead of 'format' with a regex for datetime",
      "why_fails": "While this works for validation, it does not fix the schema compatibility issue and may be overly restrictive or permissive.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Change 'format': 'date-time' to 'format': 'date' and 'format': 'time' as separate properties in draft-06+.",
      "success_rate": 0.95,
      "how": "Change 'format': 'date-time' to 'format': 'date' and 'format': 'time' as separate properties in draft-06+.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a validator that supports draft-04, e.g., jsonschema with Draft4Validator: from jsonschema import Draft4Validator",
      "success_rate": 0.9,
      "how": "Use a validator that supports draft-04, e.g., jsonschema with Draft4Validator: from jsonschema import Draft4Validator",
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade the JSON Schema library to a version that auto-detects the draft version from $schema.",
      "success_rate": 0.85,
      "how": "Upgrade the JSON Schema library to a version that auto-detects the draft version from $schema.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Change 'format': 'date-time' to 'format': 'date' and 'format': 'time' as separate properties in draft-06+.",
    "Use a validator that supports draft-04, e.g., jsonschema with Draft4Validator: from jsonschema import Draft4Validator",
    "Upgrade the JSON Schema library to a version that auto-detects the draft version from $schema."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times",
  "official_doc_section": null,
  "error_code": "ValidationError: Unknown format 'date-time'",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}