Skip to content

Schema Types

The following types are available in the kayan { schema { ... } } DSL:

TypeKotlin typeDescription
stringStringPlain text value
booleanBooleantrue or false
intInt32-bit integer
longLong64-bit integer
doubleDoubleFloating-point number
stringMapMap<String, String>Key-value pairs
stringListList<String>List of strings
stringListMapMap<String, List<String>>Map of string to list of strings
enumValueGenerated enumNormalized enum generation
customConsumer-definedAdapter-based custom types

Use nullable = true to allow explicit null in config files. Use required = true when the final resolved value must always exist.

For types that don’t fit the built-in kinds, use the custom declaration with an adapter:

custom(
jsonKey = "launch_date",
propertyName = "LAUNCH_DATE",
rawKind = io.kayan.ConfigValueKind.STRING,
adapter = "sample.buildlogic.LaunchDateAdapter",
required = true,
)

The adapter class must implement the conversion from the raw config value kind to your target type.