Module array

Source
Expand description

Implementation of the array schema

§Length of an Array

The length of an array is the number of elements stored.

§Parameters

KeyTypeDefaultComment
"lengthEncoding"object{ "type": "tillend" }The way the length of the string is communicated
"minItems"uintoptionalMinimal number of items in the array
"maxItems"uintoptionalMaximal number of items in the array
"items"data schemarequiredSchema 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§

ArraySchema
The array schema to describe arrays of homogeneous elements (further information on the module’s documentation).

Enums§

DecodingError
Errors decoding a string with an ArraySchema.
EncodingError
Errors encoding a string with an ArraySchema.
ValidationError
Errors validating an ArraySchema.