Jump to content
SGI

Problem converting back from JSON

Recommended Posts

Hi,

I have a problem using JKI JSON, it does not convert JSON data correctly back to the datatype. I noticed this problem with all array types when the array is part of a cluster.

Example snippet included.

I have traced the problem, and I think the data gets lost at "\Deserializer\JSON Parser\Parse Value.vi", at the in 'Array of VData to VCluster__ogtk.vi' in state 'begin-object' (note that that example data is with different datatype than the first example)

I'm using JKI-JSON-Serialization-master from Github, downloaded today (2018-06-14)

 

Kind regards & thank you in advance for your time looking into this,
SGI

JKI JSON error demo.png

something with Array of VData to VCluster.png

Share this post


Link to post
Share on other sites

This is a bug, and has to do with the name of the array:

Look at the created JSON string, and you will see that the name is not "Errors[]" (the original name of the variable) but "Errors" (without the "[]" that got removed somehow).
The JSON parser looks for "Errors[]" but cannot find the correct variable name (and will ignore the data called "Error" )

Remove the [] from the array  name and it will work.

Edited by SGI

Share this post


Link to post
Share on other sites

Hi There. Yes, it looks like you may have found a bug. I think that "[]" characters are allowed in JSON data names. Perhaps they were removed because they are also special characters.

Share this post


Link to post
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.

Guest
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.

Loading...

×
×
  • Create New...

Important Information

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