JSON Generator generates data using a JSON template.
The dialog box of the JSON Generator contains basic and custom settings. You can customize the generator by changing them as required.
Besides, JSON Generator has Template and Preview dialog boxes. You can customize the default template by changing the default script.
Template: Shows JSON template.
Preview: Shows preview of data to be generated.
Generator: Click to insert one of Advanced Generators into JSON template.
The default script consists of transformation commands (“repeat”, “sort”) and generators (“Gender ()”, “int (0,100)”, “bit ()” …), which generate values for table fields.
Example of default script:
The repeat command specifies the number of repeats of array item.
Usage
Parameters:
min is the minimum number in the range. Type: number. Obligatory.
max is the maximum number in the range. Type: number. Obligatory.
The sort command specifies the field name by which the items are sorted.
Usage
Parameters:
A user may choose from a variety of generators, which are grouped thematically. In order to insert one or another generator into the script, you need to click the Generator button, then select the theme from the drop-down list, for example: Payment and select the desired generator.
If two commands are simultaneously specified at the same level, for example: “repeat (2.5)” and “sort (id)”, then items from 2 to 5 will be first created, then data for the fields will be generated using generators and then the items will be sorted by the “id” field value.
Template source code:
Result code: