userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.31k stars 268 forks source link

Cannot get ENV variables in config_vars. #618

Open Reavolt opened 1 month ago

Reavolt commented 1 month ago

I'm now trying to substitute a variable in static_config which is taken from config_vars in this way static_config

 url: $address-suggestion-url

config_vars

address-suggestion-url#env: ADDRESS_SUGGESTION_URL

I get components.address-suggestion.url': Field is missing (std::runtime_error)

If you substitute it directly into static

url#env: ADDRESS_SUGGESTION_URL

Then everything passes. The variable is defined.

Matrix-On commented 1 week ago

I fix this problem and create pull request.

https://github.com/userver-framework/userver/pull/641