Getting Started
Install the INHERIT SDK, create your first estate document, and validate it. Under 2 minutes.
Install#
npm install @openinherit/sdkOr use the schemas directly without the SDK:
npm install @openinherit/schemaOr use the command-line tool (requires Go 1.21+):
go install github.com/openinherit/inherit-cli@latestCreate your first document#
A minimal INHERIT estate document needs three things: an estate, a person, and a relationship connecting them.
import { createEstate, createPerson, createRelationship } from '@openinherit/sdk';
const estate = createEstate({
id: crypto.randomUUID(),
version: '6.4.2',
jurisdiction: 'england-wales',
people: [
createPerson({
id: crypto.randomUUID(),
givenNames: ['Jane'],
familyName: 'Smith',
role: 'testator'
})
]
});Validate it#
import { validate } from '@openinherit/sdk';
const result = validate(estate);
if (result.valid) {
console.log('Document is valid');
} else {
console.error('Validation errors:', result.errors);
}Or try the online validator — paste your JSON and see results instantly.
With the CLI#
The CLI scaffolds realistic estate documents interactively:
# Interactive — asks 5 questions with sensible defaults
inherit init
# Non-interactive with flags (for CI)
inherit init --non-interactive --jurisdiction scotland --testator "Angus McTavish"
# Generate a full Level 2 document (trusts, insurance, digital assets)
inherit init --full
# Validate your document
inherit validate estate.json --level 2See the full CLI reference for all commands and options.
Validator compatibility notes#
Ajv strict mode#
The INHERIT schema uses a custom annotation x-lint-exclude (a Sourcemeta lint directive).
Ajv’s strict mode rejects unknown keywords by default:
error: strict mode: unknown keyword: "x-lint-exclude"To work around this, either disable strict mode or register the keyword:
import Ajv from 'ajv';
// Option 1: Disable strict mode
const ajv = new Ajv({ strict: false });
// Option 2: Register the keyword (keeps strict mode for everything else)
const ajv = new Ajv();
ajv.addKeyword('x-lint-exclude');Option 2 is recommended — it preserves strict mode’s other checks while allowing the lint annotation to pass through as a no-op.
This annotation is present on @context and @type properties in the root schema and
catalogue schema. It has no effect on validation — it only controls Sourcemeta CLI
lint behaviour.
Validating extension content#
The INHERIT base schema accepts any x-inherit-* extension block without checking its
internal structure. This is by design — the base schema is jurisdiction-agnostic.
To validate extension-specific content (e.g. that a Hindu succession school field is
"dayabhaga" or "mitakshara"), load the relevant extension schema alongside the base
schema.
With the Sourcemeta CLI#
jsonschema validate v3/schema.json document.json \
--resolve v3/extensions/hindu-succession/hindu-succession.json \
--resolve v3/common/With Ajv (JavaScript)#
import Ajv from 'ajv';
import baseSchema from '@openinherit/schema/v3/schema.json';
import hinduSuccession from '@openinherit/schema/v3/extensions/hindu-succession/hindu-succession.json';
const ajv = new Ajv({ strict: false });
ajv.addSchema(hinduSuccession);
const validate = ajv.compile(baseSchema);With Python jsonschema#
from referencing import Registry, Resource
from jsonschema import Draft202012Validator
import json
base = json.load(open('v3/schema.json'))
extension = json.load(open(
'v3/extensions/hindu-succession/hindu-succession.json'))
registry = Registry().with_resource(
extension['$id'],
Resource.from_contents(extension)
)
validator = Draft202012Validator(base, registry=registry)
validator.validate(document)Extension schemas are published in the @openinherit/schema npm package under
v3/extensions/. The Extension Guide
lists all available
extensions and their schema URIs.
Next steps#
- AI Integration Guide — if you’re using AI to generate INHERIT documents
- Minimal Viable Estate — a complete worked example
- Schema Reference — full field documentation for all 40+ entity types
- Building Extensions — add jurisdiction-specific fields
- Null Semantics — how INHERIT distinguishes missing, null, and empty