node-convict
node-convict copied to clipboard
Fix dot-paths in dynamic objects
Previously nested constructs containing dot-paths as keys would lead to a crash like "cannot find configuration param 'dot.path'". With some careful hacking around paths we can at least enable this use-case for dynamic objects - it is completely untested/unsupported for regular overlaying.
Coverage remained the same at 100.0% when pulling d487f7d98ac68ffe11b01b983fe6a9ae32a90755 on Sebmaster:fix/nested-dotpaths into b6a7c52a1ce2dec2093f692b77739820f8cbaaf7 on mozilla:master.
Hello @Sebmaster. Thanks for this PR. Sorry for the delay of the answer.
I would rather avoid making convict's code more complex. But this PR appears to fix #271 without breaking anything. So this is likely to be accepted.
@Sebmaster could you explain why do you use the expression dynamic objects? Isn't it just about objects with dot path values? The right choice of words is very important so the purpose of the code and the tests are as clear as possible, especially for future maintenance. Thanks.
could you explain why do you use the expression dynamic objects?
That's mainly because I'm not sure I wired this up correctly for regular schema configuration overlays, I only tested this for types where an arbitary object can be provided. I'm not sure this enables configuring a dot.path
schema property.
I will make a PR with full support of dot path.