JSON

Objects and Nesting

If you want to include nested objects in JSON output, you can name your fields using dot (".") notation. For example, two fields named "address.city" and "address.state" will result in a value like:

{ address: { city: 'Sparta', state: 'New Jersey' } }

Chain dots together for deeper nesting.

Arrays

To generate an array of values, simply add brackets containing the number of items you want to generate to the end of the field name.

For example, "friends[3]" would result in a value like:

{ friends: ['Joe Smith', 'Sally Brown', 'Mike Jones'] }

If you would like a random number of items, specify a range in brackets. For example, "friends[2-5]" would result in 2 to 5 values being generated per object.

Array of Objects

To generate an array of objects, use the "JSON Array" field type. Any subsequent fields whose name begins with the name of the array field followed by a "." will be included as a property in each object in the array.

For example, if you have an JSON Array field named "friends", a field named "friends.firstName", and a field named "friends.lastName", you'll get values like:

{ friends: [ { firstName: 'Joe', lastName: 'Smith' }, { firstName: 'Sally', lastName: 'Brown' } ] }

You can even nest arrays!