Skip to content
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

Nested keys are case sensitive ? #131

Closed
meirwah opened this issue Nov 9, 2015 · 5 comments
Closed

Nested keys are case sensitive ? #131

meirwah opened this issue Nov 9, 2015 · 5 comments

Comments

@meirwah
Copy link

meirwah commented Nov 9, 2015

Seems that when I use for the next Json file:

"Bot":{
    "Name":"watson"
  }

the path "Bot.name" it does not work ...
but path "Bot.Name" works...

Should it be case insensitive on all levels??

@ishidawataru
Copy link

Hi, I'm also hitting the same problem.

I think this can fix the issue.
ishidawataru@79a5e3b

@AkihiroSuda
Copy link

I'm also hitting the problem.

+1 @ishidawataru

@ishidawataru
Copy link

This fixed the issue.

110492b

@meirwah
Copy link
Author

meirwah commented Dec 28, 2015

👍

@meirwah meirwah closed this as completed Dec 28, 2015
knadh added a commit to knadh/viper that referenced this issue Jan 25, 2019
YAML, TOML, and JSON dictate keys to be case-sensitive. Viper's default
behaviour of lowercasing the keys for key insensitivity is incompatible
with these standards and has the side effect of making it difficult for
use cases such as case sensitive API credentials in configuration.
For eg: MyApiKey=MySecret (in TOML).

See spf13#131, spf13#260, spf13#293, spf13#371, spf13#373

This commit adds a global function `viper.SetKeyCaseSensitivity()` that
enables this behaviour to be turned off, after which, all keys, irrespective
of nesting, retain their cases. This respects all configuration operations
including getting, setting, and merging.
knadh added a commit to knadh/viper that referenced this issue Jan 29, 2019
YAML, TOML, and JSON dictate keys to be case-sensitive. Viper's default
behaviour of lowercasing the keys for key insensitivity is incompatible
with these standards and has the side effect of making it difficult for
use cases such as case sensitive API credentials in configuration.
For eg: MyApiKey=MySecret (in TOML).

See spf13#131, spf13#260, spf13#293, spf13#371, spf13#373

This commit adds a global function `viper.SetKeyCaseSensitivity()` that
enables this behaviour to be turned off, after which, all keys, irrespective
of nesting, retain their cases. This respects all configuration operations
including getting, setting, and merging.
knadh added a commit to knadh/viper that referenced this issue Jan 29, 2019
YAML, TOML, and JSON dictate keys to be case-sensitive. Viper's default
behaviour of lowercasing the keys for key insensitivity is incompatible
with these standards and has the side effect of making it difficult for
use cases such as case sensitive API credentials in configuration.
For eg: MyApiKey=MySecret (in TOML).

See spf13#131, spf13#260, spf13#293, spf13#371, spf13#373

This commit adds a global function `viper.SetKeysCaseSensitive()` that
enables this behaviour to be turned off, after which, all keys, irrespective
of nesting, retain their cases. This respects all configuration operations
including getting, setting, and merging.
This was referenced Aug 30, 2019
@sagikazarmark
Copy link
Collaborator

See #1014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants