GenericPropertyBuilder

Builder for GenericPropertyDefinition.

Configures generic/untyped properties that don't have specific type constraints. Useful for schemas with:

  • No type specified

  • Multiple types

  • Heterogeneous enums

This class is part of the JSON Schema DSL and cannot be instantiated directly. Use JsonSchemaBuilder.property to create instances.

Example

jsonSchema {
name = "FlexibleSchema"
schema {
property("value") {
generic {
description = "Can be any type"
enum = listOf(
1,
"text",
true,
JsonArray(emptyList())
)
}
}
}
}

Properties

Link copied to clipboard

Constant value constraint for this property.

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
var enum: Any?

List of allowed values (enumeration) of any JSON type.

Link copied to clipboard

Whether null values are allowed.

Link copied to clipboard

The JSON Schema type. Can be null, a single type, or multiple types.

Functions

Link copied to clipboard