JSON Schema Package
The raw INHERIT JSON Schemas (Draft 2020-12), JSON-LD contexts, and reference data. Use these to build validators, generate types, or integrate INHERIT into any toolchain.
Installation#
npm install @openinherit/schemaThis is a data-only package — no runtime code, no dependencies.
What’s included#
| Export path | Contents |
|---|---|
./v3/* |
Current INHERIT v3 JSON Schemas (Draft 2020-12) |
./v2/* |
Legacy v2 schemas |
./v1/* |
Legacy v1 schemas |
./reference-data/* |
Reference data files (jurisdictions, asset types, etc.) |
./extensions-registry.json |
Registry of all jurisdiction extensions |
Document limits#
Both root document types enforce maxItems on all array properties. Limits are generous — designed so 99%+ of real users never hit them.
Estate document (schema.json) — bounded by legal complexity:
| Array | Limit | Array | Limit |
|---|---|---|---|
| people | 500 | organisations | 500 |
| assets | 2,000 | spaces | 500 |
| bequests | 500 | valuations | 5,000 |
| properties | 200 | lifetimeTransfers | 1,000 |
| trusts | 50 | documents | 200 |
| liabilities | 200 | nonprobateTransfers | 500 |
| executors | 20 | guardians | 20 |
Catalogue document (catalogue.json) — bounded by collection size:
| Array | Limit | Array | Limit |
|---|---|---|---|
| assets | 10,000 | assetInterests | 5,000 |
| valuations | 10,000 | dealerInterests | 2,000 |
| assetCollections | 500 | wishes | 200 |
| organisations | 200 | insurancePolicies | 100 |
| spaces | 200 |
These limits were set in v6.1.0 based on research into real-world estate sizes (blended families, multi-jurisdiction portfolios) and collection inventories (wine, art, antiques, stamps).
Quick start#
Import a schema directly#
import estateSchema from '@openinherit/schema/v3/schema.json';
import catalogueSchema from '@openinherit/schema/v3/catalogue.json';Use with Ajv (JSON Schema validation)#
import Ajv from 'ajv/dist/2020';
import estateSchema from '@openinherit/schema/v3/schema.json';
const ajv = new Ajv();
const validate = ajv.compile(estateSchema);
const valid = validate(document);
if (!valid) {
console.log(validate.errors);
}Schema structure#
The v3 schemas define the full INHERIT data model:
Core entities#
| Schema | Description |
|---|---|
schema.json |
Root estate document schema |
catalogue.json |
Asset catalogue schema |
person.json |
People (testators, beneficiaries, executors) |
asset.json |
Financial and physical assets |
property.json |
Real estate and land |
trust.json |
Trust structures |
bequest.json |
Bequests and gifts |
executor.json |
Executor appointments |
guardian.json |
Guardian appointments |
wish.json |
Non-binding wishes |
Supporting entities#
| Schema | Description |
|---|---|
document.json |
Attached documents (wills, codicils, deeds) |
relationship.json |
Relationships between people |
liability.json |
Debts and liabilities |
valuation.json |
Asset valuations |
nonprobate-transfer.json |
Transfers that bypass probate |
Jurisdiction extensions#
Extensions add jurisdiction-specific fields to the base schemas. The extensions registry lists all available extensions with their maturity level, legal tradition, and key features.
import registry from '@openinherit/schema/extensions-registry.json';
// List all extensions
for (const ext of registry.extensions) {
console.log(`${ext.name} (${ext.maturity}): ${ext.keyFeatures.join(', ')}`);
}API reference#
This package has no runtime API — it provides raw schema files. Use them with any JSON Schema Draft 2020-12 compliant validator:
- JavaScript/TypeScript: Ajv ↗
- Python: jsonschema ↗
- Go: santhosh-tekuri/jsonschema ↗
- Java: networknt/json-schema-validator ↗
- C#: JsonSchema.Net ↗
Examples#
Load reference data#
import jurisdictions from '@openinherit/schema/reference-data/jurisdictions.json';
for (const j of jurisdictions) {
console.log(`${j.code}: ${j.name}`);
}Access extension schemas#
import ukExt from '@openinherit/schema/v3/extensions/uk-england-wales/uk-england-wales.json';