RRStack ships a JSON Schema for serialized RRStackOptions that’s suitable for OpenAPI tooling. The schema mirrors the JSON input shape and intentionally omits advanced constraints to maximize compatibility (e.g., OpenAPI generators that struggle with anyOf + conditional required).
import type { JSONSchema7 } from 'json-schema';
import { RRSTACK_CONFIG_SCHEMA } from '@karmaniverous/rrstack';
RRSTACK_CONFIG_SCHEMA is a JSONSchema7 object.import Ajv from 'ajv';
import { RRSTACK_CONFIG_SCHEMA } from '@karmaniverous/rrstack';
const ajv = new Ajv({ allErrors: true, strict: false });
const validate = ajv.compile(RRSTACK_CONFIG_SCHEMA);
const data = {
timezone: 'UTC',
rules: [{ effect: 'active', options: {} }],
};
if (!validate(data)) {
console.error(validate.errors);
}