Jump to content

JSON ignoring single variant in a cluster


Recommended Posts


I found today the JKI JSON tool, which looks great, but I've encountered a problem.

When I try to "wrap" some data around a new object, with a cluster with a single variant it ignores it.

Please see screenshot for clearance:


The output is the same. I expect the left string to have the "bridge_data" in it.

Is it a bug or am I not using it correctly?

Thank you

Link to comment
Share on other sites

This looks like a bug.

(Note: I've filed a bug report in our issue tracker here: https://github.com/JKISoftware/JKI-JSON-Serialization/issues/34)

I see the same thing as you. The "bridge_data" is missing, here, when it's the only element in the cluster.



However, if I add another element next to the variant (so it's not the only element in the cluster) then I see "bridge_data" in the JSON string.



JSON Test ignoring single variant in a cluster.vi.zip

Link to comment
Share on other sites

@Voklaif We dug into it and it turns out to be a LabVIEW bug. The solution is for the user (you) put a To Variant function before the call to Flatten to JSON String, since the bug seems to be inside the coercion dot (and the To Variant function doesn't seem to have that problem).


Note: here's the bug (and fix) reduced to a very simple example (example VI also attached for anyone who wants to play with it)...

Coerce to Variant Fail (LV2019).vi





  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.