enum
List of allowed object values (enumeration).
Accepts List
This is less common but valid for schemas that allow only specific object instances.
Example with JsonObject
obj {
description = "Allowed configurations"
enum = listOf(
JsonObject(mapOf("mode" to JsonPrimitive("read"))),
JsonObject(mapOf("mode" to JsonPrimitive("write")))
)
}Content copied to clipboard
Example with Map (convenience)
obj {
description = "Allowed configurations"
enum = listOf(
mapOf("mode" to "read"),
mapOf("mode" to "write")
)
}Content copied to clipboard