Scalar functions
sequentialInteger
Commentary
added in 0.0.5
stateful function
Generates integers sequentially, starting by default from 0.
Optionally, set a start 1 and step value 2.
Examples
Generating sequential integers
By default, the first value starts from 0
and advances by 1
.
{
"_gen": "sequentialInteger"
}
[
0,
1,
2,
3,
4
]
Set a starting value
Use startingFrom
to set the initial value.
{
"_gen": "sequentialInteger",
"startingFrom": 42
}
[
42,
43,
44,
45,
46
]
Set a step value
Use advanceBy
to set the step value.
{
"_gen": "sequentialInteger",
"startingFrom": 100,
"advanceBy": 10
}
[
100,
110,
120,
130,
140
]
Specification
JSON schema
{
"type": "object",
"properties": {
"startingFrom": {
"oneOf": [
{
"type": "integer"
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
},
"advanceBy": {
"oneOf": [
{
"type": "integer"
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
}
}