-
Notifications
You must be signed in to change notification settings - Fork 116
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
HOCON properties rendered incorrectly #1225
Comments
I wrote an internal version of the module to quickly fix these issues for us. The solution is fairly simple with a few caveats because there is seemingly no way to "render" a key path in code consuming a config from the library; it always renders them itself before returning them. So the fix looks like this:
If I find the time I can look at making a PR for this but I'm pretty swamped at the moment. |
Thank you for the report. I was considering deprecating and removing the HOCON source due to:
We have no plans to invest effort in an abandoned library unless it is super popular, which is not the case. For the time being, we do accept any PRs that improve the implementation, of course. Would you consider moving away from the HOCON source? |
I've read those as we use HOCON. As the previous maintainer has said a few times, the library works with a few known issues but no real showstoppers. All in all, it's much better than YAML for config (in practice YAML trades repetition for lots of unnecessary indentations). That being considered, I would say that if SmallRye Config's YAML support included breaking keys with dots in them into key "paths"... we'd switch to that in a hearbeat. That's really "the thing" that makes HOCON better. So a YAML format that treated:
as if it were
I would see no value in HOCON. |
Not sure what SR Config is usign for YAML parsing but I know that being able to detect/specify quoated vs. unquoted keys is usually available (unless your using a meta-library like Jackson). So the above could be implemented and allow leaving quoted (single or double) keys alone. |
In HOCON, it's
Path.render
quotes anything it doesn't like, including things like%
for profiles,[]
for lists/arrays and/
used in projects like SmallRye FaultTolerance.Basically it produces a lot of quoted sections to the properties it produces that make them incorrect. Some examples:
%dev.some.property
becomes"%dev".some.property
org.acme.CoffeeResource/coffees/Retry/maxRetries=6
becomesorg.acme."CoffeeResource/coffees/Retry/maxRetries"=6
my.indexed.collection[0]=dog
becomesmy.indexed."collection[0]"=dog
There doesn't seem to be a way, currently, to represent these properties in HOCON files.
The text was updated successfully, but these errors were encountered: