Hi, Comments are conserved in property/cfg files (thanks to Felix Utils Properties), but I don't think I've implemented this in the JSON config support.
Worth to create a jira as well :) Thanks, Regards JB On Mon, May 16, 2022 at 4:42 PM Paul Spencer <paulspen...@mindspring.com> wrote: > > Karaf 4.3.6 > > The OSGi specification mentions the support of comments in json configuration > files, > https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html#d0e131566, > but the comments are stripped and the properties are reorder when a > configuration file is read. > > How can comments and property order in json configuration files be preserved? > > > > *** > * foo.json before config:property-list --pid foo > *** > { > // Network Port Number > "port":300, > > // Array of int > "an_int_array":[ 2, 3, 4 ], > > // Complex structure > "complex":{ > "a":1, > "b":"two" > } > } > > > *** > * foo.json after config:property-list --pid foo > *** > { > "an_int_array":[ > 2, > 3, > 4, > 5 > ], > "complex":"{\"a\":1,\"b\":\"two\"}", > "port":300 > } > > > Paul Spencer