# JSON Schema validation rejects valid date strings due to unknown format 'date-time'

- **ID:** `data/json-schema-unknown-format`
- **Domain:** data
- **Category:** validation_error
- **Error Code:** `ValidationError: Unknown format 'date-time'`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| JSON Schema draft-04 | active | — | — |
| JSON Schema draft-06 | active | — | — |
| ajv 8.12.0 | active | — | — |
| jsonschema 4.18.0 | active | — | — |

## Workarounds

1. **Change 'format': 'date-time' to 'format': 'date' and 'format': 'time' as separate properties in draft-06+.** (95% success)
   ```
   Change 'format': 'date-time' to 'format': 'date' and 'format': 'time' as separate properties in draft-06+.
   ```
2. **Use a validator that supports draft-04, e.g., jsonschema with Draft4Validator: from jsonschema import Draft4Validator** (90% success)
   ```
   Use a validator that supports draft-04, e.g., jsonschema with Draft4Validator: from jsonschema import Draft4Validator
   ```
3. **Upgrade the JSON Schema library to a version that auto-detects the draft version from $schema.** (85% success)
   ```
   Upgrade the JSON Schema library to a version that auto-detects the draft version from $schema.
   ```

## Dead Ends

- **Adding 'format': 'date-time' to schema definitions** — This is the problematic format itself; validators that don't support it will still reject it. (90% fail)
- **Using 'pattern' instead of 'format' with a regex for datetime** — While this works for validation, it does not fix the schema compatibility issue and may be overly restrictive or permissive. (40% fail)
