Skip to content

SEM002: Validity Date Order

Severity: Error Category: Semantic Validation

Description

The validFrom date must be before validUntil.

Rule Details

This rule ensures temporal consistency in credential validity periods. A passport cannot be valid starting from a date that is on or after its expiration date.

Example

Invalid

{
  "validFrom": "2025-12-01T00:00:00Z",
  "validUntil": "2025-01-01T00:00:00Z"
}

Message: validFrom (2025-12-01T00:00:00Z) must be before validUntil (2025-01-01T00:00:00Z)

Valid

{
  "validFrom": "2025-01-01T00:00:00Z",
  "validUntil": "2026-01-01T00:00:00Z"
}

How to Fix

Ensure validFrom is chronologically before validUntil. Check for:

  1. Typos in date values
  2. Swapped field values
  3. Timezone issues

References