Field Types

Every field has a type. The type determines what kind of value the field accepts and how it appears in the certificate form. You can change a field's type later with the type switcher. The video on the Schema Builder page shows the switcher in use.

Available Types

TypeUse it for
TextPlain text values.
NumberNumeric values. Can be restricted to whole numbers.
DateA date, or a date and time.
ImageAn uploaded image or file.
ToggleAn on/off (true or false) value.
DropdownA single choice from a fixed list of options.
ListRepeated items, such as several test results. A new list already contains one item, shown as Items, which you configure in the tree.
GroupA set of related fields nested together.
All OfA value that must meet all of several sets of rules. See All Of and One Of.
One OfA value that must match exactly one of several variants. See All Of and One Of.
Field types and their settings

One more type appear in the builder but cannot be chosen from the type menu:

  • Reference: created when you link fields together. See Siblings.

Type Settings

All fields have a Title, a Description, and a Required setting. The settings below are specific to each type. For what each rule means, see Validation Rules. The end of the video on the Schema Builder page shows the options of a Dropdown field.

TypeSettings
TextFixed Value, Minimum/Maximum Length, Format (Email, URI, UUID, Hostname, IPv4, IPv6), Pattern (regex), Placeholder
NumberAllow only whole numbers, Fixed Value, Minimum / Exclusive Minimum / Maximum / Exclusive Maximum, Multiple Of, Placeholder
DateDate Format ("Date only" or "Date and time"), Fixed Value, Placeholder
ImageImage Type (PNG, JPEG, WebP)
ToggleAllowed Values (Any / Must be true / Must be false), Fixed Value
DropdownOptions (the list of choices), Fixed Value
ListMin Items / Max Items
Group, All Of, One OfNone

All Of and One Of

All Of and One Of are advanced field types. Both are containers whose child fields you add in the tree.

  • All Of: the value must meet every child, called a branch, at the same time. Example: a part number that must start with a letter and be at most 10 characters. Each rule is a branch.
  • One Of: the value must match exactly one child, called a variant. Example: a contact that is either an email address or a phone number. The person filling out the certificate opens the variant that applies and fills in only that one.
One Of variants and All Of branches

A new All Of starts with one branch titled Schema 1, a new One Of with two variants titled Option 1 and Option 2. You can rename them, and each is configured like any other field.

Good to know:

  • Design One Of variants so that a value can match only one of them. A value that matches two or more variants fails validation.
  • Avoid conflicting rules across All Of branches. If one branch requires a minimum of 10 and another a maximum of 5, no value can pass. The builder warns about conflicting ranges where it can.
  • anyOf is not available from the type menu.

In JSON Schema

All Of and One Of map directly to allOf and oneOf.

The part number example:

{
  "type": "object",
  "properties": {
    "partNumber": {
      "title": "Part Number",
      "allOf": [
        { "type": "string", "pattern": "^[A-Za-z]" },
        { "type": "string", "maxLength": 10 }
      ]
    }
  }
}

The contact example:

{
  "type": "object",
  "properties": {
    "contact": {
      "title": "Contact",
      "oneOf": [
        { "title": "Email", "type": "string", "format": "email" },
        { "title": "Phone", "type": "string", "pattern": "^\\+?[0-9 ]+$" }
      ]
    }
  }
}

JSON Schema Structure

Field typeJSON Schema
Text"type": "string"
Number"type": "number", or "type": "integer" for whole numbers
Date"type": "string" with "format": "date" or "format": "date-time"
Toggle"type": "boolean"
Dropdown"type": "string" with an enum of options
List"type": "array"
Group"type": "object"
All Of / One OfallOf / oneOf

A group with a text field, a number field, and a dropdown:

{
  "type": "object",
  "properties": {
    "heatNumber": { "title": "Heat Number", "type": "string" },
    "thickness": { "title": "Thickness", "type": "number" },
    "grade": { "title": "Grade", "type": "string", "enum": ["S235", "S355"] }
  },
  "required": ["heatNumber"]
}