The Array field type allows you to generate an array of a particular field. The array can be of varying length, but being an array, all values will be of the same type.
fields:
- name: A
type: Array
args:
min: 0
max: 10
field:
name: B
type: IntegerInRange
args:
min: 0
max: 10
- name: field_a
type: IntegerInRange
null_probability: 0.5
- name: array
type: Array
args:
min: 1
max: 4
field:
name: num
type: Digit
constraints:
- type: IfNull
name: field_a
[
{ "A": [4, 9, 5, 2], "field_a": 5185946464695284972, "array": [null] },
{
"A": [5, 0, 2, 7, 0, 4, 3],
"field_a": 7503849539415973306,
"array": [null, null, null],
},
{ "A": [1, 9, 0], "field_a": null, "array": [5, 6] },
]
Name Type Description Default
min int The minimum length of the array. 0
max int The maximum length of the array. 10
field Field The field to generate the array of.
Name Type Description Default Value
null_probability float The probability that the field will be null. 0.0
constraints list A list of constraints to apply to the field. []
Name Description
IfNull The value must only be non-null if another field is null.