integer
The number
generator generates a random or fixed integer.
It has two modes: constant
and random
.
Constant mode
In constant mode, the integer
generator generates a fixed integer.
This mode has one input:
value
: The fixed integer to generate
Example
Generate the number 10
:
{
"type": "integer",
"value": 10
}
Shorthand
The integer
generator can also be used in shorthand mode.
In this mode, the generator will generate a fixed integer.
Example
Generate the number 10
inside an object:
{
"type": "object",
"properties": {
"int": 10
}
}
Random mode
In random mode, the integer
generator generates a random integer.
This mode has two optional inputs:
min
: The minimum value to generate. Defaults toi64::MIN
(opens in a new tab)max
: The maximum value to generate. Defaults toi64::MAX
(opens in a new tab)
Example
Generate a random integer:
{
"type": "integer"
}
Generate a random integer between 0
and 100
:
{
"type": "integer",
"min": 0,
"max": 100
}