JSON Forms Reference
This reference covers everything Prismatic's configuration wizard supports for JSON Forms. Use it when you already know what JSON Forms is and you need exhaustive details on schema features, UI schema elements, renderers, or the options you can pass.
If you're new to JSON Forms, start with What are JSON Forms? and work through Using JSON Forms before diving in here.
Prismatic adds a set of custom renderers, layouts, and options on top of what JSON Forms ships by default. Everything in this reference reflects what's available in the Prismatic configuration wizard, which may differ from stock JSON Forms.
How to read this reference
JSON Forms drives a form from two JSON documents you author:
- Schema - a JSON Schema that describes the data your form collects.
- UI schema - a JSON document that describes how the schema is rendered - layouts, labels, visibility, and per-control behavior.
Three reference pages break the UI schema down further:
- Renderers - how each schema type maps to an input control, and which controls Prismatic customizes.
- Rules - the
ruleblock you attach to any UI schema element to show, hide, enable, or disable it based on form data. - Options - an alphabetized catalog of every
optionskey you can set on a UI schema element.
JSON Schema in Prismatic
Prismatic uses the standard JSON Schema vocabulary, and the schema reference walks through the keywords you're most likely to reach for:
- Supported types and nested objects - the core building blocks of a form.
- Formats -
date,time,date-time,password,email,uri, andipv4. - Validation keywords -
required,minLength,pattern,minimum, and the rest. - Default values and pre-filling the form - how to open a form with values already populated.
- Dropdowns with
enumandoneOf- static and third-party populated lists. - Arrays and
$ref- repeating items and shared subschemas. - Composing schemas with
allOf,anyOf,oneOf, andnot- pulling properties in through composition keywords. - Conditional validation with
if/then/else- varying validation rules based on form data.
A handful of keywords behave differently in Prismatic than they do in the JSON Schema specification - see Keywords Prismatic handles differently.