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())
)
}
}
}
}Content copied to clipboard