xeipuuv/gojsonschema

invalid character '{{character}}' looking for beginning of value

EmilyGraceSeville7cf opened this issue · 0 comments

Can somebody help me understand what does it mean? How to show what line error is on in JSON schema?

Go code:

package main

import (
	"fmt"

	"github.com/xeipuuv/gojsonschema"
)

func main() {
	schemaLoader := gojsonschema.NewReferenceLoader("file:///home/emilygraceseville7cf/Documents/open-source/csharp/csharp-glazewm/schemas/schema.json")
	documentLoader := gojsonschema.NewReferenceLoader("file:///home/emilygraceseville7cf/Documents/open-source/csharp/csharp-glazewm/GlazeWM.App/Resources/sample-config.yaml")

	result, err := gojsonschema.Validate(schemaLoader, documentLoader)
	if err != nil {
		panic(err.Error())
	}

	if result.Valid() {
		fmt.Printf("The document is valid\n")
	} else {
		fmt.Printf("The document is not valid. see errors :\n")
		for _, desc := range result.Errors() {
			fmt.Printf("- %s\n", desc)
		}
	}
}

Error:

panic: invalid character 'g' looking for beginning of value

goroutine 1 [running]:
main.main()
        /home/emilygraceseville7cf/Documents/open-source/go/main.go:15 +0x1d7
exit status 2

JSON schema:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "empty": {
      "pattern": "^\\s+$"
    },
    "invalid-shorthand-property": {
      "pattern": "^\\s+$|\\spx\\s|\\spx$|^px\\s$"
    },
    "command": {
      "description": "A command",
      "type": "string",
      "minLength": 1,
      "not": {
        "pattern": "^\\s+$|\\spx\\s|\\spx$|^px\\s"
      },
      "examples": [
        "focus left",
        "focus right",
        "focus up",
        "focus down",
        "focus workspace prev",
        "focus workspace next",
        "focus workspace recent",
        "move left",
        "move right",
        "move up",
        "move down",
        "move to workspace WORKSPACE_NAME",
        "resize HEIGHT WIDTH",
        "resize borders SHORTHAND_PROPERTY",
        "set floating",
        "set tiling",
        "set minimized",
        "set maximized",
        "toggle floating",
        "toggle maximized",
        "focus mode toggle",
        "tiling direction vertical",
        "tiling direction horizontal",
        "tiling direction toggle",
        "exit wm",
        "reload config",
        "close",
        "exec PROCESS_NAME",
        "ignore"
      ]
    },
    "binding": {
      "description": "A binding",
      "type": "string",
      "not": {
        "pattern": "^\\s+$"
      },
      "examples": ["Alt+H"]
    },
    "color": {
      "type": "string",
      "pattern": "^\\S+$",
      "examples": [
        "red",
        "orange",
        "yellow",
        "green",
        "cyan",
        "blue",
        "purple",
        "pink",
        "white",
        "black",
        "#000000",
        "#FF0000",
        "#00FF00",
        "#0000FF",
        "#FFFF00",
        "#FF00FF",
        "#FFFFFF"
      ]
    },
    "length": {
      "type": "string",
      "pattern": "^\\d+px$",
      "examples": ["20px"]
    },
    "padding-property": {
      "title": "padding",
      "type": "string",
      "minLength": 1,
      "not": {
        "$ref": "#/definitions/invalid-shorthand-property"
      },
      "default": "0"
    },
    "opacity-property": {
      "title": "opacity",
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "default": 1
    },
    "background-property": {
      "title": "background",
      "$ref": "#/definitions/color",
      "default": "#101010"
    },
    "foreground-property": {
      "title": "foreground",
      "$ref": "#/definitions/color",
      "default": "white"
    },
    "font-family-property": {
      "title": "font family",
      "type": "string",
      "minLength": 1,
      "pattern": "^\\S+(\\s+\\S+)*$",
      "default": "Segoe UI"
    },
    "font-size-property": {
      "title": "font size",
      "$ref": "#/definitions/length",
      "default": "13px"
    },
    "font-weight-property": {
      "title": "font weight",
      "type": "integer",
      "minimum": 0,
      "default": 400,
      "examples": ["100", "950"]
    },
    "border-width-property": {
      "title": "border width",
      "type": "string",
      "minLength": 1,
      "not": {
        "$ref": "#/definitions/invalid-shorthand-property"
      },
      "default": "0"
    },
    "border-color-property": {
      "title": "border color",
      "$ref": "#/definitions/color",
      "default": "blue"
    },
    "component.type-property": {
      "title": "type",
      "description": "A type of the component",
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "examples": [
        "clock",
        "battery",
        "cpu",
        "gpu",
        "network",
        "volume",
        "text file",
        "weather",
        "image",
        "system tray",
        "music"
      ]
    },
    "component.margin-property": {
      "title": "margin",
      "description": "A margin of the component",
      "type": "string",
      "minLength": 1,
      "not": {
        "$ref": "#/definitions/invalid-shorthand-property"
      },
      "default": "0 10px 0 0"
    },
    "component.padding-property": {
      "description": "A padding of the component",
      "$ref": "#/definitions/padding-property"
    },
    "component.opacity-property": {
      "description": "An opacity of the component",
      "$ref": "#/definitions/opacity-property"
    },
    "component.background-property": {
      "description": "A background of the component",
      "$ref": "#/definitions/background-property"
    },
    "component.foreground-property": {
      "description": "A foreground of the component",
      "$ref": "#/definitions/foreground-property"
    },
    "component.font-family-property": {
      "description": "A font family of the component",
      "$ref": "#/definitions/font-family-property"
    },
    "component.font-size-property": {
      "description": "A font size of the component",
      "$ref": "#/definitions/font-size-property"
    },
    "component.font-weight-property": {
      "description": "A font weight of the component",
      "$ref": "#/definitions/font-weight-property"
    },
    "component.border-width-property": {
      "description": "A border width of the component",
      "$ref": "#/definitions/border-width-property"
    },
    "component.border-color-property": {
      "description": "A border color of the component",
      "$ref": "#/definitions/border-color-property"
    },
    "components": {
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "description": "Component settings",
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/definitions/component.type-property"
          },
          "margin": {
            "$ref": "#/definitions/component.margin-property"
          },
          "padding": {
            "$ref": "#/definitions/component.padding-property"
          },
          "opacity": {
            "$ref": "#/definitions/component.opacity-property"
          },
          "background": {
            "$ref": "#/definitions/component.background-property"
          },
          "foreground": {
            "$ref": "#/definitions/component.foreground-property"
          },
          "font_family": {
            "$ref": "#/definitions/component.font-family-property"
          },
          "font_size": {
            "$ref": "#/definitions/component.font-size-property"
          },
          "font_weight": {
            "$ref": "#/definitions/component.font-weight-property"
          },
          "border_width": {
            "$ref": "#/definitions/component.border-width-property"
          },
          "border_color": {
            "$ref": "#/definitions/component.border-color-property"
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "const": "clock"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "time_formatting": {
                  "title": "time formatting",
                  "description": "A time formatting of the 'Clock' component",
                  "type": "string",
                  "examples": ["hh:mm tt  ddd MMM d"]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "battery"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label_draining": {
                  "title": "label draining",
                  "description": "A draining label of the 'Battery' component",
                  "type": "string",
                  "examples": ["{battery_level}% remaining"]
                },
                "label_power_saver": {
                  "title": "label power saver",
                  "description": "A power saver label of the 'Battery' component",
                  "type": "string",
                  "examples": ["{battery_level}% (power saver)"]
                },
                "label_charging": {
                  "title": "label charging",
                  "description": "A charging label of the 'Battery' component",
                  "type": "string",
                  "examples": ["{battery_level}% (charging)"]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "cpu"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label": {
                  "title": "label",
                  "description": "A label for the 'CPU Usage' component",
                  "type": "string",
                  "examples": ["CPU: {percent_usage}%"]
                },
                "refresh_interval_ms": {
                  "title": "refresh interval ms",
                  "description": "A refresh interval for the 'CPU Usage' component",
                  "type": "integer",
                  "minimum": 0,
                  "examples": [1000]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "gpu"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label": {
                  "title": "label",
                  "description": "A label for the 'GPU Usage' component",
                  "type": "string",
                  "examples": ["GPU: {percent_usage}%"]
                },
                "refresh_interval_ms": {
                  "title": "refresh interval ms",
                  "description": "A refresh interval for the 'GPU Usage' component",
                  "type": "integer",
                  "minimum": 0,
                  "examples": [1000]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "memory"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label": {
                  "title": "label",
                  "description": "A label for the 'Memory Usage' component",
                  "type": "string",
                  "examples": ["RAM: {percent_usage}%"]
                },
                "refresh_interval_ms": {
                  "title": "refresh interval ms",
                  "description": "A refresh interval for the 'Memory Usage' component",
                  "type": "integer",
                  "minimum": 0,
                  "examples": [1000]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "network"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label_no_internet": {
                  "title": "label no internet",
                  "description": "A label for the 'Network' component",
                  "type": "string",
                  "examples": ["NC"]
                },
                "label_ethernet": {
                  "title": "label ethernet",
                  "description": "An ethernet label for the 'Network' component",
                  "type": "string",
                  "examples": ["Eth"]
                },
                "label_wifi_strength_0": {
                  "title": "label wifi strength 0",
                  "description": "A 0% strength WiFi label for the 'Network' component",
                  "type": "string",
                  "examples": ["WiFi: 0%"]
                },
                "label_wifi_strength_25": {
                  "title": "label wifi strength 25",
                  "description": "A 25% strength WiFi label for the 'Network' component",
                  "type": "string",
                  "examples": ["WiFi: 25%"]
                },
                "label_wifi_strength_50": {
                  "title": "label wifi strength 50",
                  "description": "A 50% strength WiFi label for the 'Network' component",
                  "type": "string",
                  "examples": ["WiFi: 50%"]
                },
                "label_wifi_strength_75": {
                  "title": "label wifi strength 75",
                  "description": "A 75% strength WiFi label for the 'Network' component",
                  "type": "string",
                  "examples": ["WiFi: 75%"]
                },
                "label_wifi_strength_100": {
                  "title": "label wifi strength 100",
                  "description": "A 100% strength WiFi label for the 'Network' component",
                  "type": "string",
                  "examples": ["WiFi: 100%"]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "volume"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label_low": {
                  "title": "label low",
                  "description": "A low volume label for the 'Volume' component",
                  "type": "string",
                  "examples": ["🔊{volume_level}%"]
                },
                "label_medium": {
                  "title": "label medium",
                  "description": "A medium volume label for the 'Volume' component",
                  "type": "string",
                  "examples": ["🔊{volume_level}%"]
                },
                "label_high": {
                  "title": "label high",
                  "description": "A high volume label for the 'Volume' component",
                  "type": "string",
                  "examples": ["🔊{volume_level}%"]
                },
                "label_mute": {
                  "title": "label mute",
                  "description": "A no volume label for the 'Volume' component",
                  "type": "string",
                  "examples": ["🔊{volume_level}%"]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "text file"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "file_path": {
                  "title": "file path",
                  "description": "A file path for the 'Text File' component",
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "weather"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "latitude": {
                  "title": "latitude",
                  "description": "A latitude for the 'Weather' component",
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "longitude": {
                  "title": "longitude",
                  "description": "A longitude for the 'Weather' component",
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                },
                "label": {
                  "title": "label",
                  "description": "A label for the 'Weather' component",
                  "type": "string",
                  "examples": ["{temperature_celsius}°C"]
                },
                "label_sun": {
                  "title": "label sun",
                  "description": "A sun label for the 'Weather' component",
                  "type": "string",
                  "examples": ["☀️ {temperature_celsius}°C"]
                },
                "label_moon": {
                  "title": "label moon",
                  "description": "A moon label for the 'Weather' component",
                  "type": "string",
                  "examples": ["🌙 {temperature_celsius}°C"]
                },
                "label_cloud_moon": {
                  "title": "label cloud moon",
                  "description": "A cloud moon label for the 'Weather' component",
                  "type": "string",
                  "examples": ["🌙☁️ {temperature_celsius}°C"]
                },
                "label_cloud_sun": {
                  "title": "label cloud sun",
                  "description": "A cloud sun label for the 'Weather' component",
                  "type": "string",
                  "examples": ["⛅ {temperature_celsius}°C"]
                },
                "label_cloud_moon_rain": {
                  "title": "label cloud moon rain",
                  "description": "A cloud moon rain label for the 'Weather' component",
                  "type": "string",
                  "examples": ["🌙🌧️ {temperature_celsius}°C"]
                },
                "label_cloud_sun_rain": {
                  "title": "label cloud sun rain",
                  "description": "A cloud sun rain label for the 'Weather' component",
                  "type": "string",
                  "examples": ["🌦️ {temperature_celsius}°C"]
                },
                "label_cloud_rain": {
                  "title": "label cloud rain",
                  "description": "A cloud rain label for the 'Weather' component",
                  "type": "string",
                  "examples": ["🌧️ {temperature_celsius}°C"]
                },
                "label_snow_flake": {
                  "title": "label snow flake",
                  "description": "A snow flake label for the 'Weather' component",
                  "type": "string",
                  "examples": ["❄️ {temperature_celsius}°C"]
                },
                "label_thunderstorm": {
                  "title": "label thunderstorm",
                  "description": "A thunderstorm label for the 'Weather' component",
                  "type": "string",
                  "examples": ["⚡ {temperature_celsius}°C"]
                },
                "label_cloud": {
                  "title": "label cloud",
                  "description": "A cloud label for the 'Weather' component",
                  "type": "string",
                  "examples": ["☁️ {temperature_celsius}°C"]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "image"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "source": {
                  "title": "source",
                  "description": "A source path for the 'Image' component",
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "system tray"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label_expand_text": {
                  "title": "label expand text",
                  "description": "An expand label for the 'System Tray' component",
                  "type": "string",
                  "examples": ["<"]
                },
                "label_collapse_text": {
                  "title": "label collapse text",
                  "description": "An collapse label for the 'System Tray' component",
                  "type": "string",
                  "examples": [">"]
                }
              },
              "additionalProperties": false
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "music"
                }
              }
            },
            "then": {
              "properties": {
                "type": {
                  "$ref": "#/definitions/component.type-property"
                },
                "margin": {
                  "$ref": "#/definitions/component.margin-property"
                },
                "padding": {
                  "$ref": "#/definitions/component.padding-property"
                },
                "opacity": {
                  "$ref": "#/definitions/component.opacity-property"
                },
                "background": {
                  "$ref": "#/definitions/component.background-property"
                },
                "foreground": {
                  "$ref": "#/definitions/component.foreground-property"
                },
                "font_family": {
                  "$ref": "#/definitions/component.font-family-property"
                },
                "font_size": {
                  "$ref": "#/definitions/component.font-size-property"
                },
                "font_weight": {
                  "$ref": "#/definitions/component.font-weight-property"
                },
                "border_width": {
                  "$ref": "#/definitions/component.border-width-property"
                },
                "border_color": {
                  "$ref": "#/definitions/component.border-color-property"
                },
                "label_not_playing": {
                  "title": "label not playing",
                  "description": "A not playing label for the 'Music' component",
                  "type": "string"
                },
                "label_paused": {
                  "title": "label paused",
                  "description": "A paused label for the 'Music' component",
                  "type": "string",
                  "examples": ["{song_title} - {artist_name}"]
                },
                "label_playing": {
                  "title": "label playing",
                  "description": "A playing label for the 'Music' component",
                  "type": "string",
                  "examples": ["{song_title} - {artist_name}"]
                },
                "max_title_length": {
                  "title": "max title length",
                  "description": "A maximum title length for the 'Music' component",
                  "type": "integer",
                  "minimum": 0,
                  "examples": [20]
                },
                "max_artist_length": {
                  "title": "max artist length",
                  "description": "A maximum artist length for the 'Music' component",
                  "type": "integer",
                  "minimum": 0,
                  "examples": [20]
                }
              },
              "additionalProperties": false
            }
          }
        ]
      }
    }
  },
  "title": "GlazeWM settings",
  "description": "GlazeWM settings",
  "type": "object",
  "properties": {
    "general": {
      "title": "general",
      "description": "General settings",
      "type": "object",
      "properties": {
        "focus_follows_cursor": {
          "title": "focus follows cursor",
          "description": "Whether to automatically focus windows underneath the cursor",
          "type": "boolean",
          "default": false
        },
        "cursor_follows_focus": {
          "title": "cursor follows focus",
          "description": "Whether to jump the cursor between windows focused by the WM",
          "type": "boolean",
          "default": false
        },
        "toggle_workspace_on_refocus": {
          "title": "toggle workspace on refocus",
          "description": "Whether to switch back and forth between the previously focused workspace when focusing the current workspace",
          "type": "boolean",
          "default": true
        },
        "show_floating_on_top": {
          "title": "show floating on top",
          "description": "Whether to show floating windows as always on top",
          "type": "boolean",
          "default": false
        },
        "floating_window_move_amount": {
          "title": "floating window move amount",
          "description": "An amount to move floating windows by",
          "type": "string",
          "minLength": 2,
          "pattern": "^\\d+%$",
          "default": "5%"
        },
        "center_new_floating_windows": {
          "title": "center new floating windows",
          "description": "Whether to center new floating windows",
          "type": "boolean",
          "default": true
        },
        "window_animations": {
          "title": "window animations",
          "description": "Whether to enable window transition animations",
          "oneOf": [
            {
              "type": "boolean"
            },
            { "type": "string", "const": "unchanged" }
          ],
          "default": "unchanged"
        }
      },
      "additionalProperties": false
    },
    "keybindings": {
      "title": "keybindings",
      "description": "Keybindings",
      "type": "array",
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "description": "A keybinding",
        "type": "object",
        "oneOf": [
          {
            "properties": {
              "binding": {
                "title": "binding",
                "$ref": "#/definitions/binding"
              },
              "command": {
                "title": "command",
                "$ref": "#/definitions/command"
              }
            },
            "additionalProperties": false
          },
          {
            "properties": {
              "binding": {
                "title": "binding",
                "$ref": "#/definitions/binding"
              },
              "commands": {
                "title": "commands",
                "type": "array",
                "uniqueItems": true,
                "minItems": 2,
                "items": {
                  "$ref": "#/definitions/command"
                }
              }
            },
            "additionalProperties": false
          },
          {
            "properties": {
              "bindings": {
                "title": "bindings",
                "type": "array",
                "uniqueItems": true,
                "minItems": 2,
                "items": {
                  "$ref": "#/definitions/binding"
                }
              },
              "command": {
                "title": "command",
                "$ref": "#/definitions/command"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "additionalProperties": false
    },
    "focus_borders": {
      "title": "focus borders",
      "description": "Focus settings",
      "type": "object",
      "properties": {
        "active": {
          "title": "active",
          "description": "An active border",
          "type": "object",
          "properties": {
            "enabled": {
              "title": "enabled",
              "description": "Whether to enable the active border",
              "type": "boolean",
              "default": true
            },
            "color": {
              "title": "color",
              "description": "A color of the active border",
              "$ref": "#/definitions/color"
            }
          },
          "additionalProperties": false
        },
        "inactive": {
          "title": "inactive",
          "description": "An inactive border",
          "type": "object",
          "properties": {
            "enabled": {
              "title": "enabled",
              "description": "Whether to enable the inactive border",
              "type": "boolean",
              "default": false
            },
            "color": {
              "title": "color",
              "description": "A color of the active border",
              "$ref": "#/definitions/color"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "gaps": {
      "title": "gaps",
      "description": "Gap settings",
      "type": "object",
      "properties": {
        "inner_gap": {
          "title": "inner gap",
          "description": "An inner gap",
          "type": "string",
          "minLength": 1,
          "not": {
            "$ref": "#/definitions/invalid-shorthand-property"
          },
          "default": "20px"
        },
        "outer_gap": {
          "title": "outer gap",
          "description": "An outer gap",
          "type": "string",
          "minLength": 1,
          "not": {
            "$ref": "#/definitions/invalid-shorthand-property"
          },
          "default": "20px"
        }
      },
      "additionalProperties": false
    },
    "workspaces": {
      "title": "workspaces",
      "description": "Workspace settings",
      "type": "array",
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "description": "A workspace setting",
        "type": "object",
        "properties": {
          "name": {
            "title": "name",
            "description": "A unique name of the workspace",
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "examples": ["1"]
          },
          "display_name": {
            "title": "display name",
            "description": "A display name of the workspace",
            "type": "string",
            "minLength": 1,
            "pattern": "\\S",
            "examples": ["1"]
          },
          "bind_to_monitor": {
            "title": "bind to monitor",
            "description": "Whether to bind the workspace to a specific monitor",
            "type": "boolean"
          },
          "keep_alive": {
            "title": "keep alive",
            "description": "Whether not to destroy the workspace when it's empty",
            "type": "boolean",
            "default": false
          }
        },
        "additionalProperties": false
      }
    },
    "bar": {
      "title": "bar",
      "description": "Bar settings",
      "type": "object",
      "properties": {
        "enabled": {
          "title": "title",
          "description": "Whether to enable the bar",
          "type": "boolean",
          "default": true
        },
        "height": {
          "title": "height",
          "description": "A height of the bar",
          "$ref": "#/definitions/length",
          "default": "30px"
        },
        "position": {
          "title": "position",
          "description": "A position of the bar",
          "type": "string",
          "enum": ["top", "bottom"],
          "default": "top"
        },
        "always_on_top": {
          "title": "always on top",
          "description": "Whether to keep the bar above other windows",
          "type": "boolean",
          "default": false
        },
        "opacity": {
          "description": "An opacity of the bar",
          "$ref": "#/definitions/opacity-property"
        },
        "background": {
          "description": "A background of the bar",
          "$ref": "#/definitions/background-property"
        },
        "foreground": {
          "description": "A foreground of the bar",
          "$ref": "#/definitions/foreground-property"
        },
        "font_family": {
          "description": "A font family of the bar",
          "$ref": "#/definitions/font-family-property"
        },
        "font_size": {
          "description": "A font size of the bar",
          "$ref": "#/definitions/font-size-property"
        },
        "font_weight": {
          "description": "A font weight of the bar",
          "$ref": "#/definitions/font-weight-property"
        },
        "border_width": {
          "description": "A border width of the bar",
          "$ref": "#/definitions/border-width-property"
        },
        "border_color": {
          "description": "A border color of the bar",
          "$ref": "#/definitions/border-color-property"
        },
        "padding": {
          "title": "padding",
          "description": "A padding of the bar",
          "type": "string",
          "minLength": 1,
          "not": {
            "$ref": "#/definitions/invalid-shorthand-property"
          },
          "default": "4px 6px 4px 6px"
        },
        "offset_x": {
          "title": "offset x",
          "description": "A horizontal offset of the bar",
          "type": "integer",
          "default": 0
        },
        "offset_y": {
          "title": "offset y",
          "description": "A vertical offset of the bar",
          "type": "integer",
          "default": 0
        },
        "border_radius": {
          "title": "border radius",
          "description": "A border radius of the bar",
          "type": "integer",
          "default": 0
        },
        "components_left": {
          "title": "components left",
          "description": "Left component settings",
          "$ref": "#/definitions/components"
        },
        "components_center": {
          "title": "components center",
          "description": "Center component settings",
          "$ref": "#/definitions/components"
        },
        "components_right": {
          "title": "components right",
          "description": "Right component settings",
          "$ref": "#/definitions/components"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": true
}

Sample JSON file:

general:
  # Whether to automatically focus windows underneath the cursor.
  focus_follows_cursor: false

  # Whether to jump the cursor between windows focused by the WM.
  cursor_follows_focus: false

  # Whether to switch back and forth between the previously focused workspace
  # when focusing the current workspace.
  toggle_workspace_on_refocus: true

  # Whether to show floating windows as always on top.
  show_floating_on_top: false

  # Amount to move floating windows by (eg. when using `alt+<hjkl>` on a floating window)
  floating_window_move_amount: "5%"

  # Whether to center new floating windows.
  center_new_floating_windows: true

  # *Strongly* recommended to set to 'false'. Whether to globally enable/disable
  # window transition animations (on minimize, close, etc). Set to 'unchanged'
  # to make no setting changes.
  window_animations: unchanged



gaps:
  # Gap between adjacent windows.
  inner_gap: "20px"

  # Gap between windows and the screen edge.
  outer_gap: "20px 20px 20px"

# Highlight active/inactive windows with a colored border.
# ** Exclusive to Windows 11 due to API limitations.
focus_borders:
  active:
    enabled: false
    color: "#0f00ff"

  inactive:
    enabled: false
    color: "#ff0000"

bar:
  height: "30px"
  position: "top"
  opacity: 1.0
  background: "#20242cc4"
  foreground: "f"
  font_family: "SegoeUI"
  font_size: "13px"
  font_weight: 400
  border_width: "0"
  padding: "4px 6px 4px 6px"
  offset_x: 0
  offset_y: 0
  border_radius: 0
  components_left:
    - type: music
      
  components_center:
    - type: "window title"
  components_right:
    - type: "system tray"
    - type: "tiling direction"
      label_horizontal: "⮂"
      label_vertical: "⮁"
      background: "#ffffff33"
      margin: "0 4px"
      padding: "0 8px"
    - type: "binding mode"
      background: "#ffffff33"
      margin: "0 4px 0 0"
      padding: "0 8px"
    - type: "clock"
      # Documentation on formatting date/time string:
      # https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
      time_formatting: "hh:mm tt  ddd MMM d"

workspaces:
  - name: "a"
  - name: "2"
  - name: "3"
  - name: "4"
  - name: "5"
  - name: "6"
  - name: "7"
  - name: "8"
  - name: "9"

window_rules:
  # Task Manager requires admin privileges to manage and should be ignored unless running
  # the WM as admin.
  - command: "ignore"
    match_process_name: "/Taskmgr|ScreenClippingHost/"

  # Launches system dialogs as floating by default (eg. File Explorer save/open dialog).
  - command: "set floating"
    match_class_name: "#32770"

  # Do not manage picture-in-picture windows for browsers. Note that the default is for
  # English; change `match_title` to the window's title if you use another language.
  - command: "ignore"
    match_title: "[Pp]icture.in.[Pp]icture"
    match_class_name: "Chrome_WidgetWin_1|MozillaDialogClass"

  # Some applications (eg. Steam) have borders that extend past the normal border size.
  - command: "resize borders 0px -7px -7px -7px"
    match_process_name: "steam"

binding_modes:
  - name: "resize"
    keybindings:
      # Resize focused window by a percentage or pixel amount.
      - command: "resize width -2%"
        bindings: ["H", "Left"]
      - command: "resize width +2%"
        bindings: ["L", "Right"]
      - command: "resize height +2%"
        bindings: ["K", "Up"]
      - command: "resize height -2%"
        bindings: ["J", "Down"]
      # Press enter/escape to return to default keybindings.
      - command: "binding mode none"
        bindings: ["Escape", "Enter"]

keybindings:
  # Shift focus in a given direction.
  - command: down
    bindings: ["Alt+H", "Alt+Left"]
  - command: "focus right"
    bindings: ["Alt+L", "Alt+Right"]
  - command: "focus up"
    bindings: ["Alt+K", "Alt+Up"]
  - command: "focus down"
    bindings: ["Alt+J", "Alt+Down"]

  # Move focused window in a given direction.
  - command: "move left"
    bindings: ["Alt+Shift+H", "Alt+Shift+Left"]
  - command: "move right"
    bindings: ["Alt+Shift+L", "Alt+Shift+Right"]
  - command: "move up"
    bindings: ["Alt+Shift+K", "Alt+Shift+Up"]
  - command: "move down"
    bindings: ["Alt+Shift+J", "Alt+Shift+Down"]

  # Resize focused window by a percentage or pixel amount.
  - command: "resize width -2%"
    binding: "Alt+U"
  - command: "resize width +2%"
    binding: "Alt+P"
  - command: "resize height +2%"
    binding: "Alt+O"
  - command: "resize height -2%"
    binding: "Alt+I"

  # As an alternative to the resize keybindings above, resize mode enables resizing via
  # HJKL or arrow keys. The binding mode is defined above with the name "resize".
  - command: "binding mode resize"
    binding: "Alt+R"

  # Change tiling direction. This determines where new tiling windows will be inserted.
  - command: "tiling direction toggle"
    binding: "Alt+V"

  # Change focus between floating / tiling windows.
  - command: "focus mode toggle"
    binding: "Alt+Space"

  # Change the focused window to be floating / tiling.
  - command: "toggle floating"
    binding: "Alt+Shift+Space"

  # Change the focused window to be maximized / unmaximized.
  - command: "toggle maximized"
    binding: "Alt+X"

  # Minimize focused window.
  - command: "set minimized"
    binding: "Alt+M"

  # Close focused window.
  - command: "close"
    binding: "Alt+Shift+Q"

  # Kill GlazeWM process safely.
  - command: "exit wm"
    binding: "Alt+Shift+E"

  # Re-evaluate configuration file.
  - command: "reload config"
    binding: "Alt+Shift+R"

  # Launch CMD terminal (alternatively `exec wt` or `exec %ProgramFiles%/Git/git-bash.exe`
  # to start Windows Terminal and Git Bash respectively.
  - command: "exec cmd"
    binding: "Alt+Enter"

  # Focus the workspace that last had focus.
  - command: "focus workspace recent"
    binding: "Alt+Y"

  # Focus the next/previous workspace defined in `workspaces` config.
  - command: "focus workspace next"
    binding: "Alt+T"
  - command: "focus workspace prev"
    binding: "Alt+Shift+T"

  # Change focus to a workspace defined in `workspaces` config.
  - command: "focus workspace 1"
    binding: "Alt+1"
  - command: "focus workspace 2"
    binding: "Alt+2"
  - command: "focus workspace 3"
    binding: "Alt+3"
  - command: "focus workspace 4"
    binding: "Alt+4"
  - command: "focus workspace 5"
    binding: "Alt+5"
  - command: "focus workspace 6"
    binding: "Alt+6"
  - command: "focus workspace 7"
    binding: "Alt+7"
  - command: "focus workspace 8"
    binding: "Alt+8"
  - command: "focus workspace "
    binding: "Alt+9"

  # Move focused workspace to a monitor in a given direction.
  - command: "move workspace left"
    binding: "Alt+A"
  - command: "move workspace right"
    binding: "Alt+F"
  - command: "move workspace up"
    binding: "Alt+D"
  - command: "move workspace down"
    binding: "Alt+S"

  # Move focused window to a workspace defined in `workspaces` config.
  - commands: ["move to workspace 1", "focus workspace 1"]
    binding: "Alt+Shift+1"
  - commands: ["move to workspace 2", "focus workspace 2"]
    binding: "Alt+Shift+2"
  - commands: ["move to workspace 3", "focus workspace 3"]
    binding: "Alt+Shift+3"
  - commands: ["move to workspace 4", "focus workspace 4"]
    binding: "Alt+Shift+4"
  - commands: ["move to workspace 5", "focus workspace 5"]
    binding: "Alt+Shift+5"
  - commands: ["move to workspace 6", "focus workspace 6"]
    binding: "Alt+Shift+6"
  - commands: ["move to workspace 7", "focus workspace 7"]
    binding: "Alt+Shift+7"
  - commands: ["move to workspace 8", "focus workspace 8"]
    binding: "Alt+Shift+8"
  - commands: ["move to workspace 9", "focus workspace 9"]
    binding: "Alt+Shift+9"