The value of schema decides which UI is generated and which value is written to policies.json.
A boolean policy does not need additional options.
{
"availability": { "mainstream": "60.0", "esr": "60.0" },
"tags": ["privacy"],
"schema": "boolean"
}When enabled, it outputs true by default.
{
"policies": {
"DisableTelemetry": true
}
}With inverse: true, enabling the policy outputs false.
enum creates a select field.
{
"schema": "enum",
"options": [
{
"label": "enum_value_yes",
"value": true
},
{
"label": "enum_value_no",
"value": false
}
]
}Instead of defining options directly, a preset can be used.
{
"schema": "enum",
"preset": "boolean_optional"
}Important properties:
options: list of visible optionspreset: name of an entry frompresetsdefault: preselected valuesort_options: sorts options by translated label
An option value of null means that no output is generated.
string creates an input field or a textarea.
{
"schema": "string",
"placeholder": "common_url",
"validations": ["required", "url"]
}Important properties:
name: property name in the generated objectlabel: visible label above the fieldplaceholder: placeholder and accessible name if no label existstextarea: creates a multiline inputvalidations: enables validationsregex: additional pattern checkallow_empty_value: allows empty outputoutput_filter: transforms the output value
object groups multiple properties.
{
"schema": "object",
"properties": [
{
"name": "Enabled",
"schema": "enum",
"preset": "boolean_optional"
}
]
}Objects only generate output if at least one child option generates a value.
Important properties:
name: property name in the parent objectlabel: heading shown before the objectproperties: child optionslockable: adds an option to writeLocked: truekey: creates a dynamic or fixed object key
array creates repeatable entries.
{
"schema": "array",
"items": {
"schema": "string",
"placeholder": "common_url",
"validations": ["url"]
}
}Arrays can contain strings, booleans, objects, nested arrays, or enums.
Important properties:
items: describes the array itemlabel: visible headingjoin: outputs a string array as a joined stringallow_empty_value: allows an empty output valueadditions: adds fixed sections before or after the normal entries
heading is only allowed inside object.properties. It creates a visible section heading but does not generate output.
{
"schema": "heading",
"label": "policy_description_Example_heading"
}heading does not need a name.
Previous: Policy metadata
Next: Objects and arrays