You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Paul Spencer (Jira)" <ji...@apache.org> on 2022/05/16 19:06:00 UTC

[jira] [Created] (KARAF-7436) Comments and order in json configuration files are not preserved

Paul Spencer created KARAF-7436:
-----------------------------------

             Summary: Comments and order in json configuration files are not preserved 
                 Key: KARAF-7436
                 URL: https://issues.apache.org/jira/browse/KARAF-7436
             Project: Karaf
          Issue Type: Bug
          Components: karaf
    Affects Versions: 4.3.6
            Reporter: Paul Spencer


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*
{code:java}
{
// Network Port Number
  "port":300,
// Array of int
  "an_int_array":[ 2, 3, 4 ],
// Complex structure
  "complex":{
     "a":1,
     "b":"two"
 }
}
{code}
 

*foo.json after config:property-list --pid foo*
{code:java}
{
  "an_int_array":[
   2,
   3,
   4,
   5
   ],
  "complex":"{\"a\":1,\"b\":\"two\"}",
  "port":300
 }
{code}
 

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)