schema.array
Randomly generates an array of values from the specified items
sub-stream. May be referenced via the array
short name.
Attributes
items
required
A sub-stream used to generate array items. Analogous to the items
JSON Schema keyword.
minItems
optional
The minimum size of each generated array. Matches the minItems
JSON Schema keyword. Defaults to 0.
maxItems
optional
The maximum size of each generated array. Matches the maxItems
JSON Schema keyword. Defaults to minItems
plus 16.
Examples
Default size attributes:
{
"type": "schema.array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "number"
}
}
}
}
Custom size attributes:
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 10,
"maxItems": 90
}