Reference implementation

Official validator

Paste the contents of a .roadbook.json file, drop the file below, or start from an example. Structure, formats and reference integrity are checked locally, in your browser — nothing is sent to any server.

examples
drop a .roadbook.json file here — or paste JSON below

preview · minimal read-only rendering — real players do much more

Command line#

node cli.mjs my-trip.roadbook.json
# exit code: 0 = valid, 1 = errors, 2 = unreadable

As a library#

The module roadbook-validate.mjs (ESM, zero-dependency, MIT) works in browsers and Node:

import { validateRoadbook } from './roadbook-validate.mjs'

const { ok, version, errors, warnings } = validateRoadbook(trip)
// errors/warnings: [{ path: "$.days[0].items[2].time", message: "…" }]

The JSON Schema (draft 2020-12) can also be used with any generic validator (ajv, …) — the reference implementation additionally checks cross-entity integrity that a schema cannot express.

Validate from a URL#

Append ?url= to this page to prefill it with a remote file (the host must allow cross-origin reads): validator.html?url=https://example.org/trip.roadbook.json. Or ?example=demo to load a bundled example. Add &preview to open the preview right away.