FsConfig
FsConfig copied to clipboard
Possible to supply dynamic keys?
Description
Just curious if there's any way to supply dynamic keys, like a Map<string, string>
? eg. if I had a top-level Connections
key, I could add in an entry for each DB connection.
I tried using Dictionary<string, string>
but got a not implemented error.
Related information
- macOS Mojave
- FSconfig 2.1.6
- 3.1.300 .NET core
Hi @absolutejam, sorry for the delayed reply.
Dictionary<string, string>
is currently not supported as the target type. You can extend FsConfig to support this by adding an implementation like parseFSharpList.
You may have to consider the separator logic for separating each key-value entry. It'd be great if it is configurable like the SplitCharacter
logic that we have for parsing FSharp List type.
Due to personal reasons, I am not actively working on any Open source stuff. If you can send an MR, I am open to review and merge it :)