Skip to main content

Schema Reference

The schema is a JSON Schema document that describes the shape of the data your form collects. JSON Forms uses the schema both to pick an appropriate renderer for each property and to validate what customers enter.

This page lists the schema features you can rely on in Prismatic. For the full JSON Schema specification, see json-schema.org.

Top-level shape

A JSON Forms schema is almost always an object with a properties map:

Schema shape
{
"type": "object",
"properties": {
"companyName": { "type": "string" },
"numEmployees": { "type": "integer" }
},
"required": ["companyName"]
}

The top-level type can also be "array" when the entire form collects a list of items.

Supported types

typeDefault rendererNotes
stringText inputSee formats for date, time, password, and so on
integerNumber inputWhole numbers only
numberNumber inputDecimal numbers
booleanCheckboxSet options.toggle on the UI schema element to render as a switch
objectNested groupTypically used to compose form sections
arrayTable layoutArray of objects; Prismatic defaults to a table layout

See the renderers reference for a complete type-to-renderer mapping.

Formats

Set format on a string property to pick a specialized renderer, a validator, or both.

Prismatic supports these formats:

date

Renderer: Date picker

Accepted values: ISO 8601 date strings in YYYY-MM-DD form, such as 2026-04-21.

Use with formatMinimum and formatMaximum to constrain the selectable range.

time

Renderer: Time picker

Accepted values: ISO 8601 time strings in HH:mm:ss form, such as 14:30:00. Fractional seconds (HH:mm:ss.sss) and an optional timezone suffix (Z or ±HH:mm) are also accepted.

date-time

Renderer: Date-and-time picker

Accepted values: Full ISO 8601 timestamps combining a date and time with a T separator and a timezone suffix, such as 2026-04-21T14:30:00Z.

password

Renderer: Masked text input

Accepted values: Any string. This format affects presentation only - it does not validate content.

email

Renderer: Text input

Accepted values: A standard email address in local-part@domain form, such as alex@example.com.

uri

Renderer: Text input

Accepted values: An absolute URI that includes a scheme, such as https://example.com/widgets/42. Relative URIs are rejected.

ipv4

Renderer: Text input

Accepted values: Four dot-separated integers from 0 to 255, such as 192.0.2.1.

Example

Date and password formats
{
"type": "object",
"properties": {
"startDate": { "type": "string", "format": "date" },
"apiKey": { "type": "string", "format": "password" }
}
}

Validation keywords

Prismatic validates user input against the standard JSON Schema validation keywords. The following are the ones you'll use most often:

KeywordApplies toDescription
requiredobjectArray of property names that must be present
minLength / maxLengthstringMinimum and maximum string length
patternstringRegular expression the input must match
minimum / maximuminteger, numberNumeric bounds
exclusiveMinimum / exclusiveMaximuminteger, numberExclusive numeric bounds
multipleOfinteger, numberValue must be a multiple of this number
formatMinimum / formatMaximumstring with formatInclusive bounds for date, time, and date-time formats
formatExclusiveMinimum / formatExclusiveMaximumstring with formatExclusive bounds for date, time, and date-time formats
minItems / maxItemsarrayBounds on the number of items
uniqueItemsarrayWhen true, all items must be unique

Validation runs continuously as the customer types. You can change when errors display with the Validation Mode setting on the config variable - see Validation mode.

For validation that the schema alone can't express, see JSON Form Validation.

Two schema patterns produce dropdown menus:

  • enum - a flat array of string values. The customer sees the same value that the config variable stores.
  • oneOf - an array of { "title": ..., "const": ... } objects. The customer sees the title; the config variable stores the const.
enum
{
"continent": {
"type": "string",
"enum": ["North America", "Europe", "Asia"]
}
}
oneOf with custom values
{
"continent": {
"type": "string",
"oneOf": [
{ "title": "North America", "const": "NA" },
{ "title": "Europe", "const": "EU" },
{ "title": "Asia", "const": "AS" }
]
}
}

Use oneOf whenever the display label and stored value need to differ, or when you're populating the list from a third-party API and want to store a stable ID.

Add options.autocomplete: true to the UI schema element to render a oneOf dropdown as a type-ahead.

Arrays

Arrays let the customer add one or more items with the same structure:

Array of objects
{
"type": "array",
"items": {
"type": "object",
"properties": {
"channel": { "type": "string" },
"notification": { "type": "string", "enum": ["Created", "Updated"] }
},
"required": ["channel", "notification"]
}
}

By default, arrays render as a table. Use options.layout to switch to an accordion instead, or use the ListWithDetail UI type for a master-detail layout.

minItems, maxItems, and uniqueItems apply to the array itself. Validation keywords on items apply to each array entry.

References with $ref

Prismatic resolves every $ref in your schema before rendering the form. This lets you reuse subschemas without worrying about whether a specific renderer resolves references on its own.

Schema with a shared subschema
{
"type": "object",
"definitions": {
"address": {
"type": "object",
"properties": {
"street": { "type": "string" },
"city": { "type": "string" }
},
"required": ["street", "city"]
}
},
"properties": {
"billing": { "$ref": "#/definitions/address" },
"shipping": { "$ref": "#/definitions/address" }
}
}

Descriptions and titles

Both description and title on a property surface in the UI:

  • description appears as helper text beneath the input.
  • title overrides the auto-generated label (otherwise derived from the property name).

The UI schema's label takes precedence over the schema's title when both are set. Descriptions show even when the input is not focused unless you set options.showUnfocusedDescription: false.

Required fields

Mark required fields in the parent object's required array, not on the field itself:

required
{
"type": "object",
"properties": {
"companyName": { "type": "string" },
"companyDescription": { "type": "string" }
},
"required": ["companyName"]
}

Required fields display an asterisk next to their label. Set options.hideRequiredAsterisk: true on a control or layout to suppress the asterisk for that element.

Unsupported schema features

A few JSON Schema features don't have first-class renderer support:

  • allOf, anyOf - these validate correctly but JSON Forms does not merge their shape into the generated UI. Flatten the resulting shape into the parent object if you need controls for their properties.
  • if / then / else - use UI rules instead for conditional display.
  • $id and $schema - Prismatic ignores these; it dereferences with the schema document you provide.