-
Notifications
You must be signed in to change notification settings - Fork 2k
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
WriteConfig fails with JSON filetype when encountering arrays of objects and overwrites the config file with 0 bytes #730
Comments
I've resolved this on our fork: https://github.com/ory/viper |
@spf13 hi, thank you for viper and cobra! Any chance the fix for this in ory@5bace2a could be applied to Basically, you can't json serialize viper configs that have been saved as yaml without this. |
Should be a trivial fix once #1167 is merged. |
ok, looks like there's some other good-sounding fixes in ory@5bace2a as well, FWIW. Thank you! |
BTW using yaml v3 could also be solution for this problem. As of the next release you can do that by adding |
Given the following JSON config file
and the following go program
If executed, the program will fail with error
and even replace the config file's contents with an empty file. This works without issues when using YAML files.
Tested on latest master.
The text was updated successfully, but these errors were encountered: