Skip to content

JSON Schema

The schema is published at a stable address:

https://docs.ananga.ai/schema/funscript.schema.json

It follows JSON Schema draft 2020-12 and matches the spec: actions (or an axes array) is required, each action needs at ≥ 0 and pos between 0 and 100, and unknown fields are allowed.

import Ajv2020 from 'ajv/dist/2020.js';
const schema = await (await fetch('https://docs.ananga.ai/schema/funscript.schema.json')).json();
const validate = new Ajv2020({ allErrors: true }).compile(schema);
if (!validate(script)) console.log(validate.errors);
import json, urllib.request
from jsonschema import Draft202012Validator
schema = json.load(urllib.request.urlopen('https://docs.ananga.ai/schema/funscript.schema.json'))
errors = list(Draft202012Validator(schema).iter_errors(script))

A schema checks shape, not motion. A script can be valid JSON and still ask a device to move faster than it can, or send points closer together than it accepts. For that, use check() in the library or the checker on ananga.ai.