YAML is not needed, can be JSON, HOCON, XML. It just needs to support ordered lists.
This could even be properties, though the approach is more complicated there.
T.
nice feature. Except the yaml ;)
LieGrue,
strub
As I promised on the weekly call, here is the example of meta-configuration we use for MP Config (and also the one we use for our config):
This configuration is based on the current MP API for setting up Config: YAML structure (as it contains ordered arrays) - could be handled by properties (if indexing is used), json etc.
This is a bit limited by the fact that parsers are bound to the source, so a combination of type + source must be defined (e.g. both properties and YAML source must support classpath, files and URL)
profile: "test" add-discovered-converters: true add-discovered-sources: false add-default-sources: false sources: - type: "system-properties" - type: "environment-variables" - type: "yaml" path: “application.yaml" - type: "yaml" optional: true classpath: "application.yaml" - type: "properties" classpath: "META-INF/jakarta-config.properties"
The default location could be META-INF/meta-config.yaml, which can be overridden at runtime using environment variable or system property (such as -Djakarta.config.meta-config=/etc/conifg/meta-config.yaml)
The following structure could be used if we support independent parsers (taken from Helidon Config):
Supported types (could be required by the spec): - system-properties - environment-variables - classpath (requires resource property) - file (requires path property) - url (requires url property) - inlined (configuration data is part of the meta config itself - useful for testing) Other types that could be supported (this is extensible through service loader, so anything can be done): - directory (such as each file in the directory is a configuration file prefixed with the file name) - git (specific file in a git repository) - etcd
sources: - type: "file" properties: path: "conf/dev.yaml" optional: true - type: "classpath" multi-source: true # Can yield more than one independent config source properties: resource: "META-INF/jakarta-config.properties"
_______________________________________________
config-dev mailing list
config-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://accounts.eclipse.org
_______________________________________________
config-dev mailing list
config-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://urldefense.com/v3/__https://accounts.eclipse.org__;!!ACWV5N9M2RV99hQ!bDs_79MqfdMrXf3S_fWwwRfO2tsHSMT3qdKSthQhaUOkLesG08ekYqnRh5IfdpcWqg$
|