Class metadata (classes/metadata)
Description of class fields and options for the class editor: type, allowed values, default value, editor tab and section, applicability by storage mode, and a condition on another field. Default and allowed values match the class validations on save.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
Getting metadata
Returns an object:
-
storage_modes— storage modes; -
data_types— property data types; -
fields— class fields and options (keyopts.*is an option); -
property_fields— property attributes.
Field: key is the field path, type is the editor type (string, text, boolean, integer, enum, class, storage, property, properties, filter, object), caption is the label (English), tab and section are the editor tab and section, storage_modes are the storage modes for which the field applies, values and values_by_mode are allowed values, default, min, max, max_bytes are the text limit in bytes (UTF-8), required and required_storage_modes are requiredness (for the specified modes), data_types are property types for property selection, storage_types and storage_types_by_mode are storage types for instance selection, when is a condition: the field applies if the value of the key field is in in (not in not_in); if storage_modes is set in the condition, it applies only for those modes.
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"storage_modes": ["category", "history", "transactionlog", "ram", "runtime", "ets", "abstract"],
"fields": [
{"key": "opts.cache_sec", "tab": "options", "section": "cache", "type": "integer", "caption": "Cache time, s",
"storage_modes": ["category", "history", "transactionlog"], "min": 5, "max": 86400, "default": 600,
"when": {"key": "cache_mode", "in": ["temp"]}}
],
"property_fields": [ … ]
}