Schema Options

Options in schemas are always prefixed with x- (e.g. x-assertFormat) to not collide with future JSON schema spec keywords.

x-addPropertyContent

Type: string

Text content for "add property" buttons.

{
  "type": "object",
  "x-addPropertyContent": "Add field",
  "additionalProperties": { "type": "string" }
}

x-arrayAdd

  • Type: boolean
  • Default: true

If array "add" buttons should be displayed.

{
  "type": "array",
  "x-arrayAdd": false,
  "items": { "type": "string" }
}

x-arrayAddContent

Type: string

Text content for array "add" buttons.

{
  "type": "array",
  "x-arrayAddContent": "Add item",
  "items": { "type": "string" }
}

x-arrayButtonsPosition

  • Type: string
  • Default: 'left'
  • Options: 'left', 'right'

Controls the positioning of action buttons (delete, move, drag) in table format arrays. When set to 'right', buttons appear on the right side of the table. When set to 'left' (default), buttons appear on the left side.

{
  "type": "array",
  "x-format": "table",
  "x-arrayButtonsPosition": "right",
  "items": {
    "type": "string"
  }
}

x-arrayDelete

  • Type: boolean
  • Default: true

If array "delete" buttons should be displayed.

{
  "type": "array",
  "x-arrayDelete": false,
  "items": { "type": "string" }
}

x-arrayDeleteAll

  • Type: boolean
  • Default: false

Adds a "Delete all items" button to the array editor's header actions area.

{
  "type": "array",
  "x-arrayDeleteAll": true,
  "items": { "type": "string" }
}

x-arrayDeleteAllContent

Type: string

Text content for the "delete all" button.

{
  "type": "array",
  "x-arrayDeleteAll": true,
  "x-arrayDeleteAllContent": "Remove all",
  "items": { "type": "string" }
}

x-arrayDeleteConfirm

Type: boolean

Per-schema override for showing a confirmation dialog before deleting array items. Overrides the global arrayDeleteConfirm option.

{
  "type": "array",
  "x-arrayDeleteConfirm": true,
  "items": { "type": "string" }
}

x-arrayDeleteContent

Type: string

Text content for array "delete" buttons.

{
  "type": "array",
  "x-arrayDeleteContent": "Remove",
  "items": { "type": "string" }
}

x-arrayDragContent

Type: string

Text content for array "drag" buttons.

{
  "type": "array",
  "x-sortable": true,
  "x-arrayDragContent": "Drag to reorder",
  "items": { "type": "string" }
}

x-arrayFooterAdd

  • Type: boolean
  • Default: false

Adds an "Add item" button in the footer of the array editor.

{
  "type": "array",
  "x-arrayFooterAdd": true,
  "items": { "type": "string" }
}

x-arrayFooterAddContent

Type: string

Text content for the footer "add" button.

{
  "type": "array",
  "x-arrayFooterAdd": true,
  "x-arrayFooterAddContent": "Add item",
  "items": { "type": "string" }
}

x-arrayFooterButtonsPosition

  • Type: string
  • Default: 'right'
  • Options: 'left', 'right'

Controls the alignment of footer buttons. When 'right', buttons are pushed to the right side of the footer. When 'left', buttons align to the left.

{
  "type": "array",
  "x-arrayFooterAdd": true,
  "x-arrayFooterButtonsPosition": "left",
  "items": { "type": "string" }
}

x-arrayFooterDeleteAll

  • Type: boolean
  • Default: false

Adds a "Delete all items" button in the footer of the array editor.

{
  "type": "array",
  "x-arrayFooterDeleteAll": true,
  "items": { "type": "string" }
}

x-arrayFooterDeleteAllContent

Type: string

Text content for the footer "delete all" button.

{
  "type": "array",
  "x-arrayFooterDeleteAll": true,
  "x-arrayFooterDeleteAllContent": "Remove all",
  "items": { "type": "string" }
}

x-arrayMove

  • Type: boolean
  • Default: true

If array "move up" and "move down" buttons should be displayed.

{
  "type": "array",
  "x-arrayMove": false,
  "items": { "type": "string" }
}

x-arrayMoveDownContent

Type: string

Text content for array "move down" buttons.

{
  "type": "array",
  "x-arrayMoveDownContent": "Move down",
  "items": { "type": "string" }
}

x-arrayMoveUpContent

Type: string

Text content for array "move up" buttons.

{
  "type": "array",
  "x-arrayMoveUpContent": "Move up",
  "items": { "type": "string" }
}

x-assertFormat

  • Type: boolean
  • Default: false

Treats "format" as a validator rather than just an annotation.

{
  "type": "string",
  "format": "email",
  "x-assertFormat": true
}

x-buttons

Type: array

Adds schema-defined action buttons to any editor, without them becoming part of the data model. Works on every editor type, including container editors (object/array). Each button config accepts:

  • label - The button's HTML content (sanitized before rendering, so it can carry an icon)
  • event.name - Clicking the button emits jedison:<name> on the root Jedison instance, with a payload of { jedison, editor, path }
  • attributes - An object of HTML attributes for the button element, filtered against an allowlist (id, class, title, name, value, disabled, aria-*, data-*, plus always-enabled/always-disabled to override the field's own disabled state)

Subscribe to the event the same way as any other event:

jedison.on('jedison:detectCity', ({ jedison, editor, path }) => {})
{
  "type": "string",
  "title": "City",
  "x-buttons": [
    {
      "label": "Detect city",
      "event": { "name": "detectCity" },
      "attributes": { "class": "my-custom-button" }
    }
  ]
}

x-collapseToggleContent

Type: string

Text content for "collapse" buttons.

{
  "type": "object",
  "x-enableCollapseToggle": true,
  "x-collapseToggleContent": "Toggle",
  "properties": {
    "name": { "type": "string" }
  }
}

x-categoryOrder

Type: string[]

Controls the display order of tabs in categories-format object editors (categories-vertical, categories-horizontal). Categories listed in the array appear first in the specified order; any categories not listed follow in their natural order.

{
  "type": "object",
  "x-format": "categories-vertical",
  "x-categoryOrder": ["contact", "profile"],
  "properties": {
    "profile": { "type": "object", "properties": { "name": { "type": "string" } } },
    "contact": { "type": "object", "properties": { "email": { "type": "string" } } }
  }
}

x-containerAttributes

Type: object

Editors container HTML attributes can be set using this option. Attributes such as class or data-* will be applied to the container element.

{
  "type": "object",
  "x-containerAttributes": {
    "class": "my-editor",
    "data-id": "user-form"
  }
}

x-deactivateNonRequired

Type: boolean

Whether the editor should deactivate (hide) or activate (show) non required properties. Works only with object type editors.

{
  "type": "object",
  "x-deactivateNonRequired": true,
  "required": ["name"],
  "properties": {
    "name": { "type": "string" },
    "nickname": { "type": "string" }
  }
}

x-discriminator

Type: string | object

When set on a oneOf or anyOf schema, determines the active sub-schema by validating the specified property against each schema option. Accepts either a property name string or an object with a propertyName key.

Falls back to the standard error-counting algorithm if no discriminator match is found.

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "type": { "type": "string", "const": "cat" },
        "name": { "type": "string" }
      }
    },
    {
      "type": "object",
      "properties": {
        "type": { "type": "string", "const": "dog" },
        "breed": { "type": "string" }
      }
    }
  ],
  "x-discriminator": "type"
}

x-editJsonData

  • Type: boolean
  • Default: false

Enables inline JSON editing mode for this specific schema, allowing users to directly edit the JSON data within form fields.

{
  "x-editJsonData": true,
  "type": "object",
  "title": "Edit JSON Data",
  "description": "This object has 'x-editJsonData: true' which enables inline JSON editing.",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name"
    },
    "description": {
      "type": "string",
      "title": "Description"
    }
  }
}

x-enableCollapseToggle

Type: boolean

Display a collapse button used to collapse or expand editors that support collapse like object and arrays.

{
  "type": "object",
  "x-enableCollapseToggle": true,
  "properties": {
    "name": { "type": "string" }
  }
}

x-enforceConst

  • Type: boolean
  • Default: true

Value will remain whatever is defined in schema "const".

{
  "type": "string",
  "const": "active",
  "x-enforceConst": false
}

x-enforceEnum

  • Type: boolean
  • Default: true

Whether the editor initial value will be the first item in the "enum".

{
  "type": "string",
  "enum": ["draft", "published"],
  "x-enforceEnum": false
}

x-enumTitles

Type: string[]

Used to display user-friendly labels in the editor instead of those listed in "enum".

{
  "type": "string",
  "enum": ["us", "gb", "de"],
  "x-enumTitles": ["United States", "United Kingdom", "Germany"]
}

x-filepond

Type: object

Configuration object passed directly to the FilePond instance. Used with "x-format": "filepond".

{
  "type": "string",
  "x-format": "filepond",
  "x-filepond": {
    "acceptedFileTypes": ["image/*"]
  }
}

x-format

Type: string

Determines which editor UI will be used to edit the json instance.

{
  "type": "string",
  "x-format": "textarea"
}

x-grid

Type: object

A configuration object to determine the position of the property editor in the parent's grid.

Options:

  • columns: How many columns should the editor occupy. The number of columns can vary between css frameworks and their configuration.
  • offset: How many columns should the editor be offsetted
  • newRow: Whether the editor should be put in a new row
{
  "type": "object",
  "x-format": "grid",
  "properties": {
    "firstName": {
      "type": "string",
      "x-grid": { "columns": 6 }
    },
    "lastName": {
      "type": "string",
      "x-grid": { "columns": 6 }
    }
  }
}

x-hidden

Type: boolean

Editors can be hidden using this option. When set to true, the editor is hidden.

{
  "type": "object",
  "properties": {
    "internalId": {
      "type": "string",
      "x-hidden": true
    },
    "name": {
      "type": "string"
    }
  }
}

x-info

Type: object

Used to display extra information.

Options:

  • variant: "modal"
  • title: Plain text or markdown
  • content: Plain text or markdown
{
  "type": "string",
  "x-info": {
    "variant": "modal",
    "title": "Help",
    "content": "Enter your full legal name."
  }
}

x-inputAttributes

Type: object

Used to set attributes for the editor input if it has one.

{
  "type": "string",
  "x-inputAttributes": {
    "placeholder": "Enter your name",
    "autocomplete": "name"
  }
}

x-messages

Type: object | string[]

Validation error messages can be customized using this option in the schema. The option can be used in different ways:

Array format

Pass messages as an array of strings:

{
  "type": "string",
  "minLength": 5,
  "x-messages": [
    "5 chars please."
  ]
}

Object format with validation keywords

Pass messages as an object with validation keywords as keys:

{
  "type": "string",
  "minLength": 5,
  "const": "locoloco",
  "x-messages": {
    "minLength": "Need at least 5 sparks of brilliance.",
    "const": "Only 'locoloco' unlocks the magic here."
  }
}

Internationalization format

Pass messages with language codes for internationalization support:

{
  "type": "string",
  "minLength": 5,
  "const": "locoloco",
  "x-messages": {
    "en": {
      "minLength": "Need at least 5 sparks of brilliance.",
      "const": "Only 'locoloco' unlocks the magic here."
    }
  }
}

x-objectAdd

  • Type: boolean
  • Default: true

Per-schema override for showing or hiding the "Add property" button on object editors. Overrides the global objectAdd option.

{
  "type": "object",
  "x-objectAdd": false,
  "additionalProperties": { "type": "string" }
}

x-navWarning

  • Type: boolean
  • Default: true

When enabled, displays a warning icon (⚠) in the legend of array and object editors when they contain nested validation errors. Set to false to disable.

x-navWarningMessage

Type: string

Custom tooltip message displayed on the legend warning icon. Requires x-navWarning to be active.

{
  "type": "object",
  "x-navWarning": true,
  "x-navWarningMessage": "This section has validation errors",
  "properties": {
    "email": {
      "type": "string",
      "format": "email"
    }
  }
}

x-propertiesToggleContent

Type: string

Text content for "properties" buttons.

{
  "type": "object",
  "x-propertiesToggleContent": "Fields",
  "properties": {
    "name": { "type": "string" },
    "nickname": { "type": "string" }
  }
}

x-propGroup

Type: string

Assigns a property to a named group in the properties activation dialog. Used together with enablePropertiesToggle and x-propGroupOrder.

{
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "x-propGroup": "identity"
    },
    "lastName": {
      "type": "string",
      "x-propGroup": "identity"
    },
    "email": {
      "type": "string",
      "x-propGroup": "contact"
    }
  }
}

x-propGroupOrder

Type: string[]

Defines the display order of property groups in the properties activation dialog. Groups are defined using x-propGroup on individual properties. Groups not included in the array are appended at the end; the default group (properties without x-propGroup) always appears first.

{
  "type": "object",
  "x-propGroupOrder": ["personal", "contact"],
  "properties": {
    "name": { "type": "string", "x-propGroup": "personal" },
    "age": { "type": "number", "x-propGroup": "personal" },
    "email": { "type": "string", "x-propGroup": "contact" }
  }
}

x-showErrors

  • Type: string
  • Default: "change"
  • Options: "never", "change", "input", "always"

Determines when to display validation errors for this specific schema. Overrides the instance-level showErrors setting.

Note: The "input" option provides real-time validation as the user types, but only affects text-based inputs (string inputs, textareas, number inputs).

{
  "type": "string",
  "x-showErrors": "always"
}

x-sortable

  • Type: boolean
  • Default: false

Items can be sorted via drag and drop if Sortable.js is available.

{
  "type": "array",
  "x-sortable": true,
  "items": {
    "type": "string"
  }
}

x-startCollapsed

Type: boolean

Whether the editor should start expanded or collapsed. Works on editors that support collapse like object and arrays.

{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "advanced": {
      "type": "object",
      "x-startCollapsed": true,
      "properties": {
        "timeout": { "type": "integer" }
      }
    }
  }
}

x-subErrors

Type: boolean

Per-schema override for including sub-error details in validation errors. Overrides the global subErrors option.

{
  "type": "object",
  "x-subErrors": false,
  "properties": {
    "email": { "type": "string", "format": "email" }
  }
}

x-switcherInput

  • Type: string
  • Default: 'select'
  • Options: 'select', 'radios', 'radios-inline', 'modal', 'select-inline'

Per-schema override for the input type used to switch between multiple editor schemas (anyOf, oneOf, type arrays). Overrides the global switcherInput option.

{
  "x-switcherInput": "radios-inline",
  "oneOf": [
    { "type": "string", "title": "Text" },
    { "type": "number", "title": "Number" }
  ]
}

x-switcherTitle

  • Type: string
  • Default: property name or "title"

The text displayed in the multiple editor switcher to select this sub-schema editor.

{
  "oneOf": [
    {
      "type": "string",
      "x-switcherTitle": "Text"
    },
    {
      "type": "number",
      "x-switcherTitle": "Number"
    }
  ]
}

x-titleHidden

  • Type: boolean
  • Default: false

Hides the editor title.

x-titleIconClass

Type: string

Icon class to use in titles if using any.

{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email address",
      "x-titleIconClass": "bi bi-envelope"
    },
    "internalNote": {
      "type": "string",
      "title": "Internal note",
      "x-titleHidden": true
    }
  }
}

x-titleTemplate

Type: string

A template to form titles dynamically, using the same {{ placeholder }} syntax described on the Templates page. Currently only read by nav-format array editors, to title each item from its own value.

{
  "type": "array",
  "x-format": "nav-vertical",
  "items": {
    "type": "object",
    "x-titleTemplate": "{{ value.name || 'New contact' }}",
    "properties": {
      "name": { "type": "string" }
    }
  }
}

x-useConstraintAttributes

Type: boolean

Per-schema override for applying native HTML constraint attributes based on JSON Schema keywords. Overrides the global useConstraintAttributes option.

  • Number inputs: min, max
  • Number range: min, max
  • String inputs: minlength, maxlength, pattern
  • Textarea: minlength, maxlength
{
  "type": "string",
  "minLength": 3,
  "maxLength": 10,
  "x-useConstraintAttributes": false
}