ICRAR / EAGLE

Editor for the Astronomical Graph Language Environment
GNU Lesser General Public License v3.0
0 stars 1 forks source link

JSON Invalid, saving anyway #103

Closed myxie closed 3 years ago

myxie commented 3 years ago

When saving the attached EAGLE graph, I receive the following pop up message:

JSON Invalid, saving anyway
data.nodeDataArray[8] should have required property 'inputApplicationName' 

When inspecting the file and loading it as a JSON file locally (i.e. deserialising it through Python), it appears to be fine. Running the DALiuGE translator on this using the following arguments works perfectly.

 dlg unroll -fv -L tmp_eagle.graph > test_pgt.json

I am not sure if this means the produced LGT/PGTs are invalid, or if the error message is related to a UI component rather than the underlying data structure.

tmp_eagle.txt

james-strauss-uwa commented 3 years ago

Hi @myxie ,

A few versions ago, we introduced a JSON schema to describe the expected structure of the JSON output (when saving, before translating etc)

This error message is meant to indicate that the JSON file produced when saving the graph was not valid when validated against the JSON schema. I probably should re-write the error to make it clearer.

I tried to reproduce your error, using both EAGLE from master, and the version of EAGLE at eagle.icrar.org (v3.0.4), but got a different (but related) error:

JSON Invalid, saving anyway data.nodeDataArray[38].inputAppFields[0].value should be string

This is still a useful error to catch, I'll add a fix, but I can't reproduce your error exactly.

My method was:

  1. Download tmp_eagle.txt above
  2. Rename to tmp_eagle.graph
  3. Load graph in EAGLE using the Graph > Local Storage > Load Graph menu item
  4. Save graph using the Graph > Local Storage > Save Graph menu item
  5. Observed the "JSON invalid" error
james-strauss-uwa commented 3 years ago

I was able to reproduce the error when saving the graph you attached to #8 . I'll look into it

james-strauss-uwa commented 3 years ago

This error was caused by accidentally setting a inputApplication name to undefined. Once set to undefined, it would not be written to JSON, which made the JSON validator fail.

Pushed a fix to master.

myxie commented 3 years ago

Hi @james-strauss-uwa,

Thank you for looking into this!