JsonSchemaBuilder

Builder for JsonSchema instances.

This is the top-level builder used within the jsonSchema DSL function. It configures the schema's metadata and delegates to JsonSchemaDefinitionBuilder for the actual schema structure.

Properties

  • name: The schema name (required)

  • strict: Whether the schema enforces strict validation (default: false)

  • description: Optional human-readable description

Example

jsonSchema {
name = "UserStatus"
strict = true
description = "Describes user account status"
schema {
property("status") {
string {
enum = listOf("active", "inactive", "pending")
}
}
}
}

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Optional human-readable description of the schema.

Link copied to clipboard

The name of the schema. Must not be empty.

Link copied to clipboard

Whether the schema enforces strict validation. Defaults to false.

Functions

Link copied to clipboard
Link copied to clipboard

Defines the schema structure and properties.