Problem
When markdown frontmatter contains an unquoted ISO date like:
parses it as a JavaScript Mon Apr 6 12:20:39 AEST 2026 object, not a string. This fails JSON Schema validation against properties:
Reproduction
- Create a markdown file with (unquoted) in frontmatter
- Validate against a schema where the property is
- Validation fails — the value is a Date object, not a string
Proposed fix
JSON Schema supports a annotation on string types: https://json-schema.org/understanding-json-schema/reference/type#format
We should:
- **Support ** (and ) on string properties in schema definitions
- Coerce Date objects from gray-matter to ISO strings during parsing, so becomes before validation
- Validate the coerced string against the format annotation (e.g. ISO 8601 pattern)
- This should happen in the markdown plugin's read phase, not in the schema validator — fix the data at the boundary
Common frontmatter fields affected: date, published_date, due_date, deadline, created, updated.
Scope
- Coercion should only apply when the schema declares the property as with a date-related format — we don't want to silently coerce strings in other contexts
- Consider whether to also coerce unquoted dates that aren't Date objects (gray-matter usually handles this, but edge cases with different YAML parsers may vary)
Problem
When markdown frontmatter contains an unquoted ISO date like:
parses it as a JavaScript Mon Apr 6 12:20:39 AEST 2026 object, not a string. This fails JSON Schema validation against properties:
Reproduction
Proposed fix
JSON Schema supports a annotation on string types: https://json-schema.org/understanding-json-schema/reference/type#format
We should:
Common frontmatter fields affected:
date,published_date,due_date,deadline,created,updated.Scope