Open HarHarLinks opened 3 weeks ago
We're using figment
under the hood, with the merge
strategy, meaning that later values are generally preferred. Not sure whether this is the right approach or not; it may make more sense to switch to the adjoin
strategy, where the first config files take precedence, and arrays get merged?
https://docs.rs/figment/latest/figment/struct.Figment.html#conflict-resolution
merge
strategy meets what I would have guessed but could not be sure. Whether you decide to change it or not, this issue is about documenting your approach so that the reader may create their config appropriately.
For your information, this issue has been copied over to the Element fork of matrix-authentication-service
: https://github.com/element-hq/matrix-authentication-service/issues/3136
https://github.com/matrix-org/matrix-authentication-service/blob/d3eb5be63ead3078f71f142785fc3768dcd7bcd8/docs/setup/general.md?plain=1#L50
but it's not explained how configs get merged in theory. will values from second.yaml overwrite those in first.yaml or reverse? or is it illegal to try this?