Skip to content

Add versioned CTRF schema validation - #86

Merged
Ma11hewThomas merged 1 commit into
mainfrom
feature/versioned-schema-validation
Oct 3, 2026
Merged

Ma11hewThomas merged 1 commit into
mainfrom
feature/versioned-schema-validation

Conversation

@Ma11hewThomas

@Ma11hewThomas Ma11hewThomas commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Updates ctrf-js to support validation against every published CTRF specification version:

  • 0.0.1
  • 0.0.2
  • 0.0.3
  • 0.0.4
  • 0.1.0
  • latest, which resolves to 0.1.0

Each schema is copied exactly from its corresponding CTRF release. Schema loading now uses the complete semantic version so patch releases can have distinct validation behaviour.

Retry-history validation is version-aware: the stricter rules apply to 0.0.4 and 0.1.0, while earlier versions retain their historical behaviour.

This change also:

  • Sets 0.1.0 as the current and default specification version.
  • Adds version selection to validate(), isValid(), and validateStrict().
  • Exports SchemaSelector and SupportedSpecVersion.
  • Updates builders, merging, documentation, and generated API references.
  • Prepares ctrf-js 0.4.0.

Verification

  • All 230 tests pass.
  • Type checking, linting, formatting, documentation, and ESM/CJS builds pass.
  • Every bundled schema is byte-for-byte identical to its corresponding CTRF release.
  • Package validation reports no type or export problems.
  • The package contains all five versioned schemas.

@Ma11hewThomas
Ma11hewThomas merged commit 7862c44 into main Oct 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant