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.
| Field | Type | Description |
|---|---|---|
minLength | integer | Minimum character count |
maxLength | integer | Maximum character count |
pattern | string | Regex pattern the value must match |
placeholder | string | UI hint |
enum | array | Restricts 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.
| Field | Type | Description |
|---|---|---|
minimum | integer | Minimum allowed value |
maximum | integer | Maximum allowed value |
placeholder | string | UI hint |
number
A floating-point number.
| Field | Type | Description |
|---|---|---|
minimum | number | Minimum allowed value |
maximum | number | Maximum allowed value |
decimals | integer | Number of decimal places |
placeholder | string | UI hint |
boolean
A true/false value. No extra fields.
date
An ISO 8601 date-time string.
| Field | Type | Description |
|---|---|---|
minimum | ISO 8601 | Earliest allowed date |
maximum | ISO 8601 | Latest allowed date |
placeholder | string | UI 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.
| Field | Type | Required | Description |
|---|---|---|---|
properties | object | Yes | Map of property names to nested schema nodes |
required | array of strings | No | Property 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.
| Field | Type | Required | Description |
|---|---|---|---|
items | schema node | Yes | Schema applied to each item |
minItems | integer | No | Minimum number of items |
maxItems | integer | No | Maximum number of items |
{
"kind": "array",
"label": "Tags",
"items": { "kind": "string", "label": "Tag" },
"maxItems": 20
}
ref
A reference to a Custom Object entry.
| Field | Type | Required | Description |
|---|---|---|---|
ref | string | Yes | Target object type in namespace/slug format |
{
"kind": "ref",
"label": "Manufacturer",
"ref": "myapp/manufacturer"
}
ref nodes are only valid in Custom Field Definition schemas. They are not allowed in Custom Object definition schemas.
Field summary
| Field | Type | Applies to |
|---|---|---|
kind | string | All |
label | string | All |
description | string | All |
placeholder | string | string, integer, number, date, color |
minLength / maxLength | integer | string |
pattern | string | string |
enum | array | string |
minimum / maximum | number or ISO 8601 | integer, number, date |
decimals | integer | number |
properties | object | object |
required | array of strings | object |
items | schema node | array |
minItems / maxItems | integer | array |
ref | string | ref |