Nested

The Nested field allow you to generate data that is nested within other data. This is particularly useful when outputting data in JSON format.

Schema

fields:
  - name: A Top
    type: Nested
    constraints:
      - type: IfNull
        name: B Top.B Nested
  - name: B Top
    type: Nested
    fields:
      - name: B Nested
        type: Nested
        null_probability: 0.5
  - name: C List
    type: Nested
    args:
      subtype: List
    fields:
      - name: C Nested 1
        type: Digit
      - name: C Nested 2
        type: String

Output

[
  {
    "A Top": null,
    "B Top": {
      "B Nested": {}
    },
    "C List": [1, "reiciendis"]
  }
]

Arguments

NameTypeDescriptionDefault
subtypestringThe type of the nested field. One of Object, List.Object

Field arguments

NameTypeDescriptionDefault Value
fieldslistA list of child fields of any type.[]

Supported constraints

NameDescription
IfNullThe value must only be non-null if another field is null.