Expand description
Implementation of the array schema
§Length of an Array
The length of an array is the number of elements stored.
§Parameters
| Key | Type | Default | Comment |
|---|---|---|---|
"lengthEncoding" | object | { "type": "tillend" } | The way the length of the string is communicated |
"minItems" | uint | optional | Minimal number of items in the array |
"maxItems" | uint | optional | Maximal number of items in the array |
"items" | data schema | required | Schema validating the elements of the array |
§Validation
"lengthEncoding" has its own validation rules (see LengthEncoding).
This also includes the validity of the values of "minItems" and "maxItems".
In contrast to JSON schema, BDS does not support tuples.
Accordingly, it is only allowed to have a single data schema as the value of "items".
§Features
Apart from the length encoding that arrays schemata share with string schemata, there are no special features implemented for array schemata. Neither tuple validation nor uniqueness.
Structs§
- Array
Schema - The array schema to describe arrays of homogeneous elements (further information on the module’s documentation).
Enums§
- Decoding
Error - Errors decoding a string with an ArraySchema.
- Encoding
Error - Errors encoding a string with an ArraySchema.
- Validation
Error - Errors validating an ArraySchema.