gurkankaymak / hocon

go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config
MIT License
79 stars 17 forks source link

do not support Inheritance #4

Closed marshalys closed 3 years ago

marshalys commented 3 years ago

when use sample config from https://github.com/lightbend/config#inheritance like:

data-center-generic = { cluster-size = 6 }
data-center-east = ${data-center-generic} { name = "east" }
data-center-west = ${data-center-generic} { name = "west", cluster-size = 8 }

there is error: *hocon.ParseError(&hocon.ParseError{errType:"missing comma!", message:"values should have comma or ASCII newline ('\n') between them"

gurkankaymak commented 3 years ago

thanks for reporting,

problem was only occurring if the inheritance used with a substitution, fixed this problem but your example is a short way of object concatenation which is not supported yet, opened a separate issue for supporting object concatenation at the same line #7

as documented in https://github.com/lightbend/config#inheritance your example's full form is as below, which is working now

data-center-generic = { cluster-size = 6 } data-center-east = ${data-center-generic} data-center-east = { name = "east" } data-center-west = ${data-center-generic} data-center-west = { name = "west", cluster-size = 8 }