ArrayPropertyBuilder
Builder for ArrayPropertyDefinition.
Configures array-type properties with item type definitions and size constraints. Provides convenient methods for specifying item types using ofString(), ofObject(), etc. Supports automatic conversion of List values to JsonArray.
This class is part of the JSON Schema DSL and cannot be instantiated directly. Use PropertyBuilder.array instead within the DSL context.
Array of Strings
property("tags") {
array {
description = "List of tags"
minItems = 1
maxItems = 10
ofString()
}
}Array of Objects
property("steps") {
array {
description = "Processing steps"
ofObject {
additionalProperties = false
property("explanation") {
required = true
string {
description = "Step explanation"
}
}
property("output") {
required = true
string {
description = "Step output"
}
}
}
}
}See also
Functions
Defines the type of items in the array using a generic property builder. Consider using the of*() convenience methods instead.
Specifies that array items are arrays (nested arrays).
Specifies that array items are booleans.
Specifies that array items are integers.
Specifies that array items are numbers (supports decimals).
Specifies that array items are objects.
Specifies that array items reference another schema definition.
Specifies that array items are strings.