Is there a way to remove a dictionary with merge
?
#108
-
ContextIn my app I have a TOML file with a default configuration: [http_api]
enabled = true
bind_address = "HTTP://127.0.0.1:1212"
# ... The dictionary I'm loading the configuration with: Figment::from(Serialized::defaults(Configuration::default()))
.merge(Toml::file(&info.config_toml_path))
.merge(Env::prefixed(CONFIG_OVERRIDE_PREFIX).split(CONFIG_OVERRIDE_SEPARATOR)) That allows me to define a default configuration (with the enabled HTTP API service) and disable the API overriding the QuestionWhat I want to do is get rid of the The only solution I see now is to remove the Is there a way to remove a whole dictionary with cc @da2ce7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
What is the functionality that you're looking for? At the moment, it feels like your two asks are in conflict with each-other: you want to simultaneously provide a default, which implies a configuration should exist when one isn't provided, but also not use a configuration when one isn't provided. Can you perhaps provide several examples (that is, configurations and their expected extraction) that demonstrate what you're trying to achieve? |
Beta Was this translation helpful? Give feedback.
What is the functionality that you're looking for? At the moment, it feels like your two asks are in conflict with each-other: you want to simultaneously provide a default, which implies a configuration should exist when one isn't provided, but also not use a configuration when one isn't provided. Can you perhaps provide several examples (that is, configurations and their expected extraction) that demonstrate what you're trying to achieve?