Skip to content

JSON Schema

Validate a map with any tool, and editor support for the files.

Applies to EngineCloud
View as Markdown

Three schemas describe the format, in JSON Schema 2020-12, and a fourth the envelope of every event:

FileSchema
cases/map.yamlhttps://cases.sypnia.com/schema/v1/map.json
cases/navigation.yamlhttps://cases.sypnia.com/schema/v1/navigation.json
cases/**/*.case.yamlhttps://cases.sypnia.com/schema/v1/case.json
an event (What each event carries)https://cases.sypnia.com/schema/v1/event.json

They also ship inside the package, for offline use, as exports and as files in its schema/ folder:

TypeScript
import { mapSchema, navigationSchema, caseSchema, eventSchema, parseMap, validateMap } from '@sypnia/cases/spec';

const map = await parseMap('cases');
const result = validateMap(map); // { ok, errors: [{ file, path, line, message, kind }], findings }

In your editor

Add the schema line at the top of a file and editors with YAML support complete fields and show errors as you type:

YAML
# yaml-language-server: $schema=https://cases.sypnia.com/schema/v1/case.json
id: place-order

npx @sypnia/cases init adds it for you.

    Search pages, sections and terms