JSON Object
JSON Objects define structured data schemas with properties, validation rules, and default values. Use them to enforce structure on JSON fields that use the Jsonb input type.
Go to Interface → JSON Object in the top navigation.
JSON object list
The list displays all JSON Objects in your project:
| Column | Description |
|---|---|
| Name | Identifier for the JSON Object |
| Project | The project this JSON Object belongs to |
| Status | Active or Disabled |
| Action | Edit or Delete the JSON Object |
Creating a JSON object
- Go to the Interface section.
- Click the JSON Object tab.
- Click + Add JSON Object.
General settings
- Name — The name of the JSON Object (for example,
UserProfile). - Columns — Layout columns (for example, 1 Column).
- Description — Optional description of the object.
- Status — Turn on to enable, turn off to disable.
Schema properties
In the Properties section, define the fields that make up your JSON Object.
Adding properties
Click + Add Property to add a new field. For each property, you can set:
- Name — The property key.
- Type — The data type (String, Number, Boolean, Date, Object, Array, Select, Entity).
- Columns — Width of the field in the UI.
- Optional — Turn on to make the field optional; turn off to require it.
Importing JSON
Create a schema by importing existing JSON data or a JSON Schema:
- Click Import JSON.
- Paste your sample JSON or JSON Schema into the text area.
- Click Import.
Supported features:
- Inference of types from sample data
- Support for arrays and nested objects
- Auto-detection of formats like email, URL, UUID, and date-time
Property types and validation
Depending on the selected Type, specific validation rules are available.
String
- Default Value — Set a static value or fill in from a logged-in user's session field.
- Min Length — Minimum character count.
- Max Length — Maximum character count.
- Pattern (Regex) — Regular expression for custom validation.
- Format — Pre-defined formats: Email, URL, UUID, or Date-Time.
Number
- Default Value — Set a static number or fill in from session.
- Min Value — Minimum numeric value.
- Max Value — Maximum numeric value.
- Integer — Restrict to whole numbers.
- Positive — Restrict to positive numbers.
- Negative — Restrict to negative numbers.
Date
- Default Value — Set a static date or fill in from session.
- Min Date — Earliest allowed date.
- Max Date — Latest allowed date.
Select
- Data Object — Select a predefined Data Object to source options from.
Entity
- Reference — Select a reference collection (for example, Audit Logs, Users).
Array
- Item Type — Type of items in the array (for example, String, Select, Entity).
- Min Items — Minimum number of items.
- Max Items — Maximum number of items.
- Unique Items — Ensure no duplicate items.
Default value configuration
For properties that support default values:
- Auth Collection — Select an auth collection to fill in data from the logged-in user.
- Session Field — Choose the specific field from the session (only available if Auth Collection is selected).
- Static Value — Enter a fixed default value (if no Auth Collection is selected).
- Visible — Turn on to show the field in the form; turn off to hide it.
Related
- JSON Field — Apply a JSON Object schema to a field
- Data Object — Reusable option sets for dropdown fields