Unexpected items in the config file should raise an exception
Can there be a mode where it raises an exception if something is found in the config file that does not match any member of the ConfigurationItem subclass? Currently, if there is something else in the config file, it is silently ignored.
The problem is, if you mistyped the name of a configuration item (and it is not mandatory), the program runs fine but does not produce the expected results. Until you spot the typo, you are left wondering why the configured value is not getting used.
Makes sense. I'm wondering if that should be the default behavior and have a flag to turn it off. And keep an extra map of keys if that behavior is off.
I think it should be the default behaviour (even though it is a breaking-change to the current behaviour). It is the "safer" behaviour. If someone wants to do things less safe, then they should make a deliberate choice to do it (and accept the consequences).
@hoylen This issue has been resolved in 1.1.1. The "safer" behavior is now the only behavior: it throws an exception if an unexpected key is found.
Thank you for this feature.
It has already proved its usefulness, by detecting some slightly incorrect names I had in my config files.
^ @MarcusSmith