-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add as config properties other object types. #451
Conversation
@vsevel do you want to give this a try? |
sure. I will give you a feedback today or tomorrow. |
hello, I gave it a try:
I rebuilt At startup I get the following error:
anything I did wrong? |
Quarkus I've used the same code in a project of mine and got: Anyway, to use a Map, you need to use SR Config Now, there is another issue which is related with how MP Config handles lists. Each element separated by a comma is a different element. This doesn't work well when you place a complex structure in the config value. And that is why I use a wrapper object to map the List here: smallrye-config/sources/yaml/src/test/java/io/smallrye/config/source/yaml/YamlConfigSourceTest.java Lines 155 to 216 in ec3a252
The MP Config spec was not designed to work this way, so all of these are workarounds to be able to properly use and convert values. I'll try to figure out a way to make this more friendly with YAML sources. |
hello. I am a bit confused with the returned values. for list:
I would have expected to get:
that is no wrapping element, and no leaking artifact same comment for the map example:
I think this should be:
and I would correct the unit test with:
I am confused on this PR really fixing #447. |
Yes, maybe we need to remove the wrapping element. I guess it depends on how we developer would like to convert. The PR won't fix nothing directly. Is just that due to the nature on how configs are stored, there is no way for us to relate the properties. If you think in the case of a Maybe we can try to think in something more friendly. In your mind what would you expect to configure, code and get back? |
this is probably naive, but as a user, I would expect to be able to map a yaml config on a complex datastructure, very much like the kind of yaml databinding support offered by jackson, as in this example, at least everything but the davanced use cases (e.g. polymorphism). missing some of the details, it sounds the yaml config is limited by the properties format. ideally this would be 2 different modules, each allowing datastructures as sophisticated as the format itself supports. so I would expect to handle more complex use cases with the yaml format, than the properties format. |
Replaced by #489. |
Fixes #447