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

Configuration sourcing from ENV vars breaks optional fields #155

Closed
valeriansaliou opened this issue Jul 9, 2019 · 0 comments
Closed

Configuration sourcing from ENV vars breaks optional fields #155

valeriansaliou opened this issue Jul 9, 2019 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@valeriansaliou
Copy link
Owner

The following attribute: #[serde(deserialize_with = "env_var::opt_str")] prevents the optional configuration options to be treated as optional and omitted in the configuration file passed to Sonic.

This is a regression caused by the introduction of the "${env.VAR}" syntax.

Trace when no auth_password is set (which should work):

⋊> ~/C/c/c/development on master ◦ sonic -c sonic.conf                                                                         15:03:13
thread 'main' panicked at 'syntax error in config file: Error { inner: ErrorInner { kind: Custom, line: None, col: 0, message: "missing field `auth_password`", key: ["channel"] } }', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
@valeriansaliou valeriansaliou added the bug Something isn't working label Jul 9, 2019
@valeriansaliou valeriansaliou self-assigned this Jul 9, 2019
@valeriansaliou valeriansaliou added this to the v1.2.2 milestone Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant