Skip to main content
Version: Unstable

Custom Object Schema DSL

The schema DSL is a JSON format used to describe the structure of values in Custom Field Definitions (object and object[] types) and Custom Object definitions.

Every schema node requires a kind field that determines its type. All nodes also accept label and description.

Kinds​

string​

A free-form or constrained text value.

FieldTypeDescription
minLengthintegerMinimum character count
maxLengthintegerMaximum character count
patternstringRegex pattern the value must match
placeholderstringUI hint
enumarrayRestricts the value to a predefined set — see below

When enum is provided, each item must be an object with value (string) and label (string).

{
"kind": "string",
"label": "Status",
"enum": [
{ "value": "active", "label": "Active" },
{ "value": "inactive", "label": "Inactive" }
]
}

integer​

A whole number.

FieldTypeDescription
minimumintegerMinimum allowed value
maximumintegerMaximum allowed value
placeholderstringUI hint

number​

A floating-point number.

FieldTypeDescription
minimumnumberMinimum allowed value
maximumnumberMaximum allowed value
decimalsintegerNumber of decimal places
placeholderstringUI hint

boolean​

A true/false value. No extra fields.


date​

An ISO 8601 date-time string.

FieldTypeDescription
minimumISO 8601Earliest allowed date
maximumISO 8601Latest allowed date
placeholderstringUI hint

color​

A hex color code (#RRGGBB or #RRGGBBAA). No extra fields beyond placeholder.


media​

A reference to a media library asset. No extra fields.


file​

A file attachment. Stored values must include url, mimeType, size, and filename. No extra schema fields.


object​

A structured object with named properties.

FieldTypeRequiredDescription
propertiesobjectYesMap of property names to nested schema nodes
requiredarray of stringsNoProperty names that must be present in stored values
{
"kind": "object",
"label": "Dimensions",
"properties": {
"width": { "kind": "number", "label": "Width", "decimals": 2 },
"height": { "kind": "number", "label": "Height", "decimals": 2 },
"unit": { "kind": "string", "label": "Unit", "enum": [{ "value": "cm", "label": "cm" }, { "value": "in", "label": "in" }] }
},
"required": ["width", "height"]
}

array​

A list of items that all share the same schema.

FieldTypeRequiredDescription
itemsschema nodeYesSchema applied to each item
minItemsintegerNoMinimum number of items
maxItemsintegerNoMaximum number of items
{
"kind": "array",
"label": "Tags",
"items": { "kind": "string", "label": "Tag" },
"maxItems": 20
}

ref​

A reference to a Custom Object entry.

FieldTypeRequiredDescription
refstringYesTarget object type in namespace/slug format
{
"kind": "ref",
"label": "Manufacturer",
"ref": "myapp/manufacturer"
}
note

ref nodes are only valid in Custom Field Definition schemas. They are not allowed in Custom Object definition schemas.


Field summary​

FieldTypeApplies to
kindstringAll
labelstringAll
descriptionstringAll
placeholderstringstring, integer, number, date, color
minLength / maxLengthintegerstring
patternstringstring
enumarraystring
minimum / maximumnumber or ISO 8601integer, number, date
decimalsintegernumber
propertiesobjectobject
requiredarray of stringsobject
itemsschema nodearray
minItems / maxItemsintegerarray
refstringref