-
Notifications
You must be signed in to change notification settings - Fork 583
Open
Labels
Description
Environment Details
- Helidon Version: 4
- Helidon SE
Problem Description
When setting up a config source as a declarative bean its not possible to use metaconfig for it as metaconfig is validated against ConfigSourceProviders only.
So when user wants to configure his custom injected config source custom-example-configsource:
sources:
- type: "custom-example-configsource"
properties:
test: testHe will endup with:
io.helidon.config.MetaConfigException: Config source of type custom-example-configsource is not supported. Supported types: [file, prefixed, classpath, system-properties, directory, inlined, url, environment-variables]
As metaconfig is created:
https://github.com/helidon-io/helidon/blob/main/config/config/src/main/java/io/helidon/config/ConfigProvider.java#L58
And automatically validated:
static ConfigSource configSource(String type, Config config) {
return CONFIG_SOURCE_PROVIDERS.stream()
.filter(provider -> provider.supports(type))
.findFirst()
.map(provider -> provider.create(type, config))
.orElseThrow(() -> new MetaConfigException("Config source of type " + type + " is not supported."
+ " Supported types: " + SUPPORTED_CONFIG_SOURCES));
}Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Sprint Scope