rcenvironment / rce

Distributed, workflow-driven integration environment
https://rcenvironment.de/
51 stars 16 forks source link

Example node configuration files are not valid JSON #42

Closed ArneBachmannDLR closed 1 year ago

ArneBachmannDLR commented 2 years ago

I just discovered the option to create a configuration right from an existing connection! Super neat!

However there is one problem with the example configurations: They contain // comments, which are outside the JSON spec and make the files invalid. JSON parsers should treat // as an error (but some ignore it, out of spec).

One workaround is using same-line key-values like "_comment": "Here goes the comment", but processing JSON maps in code may lead to reordering of keys anyway, and eliding duplicate keys as well, so that comments get lost or mixed. JSON is just not a format that is able to keep metadata.

rmischke-dlr commented 2 years ago

Hi Arne,

yes, we generally know that these are valid JSON. Pragmatically, RCE accepts them due to a configuration option in the JSON parser we use. I agree that this not the best style, though. We use the "comment" or "_comment" field workaround in other places already.

I suppose that the old-style comments slipped into the snippet generation code simply because they were in example configuration files, and not as a deliberate decision. Scheduled for 10.4.0 (https://mantis.sc.dlr.de/view.php?id=17925).