> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Definition

Definition defines properties of a key, code, or other value that has a specific meaning or utility.

## Schema ID

`https://gobl.org/draft-0/cbc/definition`

## Properties

| Title | Property | Type | Description |
| - | - | - | - |
| Key | `key` | [cbc.Key](https://docs.gobl.org/draft-0/cbc/key.md) | Key being defined. |
| Code | `code` | [cbc.Code](https://docs.gobl.org/draft-0/cbc/code.md) | Code this definition represents. |
| Name | `name` | [i18n.String](https://docs.gobl.org/draft-0/i18n/string.md) | Short name for the key. |
| Description | `desc` | [i18n.String](https://docs.gobl.org/draft-0/i18n/string.md) | More details about when the key should be used. |
| Meta | `meta` | [cbc.Meta](https://docs.gobl.org/draft-0/cbc/meta.md) | Any additional details associated with the key. |
| Usage | `usage` | [cbc.Usage](https://docs.gobl.org/draft-0/cbc/usage.md) | Context in which the definition may be used, such as the addons or regimes that offer it, and where it can be placed inside a document. |
| Sources | `sources` | array of [cbc.Source](https://docs.gobl.org/draft-0/cbc/source.md) | Where the information was sourced from and where it can be reviewed for updates in the future. |
| Values | `values` | array of [cbc.Definition](https://docs.gobl.org/draft-0/cbc/definition.md) | Possible values associated with the key, which are themselves either keys or codes depending on the context. |
| Pattern | `pattern` | string | Regular expression used to validate the value instead of a fixed value from the code or key definitions. |
| Code Map | `map` | [cbc.CodeMap](https://docs.gobl.org/draft-0/cbc/code_map.md) | Maps local keys to specific codes, useful for converting the described key into a local code. |

## Validation Rules

| Field | Test | Validation Code / Message |
| - | - | - |
| Definition | <ul><li>String(Code) != '' \|\| string(Key) != ''</li></ul> | `GOBL-CBC-DEFINITION-02` Definition must have either a key or a code, and not both |
| `name` | <ul><li>Present</li></ul> | `GOBL-CBC-DEFINITION-01` Name is required |
| `pattern` | <ul><li>Is a regexp</li></ul> | `GOBL-CBC-DEFINITION-03` Pattern must be a valid regular expression |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.