Skip to content

v0.2.0 — Typed vocabularies

Choose a tag to compare

@mbolli mbolli released this 31 Aug 18:42
· 14 commits to master since this release

Backfilled release note. Originally tagged 2026-06-15; the publish date above is when
this GitHub release entry was created.

Added

  • Typed vocabularies: optional, opt-in-beyond-core validation of typed values (single-key
    objects whose key starts with #, e.g. {#utc ...}) against the official vocabularies —
    core, time, network, math, spatial, color, and geo — plus user-registered custom
    vocabularies. New Ron::validate(), and vocabularies / registry options on
    Ron::fromJson, Ron::canonicalRon, and Ron::canonicalHash. The core vocabulary is
    validated by default; pass vocabularies: [] to disable. Validation preserves the value
    model, so typed values round-trip losslessly; Ron::toJson is not validated.
  • Mbolli\Ron\Vocabulary\VocabularyRegistry (official(), register(), replace()) for
    declaring custom, reverse-DNS-namespaced vocabularies. A validator returns true/false
    to accept/reject, any other value to transform the payload, or replace($v) to set a
    literal (e.g. boolean) payload.

Changed

  • A single #-prefixed key now renders in collapsed typed form ({#tag payload}), with the
    wrapper transparent to indentation and multi-key payloads allowed to inline, matching the
    updated RON spec and ron-go. This changes the rendered RON for documents containing
    single-key #-objects.

Full changelog: CHANGELOG.md · v0.1.1...v0.2.0