Schema 0.x - Breaking changes expected. Not yet stable.

JSON Schema

Machine-readable schema for validating manifest.json files.

Download

manifest.schema.json

JSON Schema draft 2020-12. Validates the manifest.json file inside a .brfr archive.

Usage

Node.js (ajv)

import Ajv from 'ajv';
import schema from './manifest.schema.json';

const ajv = new Ajv();
const validate = ajv.compile(schema);

const manifest = JSON.parse(manifestJson);
if (!validate(manifest)) {
  console.error(validate.errors);
}

Python (jsonschema)

import json
from jsonschema import validate, ValidationError

with open('manifest.schema.json') as f:
    schema = json.load(f)

with open('manifest.json') as f:
    manifest = json.load(f)

try:
    validate(manifest, schema)
except ValidationError as e:
    print(e.message)

Command Line (ajv-cli)

npx ajv validate -s manifest.schema.json -d manifest.json

Schema Reference

The schema validates:

Note: The schema validates manifest structure only. It does not verify that referenced media files exist in the archive.

IDE Integration

Add to your manifest.json for autocomplete and validation:

{
  "$schema": "https://brfr.dev/schema/manifest.schema.json",
  "version": "0.10",
  ...
}