ObjectPropertyBuilder
Builder for ObjectPropertyDefinition.
Configures nested object properties with their own property definitions, constraints, and validation rules. Supports automatic conversion of Map values to JsonObject.
This class is part of the JSON Schema DSL and cannot be instantiated directly. Use PropertyBuilder.obj instead within the DSL context.
Nested Object
property("metadata") {
obj {
description = "User metadata"
property("createdAt") {
required = true
string {
format = "date-time"
}
}
property("updatedAt") {
string {
format = "date-time"
}
}
}
}Content copied to clipboard
Object with additionalProperties Constraint
property("config") {
obj {
additionalProperties = false
property("enabled") {
required = true
boolean()
}
}
}Content copied to clipboard