Properties in detail
The properties object lists the fields in the document/table, with the rules for editing, displaying and processing.. There are a large number of options as shown by the list below. But few of them are mandatory.
- Key The field name. A special key of $ref is a reference, discussed here.
- Type: Number/integer/string/boolean/object/array
- Integer is treated the same as 'number', but is validated on input to be an integer.
- A type of 'object' indicates that there are sub-fields below it in the structure. For example an attribute of 'address' may have 'street','city', 'zip' below it. These are listed in a properties sub-object.
- A type of 'array' indicates an array of scalars or objects. All elements in an array must be of the same type
- Stringify: If the type is object this is a field name or a function that will be used to characterise the object.
- Friendly name: Used on forms - defaults to the attribute name which is 'humanised' - so 'updatedBy' turns into 'Updated By'.
- Description: Used as a tool-tip in the edit form.
- Permission: permission set allowed to view/update this field
- Model: This field is a foreign key and specifies the name of a linked table . The field will contain a primary key value for the linked table. Do not indicate type as the type of the database keys is assumed.
- Values: The values that this field can take. Can be an array, code/value pairs or function. If the field is a foreign key, then the linked table can be filtered and used to provide values.
- Input: Specifies how ther column is updated by the edit form.
- Type: text, date, select, etc
- Placeholder: Shown in empty fields
- Required: true/false (or use the required array in the parent level)
- Width: over-rides standard width
- Format: column or row
- Input type specific parameters: these are included in the input tag.
- Display: how the data item is to be displayed
- Type: e.g. date, date time
- Table heading: heading in table list
- Truncate for table list: for the table list only the first few characters can be shown
- Process: special processing, date created, dateupdated etc.
- Database : database-specific type. e.g. bigint. This is optional.
- Validation items based on JSON Schema standards. Minimum, Maximum, etc,
Next The test data