-
Notifications
You must be signed in to change notification settings - Fork 18
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
List of key-value pairs (option to not split paths by dot) #214
Comments
Sorry for only answering now—feel free to ping me if I don't get back to issues after 7 days because when that happens, 95% of the time it's because I somehow didn't see it :( I see what you're trying to do and it would work for strings with no dots in them. Dots are an alternative way to delimit paths, so the following two YAML excerpts are loaded the same way in ConfigMe's eyes: homes.limits.test: 5 homes:
limits:
test: 5 Probably for your use case it would be enough to have a configurable way to turn this off? Edit: Just need to make sure that turning it off won't conflict with how property paths are defined in ConfigMe in Java (e.g. |
Crap, I forgot that dots are special in YAML. It's been a while... I usually work with TOML these days lol Actually, specifying permission nodes like homes:
limits:
blah: 10 should probably work... No reason they have to be a single string. I guess the question then becomes "how to I access them?" I guess it would just be a list, right? Or would it be a map... Or I'm way off. |
As far as I understand, dots don‘t mean anything special in YAML and the example in your initial post is perfectly valid and not equal to the nested equivalent. |
Ahh, okay. Yeah, there's no rush. Thanks for the help! |
- Add option to preserve dots in paths for Map properties - Open point: writing to resource still splits paths
- Make YamlFileResource aware on writing that keys from a map might not have to be split by '.' - Change PropertyPathTraverser to take in a list of path elements instead of blindly splitting a single String
This is fixed minus some last testing. I haven't forgotten about this but the laptop I used to release from crashed so I have to set everything back up and it hasn't been motivating me. It's still on my radar though! |
Perhaps more of just a question than an issue, but in a config I would like to have a list of key-value pairs, for example:
I tried using a
MapProperty
, but that doesn't seem to do what I want; it expects{ebonhomes.limits.example2=20, ebonhomes.limits.example=10}
.I could just do a list of Strings and split on
:
, but that's ugly, and I'd really not have to do that.Is there something here that I missed that'll do what I want?
The text was updated successfully, but these errors were encountered: