4koma icon indicating copy to clipboard operation
4koma copied to clipboard

Warn or fail on unused keys in decoded TOML file

Open henrikje opened this issue 1 year ago • 1 comments

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())

henrikje avatar Mar 08 '23 07:03 henrikje