-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removed 'flatten' #57
base: main
Are you sure you want to change the base?
Conversation
Sorry for closing and reopening pull request. It was a misclick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somehow feel like this could be addressed by #56
#[test] | ||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that this is valid use case we need to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that it is possible to support this feature with the same algorithm that is used for structured and specified data.
And also that does not look like valid case for me. Because it creates many misleading keys if an initial key has underscores. For example, if you have a FOO_BAR_BAZ=1 it creates FOO=, FOO_BAR= and FOO_BAR_BAZ=1 which can be misinterpreted by the underlying code.
I also added a test for HashMap with complex keys. |
I encountered an error when I tried to deserialize config
using these environment variables
It causes an error
Failed to load config: Error(missing field `endpoints`)
I found that the
flatten
method is causing all the troubles and it is unsound even for loading all the environment variables intoHashMap<String, String>
because it creates a key for every underscore. So I decided to remove it and replace it with just plainkeys
method.That change fixed my issue and also an issue in #49 (I uncommented
double_inner_mapping_with_enum_keys
and it worked flawlessly)