Configuration Schema
This json schema is a general-purpose mechanism for describing SMC-compliant json configuration.
Field: type
Required | String
All schemas require a type field.
| The value is not constrained to a particular enum, but the enumerated values below are explicitly supported. If the type is not explicitly supported then the value will be displayed as prettified json. |
{
"type": "object" | "dict" | "list" | "collection" | "string" | "int" | "float" | "boolean" | "ip" | "port" | "iso8601" | "timestamp" | "password"
}
Complex Types
Complex types represent values which are either json objects or json arrays.
| Type | Description |
|---|---|
|
A json object with known fields. See the Schema: |
|
A json object with arbitrary keys. See the Schema: |
|
A json array with a determinate order. See the Schema: |
|
A json array with an indeterminate order. See the Schema: |
Simple Types
Simple types represent values which are json primitives - strings, numbers, booleans.
|
A generic string |
|
|
|
An integer |
|
|
|
A float |
|
|
|
A boolean |
|
|
|
An internet ip |
|
|
|
A tcp port - i.e. an integer between 0-65535 |
|
|
|
An iso8601/RFC3339 compliant date-time representation |
|
As a human-readable date and time |
|
A unix tiemstamp. This will display in a human-readable format |
|
As a human-readable date and time |
|
A password string |
|
Asterisks |
Field: hidden
Optional | Boolean
If true, this value will not be displayed. If the value is a complex object then the entire json subtree will be hidden.
Field: editable
Optional | Boolean
Whether the value is editable.
object types are inherently uneditable in themselves, as their keys and associated values are pre-defined by the schema.
|
Field: default
Optional | JSON
Sets a default value if the value is 'empty' (i.e. missing).
9/11/20 Zero-length strings and null are inconsistently treated as 'empty' values.
|
Field: sort
Optional | Integer | Default = 0
Provides a sorting hint for display. Primarily used for schemas within a parent object schema, to establish which fields should present first.
Higher values appear first. Negative values are allowed and, by virtue, of the default being 0 are moved to the bottom.
Fields with the same sort value are ordered by the case-insensitive field’s key.
Field: unit
Optional | String
Appends the given string as a suffix to the value.
e.g.
| Schema | Value | Display |
|---|---|---|
|
|
|
| Only applicable to simple types |
Schema: dict
A json object with arbitrary keys and all values conforming to the same schema.
This is most useful for defining key-pairs where the value is itself a simple type.
Schema: list and collection
list is an ordered array of values. collection is an unordered array of values.
Field: items
Required | Schema
Specifies the schema for the values.
e.g.
| Schema | Value |
|---|---|
|
|
Field: item_label
Optional | String
This only applies when the items are a complex type. It uses lodash.get() dot-notation to reference the location of the label in the value object.