{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://floor.github.io/material/token-catalogue.schema.json",
 "title": "Material token catalogue",
 "description": "The versioned inventory of the package's emitted design tokens: the mapping to Material's taxonomy and the verification state of every row, with its reason. Verification states are claims with evidence, never a certificate of conformance.",
 "type": "object",
 "required": [
  "schemaVersion",
  "catalogueRevision",
  "packageVersion",
  "sourceCommit",
  "inputsDigest",
  "emissionsDigest",
  "reasons",
  "sources",
  "tokens",
  "gaps"
 ],
 "properties": {
  "schemaVersion": {
   "type": "integer",
   "enum": [
    2
   ]
  },
  "catalogueRevision": {
   "type": "integer",
   "minimum": 1
  },
  "packageVersion": {
   "type": "string",
   "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
  },
  "sourceCommit": {
   "type": "string",
   "pattern": "^[0-9a-f]{40}$"
  },
  "inputsDigest": {
   "type": "string",
   "pattern": "^[0-9a-f]{64}$"
  },
  "emissionsDigest": {
   "type": "string",
   "pattern": "^[0-9a-f]{64}$"
  },
  "reasons": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "code",
     "text"
    ],
    "properties": {
     "code": {
      "type": "string",
      "pattern": "^[a-z0-9-]+$"
     },
     "text": {
      "type": "string"
     }
    }
   }
  },
  "sources": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "url",
     "section",
     "readDate",
     "generation",
     "status",
     "digest",
     "digestSha256"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "url": {
      "type": "string"
     },
     "section": {
      "type": "string"
     },
     "readDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "generation": {
      "type": "string"
     },
     "status": {
      "enum": [
       "read",
       "context-only",
       "unavailable"
      ]
     },
     "digest": {
      "type": "string"
     },
     "digestSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     }
    }
   }
  },
  "tokens": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "cssName",
     "m3Id",
     "family",
     "group",
     "verification",
     "reason",
     "source"
    ],
    "properties": {
     "cssName": {
      "type": "string",
      "pattern": "^--mtrl-[a-z0-9-]+$"
     },
     "m3Id": {
      "type": [
       "string",
       "null"
      ]
     },
     "family": {
      "enum": [
       "reference",
       "system",
       "library"
      ]
     },
     "group": {
      "enum": [
       "typeface",
       "shape",
       "typescale",
       "color",
       "state",
       "density",
       "component-hook",
       "consumer-provided"
      ]
     },
     "verification": {
      "enum": [
       "verified",
       "unverified",
       "not-applicable"
      ]
     },
     "reason": {
      "enum": [
       "color-context-only",
       "library-internal",
       "runtime-provided",
       "shape-full-realization",
       "shape-step-dp",
       "state-source-unread",
       "typeface-assignment",
       "typescale-line-height",
       "typescale-role-semantics",
       "typescale-size",
       "typescale-tracking",
       "typescale-weight"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   }
  },
  "gaps": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "m3Id",
     "source",
     "support",
     "supportReason",
     "emissions"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "m3Id": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": [
       "string",
       "null"
      ]
     },
     "support": {
      "enum": [
       "unsupported"
      ]
     },
     "supportReason": {
      "type": "string"
     },
     "emissions": {
      "type": "array",
      "maxItems": 0
     }
    }
   }
  }
 }
}
