{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "JSON Schema for Grafana 5.x Dashboards (https://grafana.com/docs/grafana/latest/reference/dashboard/#dashboard-json)",
  "id": "https://json.schemastore.org/grafana-dashboard-5.x.json",
  "properties": {
    "meta": {
      "type": "object",
      "properties": {
        "isStarred": {
          "type": "boolean"
        }
      }
    },
    "dashboard": {
      "type": "object",
      "properties": {
        "id": {
          "description": "unique numeric identifier for the dashboard. (generated by the db)",
          "type": ["number", "null"]
        },
        "uid": {
          "description": "unique dashboard identifier that can be generated by anyone. string (8-40)",
          "type": "string",
          "minLength": 8,
          "maxLength": 40
        },
        "title": {
          "description": "current title of dashboard",
          "type": "string"
        },
        "tags": {
          "description": "tags associated with dashboard, an array of strings",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "style": {
          "description": "theme of dashboard, i.e. dark or light",
          "type": "string"
        },
        "timezone": {
          "description": "timezone of dashboard, i.e. utc or browser",
          "type": "string"
        },
        "editable": {
          "description": "whether a dashboard is editable or not",
          "type": "boolean"
        },
        "hideControls": {
          "type": "boolean"
        },
        "graphTooltip": {
          "description": "0 for no shared crosshair or tooltip (default), 1 for shared crosshair, 2 for shared crosshair AND shared tooltip",
          "type": "number",
          "minimum": 0,
          "maximum": 2
        },
        "panels": {
          "description": "Panels are the building blocks of a dashboard. It consists of data source queries, type of graphs, aliases, etc. Panel JSON consists of an array of JSON objects, each representing a different panel. Most of the fields are common for all panels but some fields depend on the panel type.",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "gridPos": {
                "description": "The gridPos property describes the panel size and position in grid coordinates.",
                "type": "object",
                "properties": {
                  "x": {
                    "description": "The x position, in same unit as w.",
                    "type": "number"
                  },
                  "y": {
                    "description": "The y position, in same unit as h.",
                    "type": "number"
                  },
                  "w": {
                    "description": "1-24 (the width of the dashboard is divided into 24 columns)",
                    "type": "number",
                    "minimum": 1,
                    "maximum": 24
                  },
                  "h": {
                    "description": "In grid height units, each represents 30 pixels.",
                    "type": "number"
                  }
                }
              },
              "id": {
                "type": "number"
              },
              "mode": {
                "type": "string"
              },
              "content": {
                "type": "string"
              }
            }
          }
        },
        "time": {
          "description": "time range for dashboard, i.e. last 6 hours, last 7 days, etc"
        },
        "timepicker": {
          "description": "timepicker metadata",
          "type": "object",
          "properties": {
            "collapse": {
              "description": "whether timepicker is collapsed or not",
              "type": "boolean"
            },
            "enable": {
              "description": "whether timepicker is enabled or not",
              "type": "boolean"
            },
            "notice": {
              "type": "boolean"
            },
            "now": {
              "type": "boolean"
            },
            "refresh_intervals": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "status": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          }
        },
        "templating": {
          "description": "templating metadata",
          "type": "object",
          "properties": {
            "enable": {
              "description": "whether templating is enabled or not",
              "type": "boolean"
            },
            "list": {
              "description": "an array of objects each representing one template variable",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "allFormat": {
                    "description": "format to use while fetching all values from data source, eg: wildcard, glob, regex, pipe, etc.",
                    "type": "string"
                  },
                  "current": {
                    "description": "shows current selected variable text/value on the dashboard",
                    "type": "object",
                    "properties": {
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "text": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    }
                  },
                  "datasource": {
                    "description": "shows data source for the variables",
                    "type": ["string", "null"]
                  },
                  "includeAll": {
                    "description": "whether all value option is available or not",
                    "type": "boolean"
                  },
                  "multi": {
                    "description": "whether multiple values can be selected or not from variable value list",
                    "type": "boolean"
                  },
                  "multiFormat": {
                    "description": "format to use while fetching timeseries from data source",
                    "type": "string"
                  },
                  "name": {
                    "description": "name of variable",
                    "type": "string"
                  },
                  "options": {
                    "description": "array of variable text/value pairs available for selection on dashboard",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "selected": {
                          "type": "boolean"
                        },
                        "text": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "query": {
                    "description": "data source query used to fetch values for a variable",
                    "type": "string"
                  },
                  "refresh": {
                    "type": "boolean"
                  },
                  "regex": {
                    "type": "string"
                  },
                  "type": {
                    "description": "type of variable, i.e. custom, query or interval",
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "annotations": {
          "description": "annotations metadata"
        },
        "refresh": {
          "description": "auto-refresh interval"
        },
        "schemaVersion": {
          "description": "version of the JSON schema (integer), incremented each time a Grafana update brings changes to said schema",
          "type": "number"
        },
        "version": {
          "description": "version of the dashboard (integer), incremented each time the dashboard is updated",
          "type": "number",
          "minimum": 1
        },
        "links": {}
      }
    },
    "overwrite": {
      "type": "boolean"
    }
  },
  "title": "Grafana Dashboard 5.x",
  "type": "object"
}
