Havoc Pennington
Havoc Pennington
If you did that then you couldn't use system properties to set string values anymore, because most of the time the string will be invalid JSON, but sometimes it will...
The way it usually works is that the getters on `Config` perform type conversions, so for example `config.getInt("foo")` would convert a string-that-is-an-integer to an actual integer. There's no schema system,...
I would expect that if port is a string which parses as a number, and you call getInt, then it would be parsed into an int. If that isn't happening...
Can you provide a test case or more detail? I think that should work but could misremember
I believe this code should run: https://github.com/lightbend/config/blob/f92a4ee2f672c8254d87b27831d0903d3d0d6cc2/config/src/main/java/com/typesafe/config/impl/DefaultTransformer.java#L42-L49 called from here: https://github.com/lightbend/config/blob/f92a4ee2f672c8254d87b27831d0903d3d0d6cc2/config/src/main/java/com/typesafe/config/impl/SimpleConfig.java#L159-L160 but if it doesn't work that way I'm not sure what is happening.
See #453, #300 ... the ConfigDocument API would support load/edit/save, rather than trying to make ConfigObject do this. But the ConfigDocument API is very incomplete and needs effort.
It looks like there are some incompatibilities with ConfigSlurper (for example single quotes vs double, but probably other details too). So if your goal is to be compatible with groovy...
I don’t know the details of the groovy syntax, but basically I’d expect there are a variety of small differences so the config file writer would have to carefully consider...
You can call `config.root.render()` to convert a Config to a string, but it does not preserve formatting, and there's no method that writes it to a file for you.
all i can think of is to postprocess the config when you load it by lowercasing everything