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

Enable serde(deny_unknown_fields) for config structs #47

Open
1 of 2 tasks
hakoerber opened this issue Oct 6, 2022 · 0 comments
Open
1 of 2 tasks

Enable serde(deny_unknown_fields) for config structs #47

hakoerber opened this issue Oct 6, 2022 · 0 comments
Labels

Comments

@hakoerber
Copy link
Owner

hakoerber commented Oct 6, 2022

Right now, the configuration files can contain additional keys without problems, they are just ignored. This is good for backwards compatibility during development, but can lead to confusing situation (e.g. when mistyping a key).

Enabling #[serde(deny_unknown_fields)] for those structs would reject those configuration files.

  • Enable the setting
  • Check the error codes

The errors are very unhelpful:

grm repos sync config -c ~/grm.toml
[✘] Error parsing configuration file "grm.toml": data did not match any variant of untagged enum Config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant