multiple toml configs (including cli options) array/map merge semantics
To give an example, suppose we have these two files:
# a.toml
[[entries]]
value = 42
# b.toml
[[entries]]
value = 666
This produces (using JSONish notation) { entries: [ { value: 42 }, { value: 666 } ] }
.
Now consider:
# a.toml
entries = [ { value = 42 } ]
# b.toml
entries = [ { value = 666 } ]
If we process both these files, in that order, semantically the result ought either to be "error" or equivalent to just b.toml
. The latter is probably better since it allows overriding.
This situation can only be detected while the original TOML structure exists; it can't be handled correctly by a post-deserialisation merge.
Currently we don't document the actual behaviour of Arti. !2041 (merged) (and !1989 (closed)) want to perhaps change the behaviour.
We should also see what other consumers of the Rust TOML libaries do. Notably, cargo merges config files sometimes. (My priors suggest that this aspect probably hasn't been properly considered in that context but I can hope to be pleasantly surprised.)
CC @nickm