defineSchema
Registers a JSON Schema in the dynamic-ontology registry to attach validation for custom entity-kind properties or new event types.
Instructions
Register a JSON Schema document in the dynamic-ontology schema registry. Use this to attach validation schemas for custom entity-kind properties (schemaKind=entityKind:vehicle) or to define schemas for new event types. Inputs: schemaKind (bare camelCase or colon-namespaced, e.g. entityKind:deal), version (semver vX.Y.Z), definition (JSON Schema object). Core schema kinds (entity, episode, etc.) are protected and return E_VALIDATION. The schema is immediately usable for property validation via ValidateEntityProperties. Returns E_VALIDATION if the definition is not a JSON object or if schemaKind is a protected core kind.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preview | No | When true, compute and return a plan (supersede or register) WITHOUT appending any event. Use this to inspect impact before committing. Default false. | |
| version | Yes | Semver version, e.g. v0.1.0. Higher versions replace lower ones; same version with a different definition is a conflict. | |
| definition | Yes | JSON Schema document (Draft 2020-12) to register. Must be a JSON object. | |
| schemaKind | Yes | Lookup key for the schema, e.g. entityKind:vehicle or myCustomEvent. Bare camelCase or colon-namespaced. No spaces. Core kinds (entityKindRegistered, schemaRegistered, predicateRegistered, entity, episode, etc.) cannot be overwritten. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | Present only when preview=true. Describes what the call would do. | |
| status | Yes | registered = schema written to the event log; preview = plan computed without writing any event (preview=true was set). | |
| version | Yes | The registered schema version. | |
| warnings | No | Non-fatal advisory warnings. MAZ-SCHEMA-001 = supersede; MAZ-SCHEMA-002 = orphaned fields. | |
| schemaKind | Yes | The registered schema kind identifier. |