:( this has dragged on for quite some time. the approach and code work fine but i spotted an API naming issue that i think is worth discussing.
currently, WriteSettings was renamed to WriteJson, but ReadSettings kept its old name. so we now have a WriteJson / ReadSettings pair that operates on the same kind of data, but has different names (asymmetry)
so, i see 3 potential directions:
A. keep the ReadSettings / WriteSettings pair
probably the simplest fix for this PR. these functions are not really generic JSON helpers anyway: they assume a flat map<string, SettingsValue> and handle the _warning_ key. the downside is that having WriteSettings write to something like banlist.json feels a little odd
B. rename both to a ReadJson / WriteJson pair
this fixes the asymmetry with a small change. the downside is that WriteJson sounds more generic than it actually is, because it would still have settings-specific behavior like adding the _warning_ key.
C. extract the generic JSON functionality from the settings functionality into separate functions
for example, have generic ReadJsonFile / WriteJsonFile helpers underneath, then keep ReadSettings / WriteSettings as thin wrappers for the settings-specific behavior.
this seems like the cleanest long-term design if we expect more JSON-backed files to use this code, but probably more work than this PR expected.
any thoughts on this ?