schema.integer

Randomly generates integer values, or generates successive values if step is specified.

Attributes

minmumoptional

The minimum value (inclusive) to be generated. Corresponds to the minimum JSON schema keyword. The default value is -9,223,372,036,854,775,808.

maximumoptional

The maximum value (inclusive) to be generated. Corresponds to the maximum JSON schema keyword. The default value is 9,223,372,036,854,775,807.

stepoptional

Used to order the output - must be a non-zero integer.

When positive, the first value will be minimum, and subsequent values will increase by the specified amount.

When negative, the first value will be maximum, and subsequent values will decrease by the specified amount.

Note that if a positivestep is specified along with maximum, or a negative step is specified along with aminimum, the stream may produce an error if a future value exceeds the boundary.

Examples

Unbounded:

{
  "type": "integer"
}

Bounded:

{
  "type": "integer",
  "minimum": 0,
  "maximum": 100
}

Increasing:

{
  "type": "integer",
  "minimum": 1,
  "step": 1
}

Potential error:

{
  "type": "integer",
  "minimum": 1,
  "maximum": 10,
  "step": 1
}