PropertyBuilder
Builder for defining property types and constraints.
This builder provides methods to specify the type of a property (string, number, boolean, array, object, etc.) along with its constraints. Use the required flag to mark properties as required in the schema.
Supported Property Types
string - String properties with format, pattern, length constraints
integer - Integer numeric properties
number - Numeric properties (including decimals)
boolean - Boolean properties
array - Array properties with item type definitions
obj - Nested object properties
reference - Schema references ($ref)
Example
property("status") {
required = true
string {
description = "Current status"
enum = listOf("active", "inactive", "pending")
}
}See also
Properties
Functions
Creates an array property definition.
Creates a boolean property definition.
Creates an integer property definition.
Creates a numeric property definition (supports decimals).
Creates a nested object property definition.
Creates a reference to another schema definition.
Creates a string property definition.