Arx Fatalis logo

Arx Fatalis Maps, Mods and Modding Tools

JSON schemas

« back to homepage

Every custom format of Arx Fatalis which arx-convert can read has a JSON schema: it describes the JSON that the tool generates from the binary file, so the result can be validated and edited with completion in an editor. The schemas are self-contained draft 2020-12 documents - every definition they reference is included in the file - so they can be used on their own.

This folder is the copy which the $schema key of the generated JSON resolves to. The files are written by npm run schemas:build of arx-convert and refreshed here by the release workflow of that repository; the x-generatedBy of a file tells which release it came from. This listing is generated at build time from the folder, so it can not go stale. An entry opens the schema in a new tab, so the list stays at hand while it is read.

Using a schema

A JSON file written by arx-convert names the URL of its schema:

{
  "$schema": "https://arx-tools.github.io/schemas/fts.schema.json",
  "header": { ... }
}

Editors which resolve $schema (VS Code and most of the JSON tooling) give completion and inline validation for the file with that URL. The schemas can also be passed to a validator by hand, for example with ajv-cli - the --strict=falseis needed for the x-generatedBy annotation the generator adds:

cat level8.fts.unpacked | arx-convert --from=fts --to=json > level8.json
npx ajv-cli@5 validate --spec=draft2020 --strict=false -s fts.schema.json -d level8.json