Comments in JSON

Hi,

does the JSON parser of the CtrlX support any comments?

I have quite a long list to register in the diagnostics and it would be nice to put some comments in it.

I know, there is no official standard, but seems some parsers accept comments...

Thanks,

Venzi

Best reply by MartinB

Hello Venzi,

as Jochen said, it is possible to add some keys the JSON parser ignores. For instance you can add a key like "comment":

{
  "mainDiagnostics": {
    "0E0A0001": {
      "comment": "My first main diagnostic",     
      "text": "Successfully finished boot process",
      "version": 1,
      "detailedDiagnostics": {
        "00000001": {
          "comment": "My first detailed diagnostic",
          "text": "Finished boot process without errors",
          "version": 1
        }
      }
    }
  }
}

Best regards
Martin

View original
2 replies