-
Notifications
You must be signed in to change notification settings - Fork 114
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 value location #59
Comments
The Config API has all the primitives to provide this feature:
I have a dev branch for WildFly that is exposing this feature as a management operation: jmesnil/wildfly-microprofile-config@17d5abe#diff-a92756bd13114c03b7196011c6bf80baR108 I don't think there is anything to add to the API for this RFE. We could in a first step add a static class to smallrye-config that provides this feature (and let the user specify what to do with the found config sources?). |
@dmlloyd something like that should meet your requirements? https://gist.github.com/jmesnil/946ca36058fc3b0aa14755986798c14c |
That's the first stage. The second stage would be a method on In general I'm skeptical of |
@dmlloyd We're using The second step is a work-in-progress (which I hope to get back to soon) in |
ah, I missed the bits about identifying the "origin/location" from the config property inside the config source. Yes, this part will need to modify the API and find an abstraction that makes sense for a ConfigSource that can be backed by many different things that are not files (
|
Naming is the hardest problem in programming ;) ... you can always take the easy way out and use the Greek or Latin equivalent of |
For the non-files bit: that's why I said configuration source (lowercase). It could be a simple String that can be set to something that makes sense by the provider, for example:
|
This is related with some of the prototype work discussed here to support Config Lifecycle Events and ahead of time declaration: |
…rs and trace the origin of a configuration key.
…rceptors and trace the origin of a configuration key.
…rceptors and trace the origin of a configuration key.
…rceptors and trace the origin of a configuration key.
It would be nice to be able to track and report the source of a bad (invalid) configuration value. This might not be apparent, depending on how the configuration value was set.
Such an API would provide a method to get a location given a configuration key (this might fit best on ConfigSource if there is a way to identify which ConfigSource a key came from). The location would contain a "source description" which could be a file name, URL, or description such as "system property" or "environment variable". It would also contain an optional line number, which could be -1 if the line number isn't known or doesn't make sense for this location.
The text was updated successfully, but these errors were encountered: