akka-js/shocon

configuration fails when using fallback

andreaTP opened this issue · 3 comments

A couple of examples are here:
https://github.com/unicredit/shocon/tree/fallbackFail

one problem is probably in the parser that doesn't split keys on "." character.
the other is in the resolution of fallback ...probably...

will look into it.

EDIT: alright, test fails at querying for b. Currently fallback is not implemented properly: just one fallback value is allowed at a time, so we need to look into this.

I think this is now fixed in the branch. We need more test cases, though (e.g. Arrays) but tests now pass. I've split the test case you gave into two and added a few more.
Now:

  • fallback uses a stack of shocon.Config.Object
  • when a shocon.Config.Object is parsed the shocon.Config.Object.fromPairs() routine is used. This transforms flat keys of the form foo.bar.baz into nested trees of Objects and then merges the trees by key.

this should be closed