How to do inheritance in TOML like the YAML 'merge key' feature AKA '<< *'?
And how to do more complex inheritance that YAML does not support, as suggested here [1] ?
[1] https://stackoverflow.com/questions/14184971/more-complex-inheritance-in-yaml
The short answer is, TOML doesn't do that.
Each and every table from root to branches in a TOML document is defined in exactly one place. No table is based on any other. So there's no concept of inheritance within TOML. It's up to the application that consumes the document to handle any complexity that comes with combining multiple configurations.
Similar questions have come up in the past. Take a look at #697 for instance. You could adapt the approach that @axos88 suggested to simulate merge-key behavior. It's not standard to TOML, but I think it's a good way for applications to do this sort of stuff.
Most helpful comment
The short answer is, TOML doesn't do that.
Each and every table from root to branches in a TOML document is defined in exactly one place. No table is based on any other. So there's no concept of inheritance within TOML. It's up to the application that consumes the document to handle any complexity that comes with combining multiple configurations.
Similar questions have come up in the past. Take a look at #697 for instance. You could adapt the approach that @axos88 suggested to simulate merge-key behavior. It's not standard to TOML, but I think it's a good way for applications to do this sort of stuff.