﻿{
    "$schema":  "https://json-schema.org/draft/2020-12/schema",
    "title":  "Dashcipe starter kit data schema",
    "type":  "object",
    "required":  [
                     "metrics",
                     "trend",
                     "segments",
                     "tableRows",
                     "alerts",
                     "states"
                 ],
    "properties":  {
                       "metrics":  {
                                       "items":  {
                                                     "properties":  {
                                                                        "label":  {
                                                                                      "type":  "string"
                                                                                  },
                                                                        "change":  {
                                                                                       "type":  "string"
                                                                                   },
                                                                        "value":  {
                                                                                      "type":  "string"
                                                                                  }
                                                                    },
                                                     "type":  "object",
                                                     "required":  [
                                                                      "label",
                                                                      "value",
                                                                      "change"
                                                                  ]
                                                 },
                                       "type":  "array"
                                   },
                       "trend":  {
                                     "items":  {
                                                   "properties":  {
                                                                      "value":  {
                                                                                    "type":  "number"
                                                                                },
                                                                      "label":  {
                                                                                    "type":  "string"
                                                                                }
                                                                  },
                                                   "type":  "object",
                                                   "required":  [
                                                                    "label",
                                                                    "value"
                                                                ]
                                               },
                                     "type":  "array"
                                 },
                       "segments":  {
                                        "items":  {
                                                      "properties":  {
                                                                         "label":  {
                                                                                       "type":  "string"
                                                                                   },
                                                                         "share":  {
                                                                                       "type":  "number"
                                                                                   },
                                                                         "value":  {
                                                                                       "type":  "string"
                                                                                   }
                                                                     },
                                                      "type":  "object",
                                                      "required":  [
                                                                       "label",
                                                                       "value",
                                                                       "share"
                                                                   ]
                                                  },
                                        "type":  "array"
                                    },
                       "tableRows":  {
                                         "items":  {
                                                       "properties":  {
                                                                          "status":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                          "name":  {
                                                                                       "type":  "string"
                                                                                   },
                                                                          "owner":  {
                                                                                        "type":  "string"
                                                                                    },
                                                                          "value":  {
                                                                                        "type":  "string"
                                                                                    }
                                                                      },
                                                       "type":  "object",
                                                       "required":  [
                                                                        "name",
                                                                        "status",
                                                                        "value",
                                                                        "owner"
                                                                    ]
                                                   },
                                         "type":  "array"
                                     },
                       "alerts":  {
                                      "items":  {
                                                    "type":  "string"
                                                },
                                      "type":  "array"
                                  },
                       "states":  {
                                      "properties":  {
                                                         "loading":  {
                                                                         "type":  "string"
                                                                     },
                                                         "error":  {
                                                                       "type":  "string"
                                                                   },
                                                         "empty":  {
                                                                       "type":  "string"
                                                                   }
                                                     },
                                      "type":  "object",
                                      "required":  [
                                                       "empty",
                                                       "loading",
                                                       "error"
                                                   ]
                                  }
                   }
}
