write To String
Renders serialized configuration data to a YAML-formatted string.
This is the in-memory variant of write and is used internally by YamlConfigManager.toDebugString for debug output with secret masking.
Example:
val yaml = YamlWriter.writeToString(
data = mapOf("name" to "MyApp", "debug" to true),
comments = mapOf("debug" to CommentData(listOf("Enable debug mode"), CommentPlacement.ABOVE))
)
// Returns:
// name: MyApp
//
// # Enable debug mode
// debug: trueContent copied to clipboard
Return
The YAML-formatted string.
Since
1.0
Parameters
data
The serialized configuration data as a string-keyed map.
comments
Optional comment metadata to embed in the output.