4koma
4koma copied to clipboard
Warn or fail on unused keys in decoded TOML file
It would be helpful if the TomlMapper
/TomlDecoder
could be configured to produce a warning or throw an exception if there are keys in the decoded TOML which are never decoded.
In the example below, I would want the mapper to throw an exception because the unused
key is not used to construct the decoded value.
data class Config(val key: String)
val mapper = tomlMapper { }
val config: Config = mapper.decode("""
key = "value"
unused = true
""".trimIndent())