Closed luben closed 5 years ago
Reporting a few issues with including the configuration files. The behavior is compared with the reference implementation (typesafe-config)
First, here is the example config files:
test-1.conf
Foo { foo = "foo" } Bar { include "bar" }
bar.conf:
bar = "bar"
Using this command (scala) I get the same result for all the cases described below:
scala> println(ConfigFactory.parseResourcesAnySyntax("test-1.conf").resolve().root().render() ) { # test-1.conf @ file: test-1.conf: 5 "Bar" : { # bar.conf @ file: bar.conf: 1 "bar" : "bar" }, # test-1.conf @ file: test-1.conf: 1 "Foo" : { # test-1.conf @ file: test-1.conf: 2 "foo" : "foo" } }
From C++ side I am using:
try { auto cfg = hocon::config::parse_file_any_syntax(filename)->resolve(); std::cout << "ok - validate " << filename << std::endl; std::cout << cfg->root()->render() << std::endl; } catch (const hocon::config_exception &e) { std::cout << "not ok - validate " << filename << std::endl; std::cout << "# " << e.what() << std::endl; failed--; }
with the same file from the same directory, the result is:
ok - validate test-1.conf { # file: test-1.conf "Bar" : {}, # file: test-1.conf "Foo" : { # file: test-1.conf "foo" : "foo" } }
(the content of the "Bar" section is missing).
using instead:
Bar { include "bar.conf" }
I get an exception: "reader() should not be called on resources".
Using include file("bar") or include file("bar.conf") works as expected
include file("bar")
include file("bar.conf")
I would think include "bar" might work, but it's not clear that it does.
include "bar"
I'm not actively working on fixing this, but will try to review fixes. Sorry that last one languished so long.
Closed as a duplicate of #98.
Reporting a few issues with including the configuration files. The behavior is compared with the reference implementation (typesafe-config)
First, here is the example config files:
test-1.conf
bar.conf:
Using this command (scala) I get the same result for all the cases described below:
From C++ side I am using:
with the same file from the same directory, the result is:
(the content of the "Bar" section is missing).
using instead:
I get an exception: "reader() should not be called on resources".
Using
include file("bar")
orinclude file("bar.conf")
works as expected