NumericPropertyBuilder

Builder for NumericPropertyDefinition.

Configures numeric properties (integer or number type) with range constraints, multiple-of validation, and default values. Supports automatic type conversion for all numeric types (Int, Long, Double, Float, etc.).

This class is part of the JSON Schema DSL and cannot be instantiated directly. Use PropertyBuilder.integer or PropertyBuilder.number instead within the DSL context.

Integer Property

property("count") {
integer {
description = "Item count"
minimum = 0.0
default = 10
}
}

Number Property with Constraints

property("score") {
number {
description = "User score"
minimum = 0.0
maximum = 100.0
multipleOf = 0.5
}
}

See also

Properties

Link copied to clipboard

Constant value for this property.

Link copied to clipboard
var default: Any?

Default value for this property.

Link copied to clipboard

Human-readable description of this property.

Link copied to clipboard

Maximum value (exclusive).

Link copied to clipboard

Minimum value (exclusive).

Link copied to clipboard

Maximum value (inclusive).

Link copied to clipboard

Minimum value (inclusive).

Link copied to clipboard

Value must be a multiple of this number.

Link copied to clipboard

Whether null values are allowed.

Link copied to clipboard

The JSON Schema type. Either "integer" or "number".

Functions

Link copied to clipboard