Basic Syntax

The JSON Schema is basically a JSON object. An empty JSON object, like { }, means that your App does not provide any configuration options.

If you want to provide configuration options, then the “schema” key is required. 

The “schema” key provides all the details for your configuration options, as well as validations and titles. 

If you want to present your configuration options in a specific order, then you also need to specify the “fields” key and include all configuration options as defined in the “schema” in the order you need to present them.

Here is a quick example, based on our Simple Clock tutorial:

schema.json
{
  "fields": [
    "clock_font_size",
    "use_seconds"
  ],
  "schema": {
    "clock_font_size": {
      "editorAttrs": {
        "max": 999,
        "min": 1,
        "step": 1
      },
      "title": "Clock Font Size",
      "type": "Number",
      "validators": [
        "required",
        "number"
      ]
    },
    "use_seconds": {
      "title": "Use Seconds",
      "type": "Checkbox"
    }
  }
}