Trying to import .json object through designer GUI for Tag Import, receiving "Not a JSON Object"

Tag Browser -> Right click folder -> Import -> Direct

Tag errors occurred during tag import 
Error_Exception("Error importing tags: java.lang.IllegalStateException: Not a JSON Object: 
[{"name":"BA20_v","tagType":"AtomicTag","valueSource":"reference","dataType":"Float4","extraInfo":"V","sourceTagPath":"[MBUS]up1/L1/FUS0-FUS127/FUS2","documentation":"24VDC Supply Voltage Monitor"}]") 

I am 99% sure this is a valid JSON object, everything else that I have that loads JSON objects is happy with it. Is this a known issue or am I making a mistake of some kind?

Update: removing the outer bracket and handing only a dict worked, for a single object.

Unbalanced double quotes, at least.

That trailing " is from the error printout

I'm pretty sure you get an object with a structure like

{ "tags": []
}

When you do a real export.

2 Likes

Yep, that's it. Bad error message, it is a valid JSON but not a valid tag definition JSON. I recommend changing the error to say something like "Not a valid tag object" rather than "Not a valid JSON object". Thanks!

It should be better, but what you provided is not a valid JSON object - it was a JSON array.

1 Like