PlaceholdersΒΆ
Each placeholder serves as a place where the new, random value will be replaced in the output.
Generally each placeholder is enclosed between {{ and }}. So for example:
{{placeholder}}
Some placeholders accept arguments and some arguments can be required or optional. See below details of each placeholder.
Optional placeholder within the table is denoted by [ arg ].
Placeholder |
Description |
---|---|
Generic full name |
|
Generic first name |
|
Generic last name |
|
Number between l (inclusive) to h (exclusive) |
|
Number between 1 and 99. Equal to number(1,100) |
|
Generic city name |
|
Generic street address |
|
Generic lorem ipsum text contaning n words |
|
Empty string field |
|
Generates property with βpropβ name and array as its value |
|
Boolean value - true / false |
|
Choose randomly one of the argument. |
Defined placeholdersΒΆ
Follows a description of each defined placeholder available to use.
Note
Internally JDOG is using amazing Faker package to generate random values.
name([m,f])ΒΆ
Generic person full name - that is the first and last name.
ArgumentsΒΆ
Optional m - Generates male names.
Optional f - Generates female names.
If none of these arguments is provided then generates a male or female name.
ExampleΒΆ
{
"full_name": "{{name}}"
}
# Example output
{
"full_name": "Joe Hill"
}
first_name([m,f])ΒΆ
Generic person first name.
ArgumentsΒΆ
Optional m - Generates male names.
Optional f - Generates female names.
If none of these arguments is provided then generates a male or female name.
ExampleΒΆ
{
"first": "{{first_name(m)}}"
}
# Example output
{
"first": "Joe"
}
last_name([m,f])ΒΆ
Generic person last name.
ArgumentsΒΆ
Optional m - Generates male names.
Optional f - Generates female names.
If none of these arguments is provided then generates a male or female name.
ExampleΒΆ
{
"last": "{{last_name(f)}}"
}
# Example output
{
"last": "Hills"
}
number(l,h)ΒΆ
Generates number between l and h. Note that h is exclusive.
ArgumentsΒΆ
l - left boundary, inclusive
h - right boundary, exclusive
ExampleΒΆ
{
"age": "{{number(1,100)}}"
}
# Example output
{
"age": "42"
}
ageΒΆ
A random number from 1 to 99. Effectively the same as using {{number(1,100)}}.
ArgumentsΒΆ
None.
ExampleΒΆ
{
"age": "{{age}}"
}
# Example output
{
"age": "42"
}
cityΒΆ
City name.
ArgumentsΒΆ
None
ExampleΒΆ
{
"born_city": "{{city}}"
}
# Example output
{
"born_city": "Coruscant"
}
street_addressΒΆ
Generic street address.
ArgumentsΒΆ
None.
ExampleΒΆ
{
"company_address": "{{street_address}}"
}
# Example output
{
"company_address": "5th avenue"
}
lorem(n)ΒΆ
Random text containing n words.
ArgumentsΒΆ
n - How many words should text contain.
ExampleΒΆ
{
"description": "{{lorem(6)}}"
}
# Example output
{
"description": "Find control party plan water prove safe."
}
emptyΒΆ
Empty value. Useful with combination with option placeholder.
ArgumentsΒΆ
None.
ExampleΒΆ
{
"title": "{{empty}}"
}
# Example output
{
"title": ""
}
range(prop,n,[m])ΒΆ
Generates property named prop with an array of values. The number of benefits depends on arguments n and m.
Note that range placeholder should be used at the left side of property. See examples below.
ArgumentsΒΆ
prop - Name of property.
n - If only n specified array contains exactly n values.
optional m - If m is specified array contains items exactly between n up to m times.
ExampleΒΆ
Generate exactly four people objects.
{
"{{range(people,4)}}": {
"name": "{{name}}",
"age": "{{age}}",
"address": {
"city": "{{city}}"
},
"car": "{{option(mustang,{{empty}})}}"
}
}
# Example output
{
"people": [
{
"name": "Brandi Young",
"age": 39,
"address": {
"city": "Jamietown"
},
"car": "mustang"
},
{
"name": "Michelle Best",
"age": 70,
"address": {
"city": "Port Dustin"
},
"car": ""
},
{
"name": "Donald Hernandez",
"age": 79,
"address": {
"city": "East Julieshire"
},
"car": "mustang"
},
{
"name": "Kaitlyn Cook",
"age": 3,
"address": {
"city": "Rachelton"
},
"car": "mustang"
}
]
}
boolΒΆ
Boolean value - true or false.
ArgumentsΒΆ
None.
ExampleΒΆ
{
"awesome": "{{bool}}"
}
# Example output
{
"awesome": "true"
}