Overview
Multi-view editor for authoring JSON Schema documents with form, raw JSON, and diff modes plus undo history and validation.
Usage
State ownership
Pass schema with onValueChangeRequest when the parent owns the current schema. Every committed edit asks the parent to update its value, and a later schema value from the parent becomes authoritative. The handler may return the accepted or replacement schema, including through a promise, to settle a request without changing the prop—for example, when rejecting it with the same current schema. While a request is pending, a later commit is restored to the authoritative parent schema instead of creating a second request. Use the optional onSchemaChange callback to observe changes the parent accepts. Supplying schema without onValueChangeRequest preserves the previous locally managed behavior: it is an initial value, not a controlled contract.
Pass defaultSchema when the editor should own changes after initialization. Omitting both starts with an empty JSON Schema. Do not pass schema and defaultSchema together.
Guidance
Use When
- Letting users edit a JSON Schema with a guided form alongside the raw source.
- Reviewing schema changes against a baseline via the built-in diff view.
Avoid When
- Editing arbitrary free-form JSON with no schema semantics — use a plain code editor instead.
Type
Properties
Property key | Type | Description | Actions |
|---|---|---|---|
| string | |||
| integer | |||
| string |
When to use
- Letting users edit a JSON Schema with a guided form alongside the raw source.
- Reviewing schema changes against a baseline via the built-in diff view.
- Editing arbitrary free-form JSON with no schema semantics — use a plain code editor instead.
Examples
Basic JSON Schema editor
Edit a flat object schema with form, JSON, and diff views.
Composition (oneOf)
A schema using oneOf alongside type — both render as separate sections.
Invalid initial schema
When the input cannot be parsed, the form is disabled and the JSON view is the entry point.
Props
Name | Type | Default | Description |
|---|---|---|---|
view bindable | 'form' | 'json' | 'diff' | 'form' | Active view: form / json / diff. Bindable. |