{
  "$defs": {
    "KeyDefinition": {
      "description": "KeyDefinition defines properties of a key that is specific for a regime.",
      "properties": {
        "codes": {
          "description": "Codes describes the list of codes that can be used alongside the Key,\nfor example with identities.",
          "items": {
            "$ref": "https://gobl.org/draft-0/cbc/code-definition"
          },
          "title": "Codes",
          "type": "array"
        },
        "desc": {
          "$ref": "https://gobl.org/draft-0/i18n/string",
          "description": "Description offering more details about when the key should be used.",
          "title": "Description"
        },
        "key": {
          "$ref": "https://gobl.org/draft-0/cbc/key",
          "description": "Actual key value.",
          "title": "Key"
        },
        "keys": {
          "description": "Keys is used instead of codes to define a further sub-set of keys that\ncan be used alongside this one.",
          "items": {
            "$ref": "https://gobl.org/draft-0/cbc/key-definition"
          },
          "title": "Keys",
          "type": "array"
        },
        "map": {
          "$ref": "https://gobl.org/draft-0/cbc/code-map",
          "description": "Map helps map local keys to specific codes, useful for converting the\ndescribed key into a local code.",
          "title": "Code Map"
        },
        "meta": {
          "$ref": "https://gobl.org/draft-0/cbc/meta",
          "description": "Meta defines any additional details that may be useful or associated\nwith the key.",
          "title": "Meta"
        },
        "name": {
          "$ref": "https://gobl.org/draft-0/i18n/string",
          "description": "Short name for the key.",
          "title": "Name"
        },
        "pattern": {
          "description": "Pattern is used to validate the key value instead of using a fixed value\nfrom the code or key definitions.",
          "title": "Pattern",
          "type": "string"
        }
      },
      "required": [
        "key",
        "name"
      ],
      "type": "object"
    }
  },
  "$id": "https://gobl.org/draft-0/cbc/key-definition",
  "$ref": "#/$defs/KeyDefinition",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}