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"
}
}
}
}

Object with additionalProperties Constraint

property("config") {
obj {
additionalProperties = false
property("enabled") {
required = true
boolean()
}
}
}

See also

Properties

Link copied to clipboard

Whether additional properties beyond those defined are allowed.

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

Whether null values are allowed.

Link copied to clipboard

The JSON Schema type. Always "object" for this builder.

Functions

Link copied to clipboard
Link copied to clipboard

Defines a property within this nested object.