deserialize
fun <T : Any> deserialize(klass: KClass<T>, map: Map<String, Any?>, errors: ConfigErrorCollector, path: String = ""): T?
Deserializes a YAML-sourced map into an instance of klass.
The method walks the primary constructor of klass, resolves each parameter from map (honouring annotations), validates constraints, and constructs the final instance. Any errors encountered are accumulated in errors rather than thrown, so that the caller receives a complete diagnostic report.
Return
A fully constructed instance of T, or null if construction failed (e.g. missing required fields, no primary constructor).
Parameters
T
The target data class type.
map
The key-value map produced by YamlReader (or equivalent).
errors
The collector that receives all ConfigError instances.
path
Dot-separated prefix for nested paths (empty string at the root level).