Was attempting to use the HJsonwriter and found a few deficiencies with it's ability to write valid HGrid's into a valid JSON string. Here are a few proposed updates to the java haystack toolkit to correct these issues.
If the value of a tag in an HDict was also an HDict, the HDict.toJSON method fails. Corrected by adding the line in the method private void writeVAl(HVal val)
Add after Line 118: else if (val instanceof HBool) out.print(val);
else if(val instanceof HDict) writeDict((HDict) val);
Similarly if the value of the tag is an HGrid, the same issue presents itself. Corrected by adding after line added from above:
3.HJSonwriter needs to respect the meta version defined in the grid. Currently it is hard coded to 2.
Matthew GianniniThu 25 Oct 2018
Hi Jonathan - I'll take a look at these issues and your proposed solutions. If you would like to submit a pull request with your fixes I could also look at that.
Jonathan HughesThu 25 Oct 2018
Pull request HJSonWriter Enhancements has been submitted.
Matthew GianniniFri 26 Oct 2018
I merged in your pull request and made a few minor tweaks. Thanks!
Jonathan HughesFri 26 Oct 2018
Thanks for accepting. Now it's time to update my master repo.
Jonathan Hughes Wed 24 Oct 2018
Was attempting to use the HJsonwriter and found a few deficiencies with it's ability to write valid HGrid's into a valid JSON string. Here are a few proposed updates to the java haystack toolkit to correct these issues.
Which would turn the existing method:
Into:
3.HJSonwriter needs to respect the meta version defined in the grid. Currently it is hard coded to 2.
Matthew Giannini Thu 25 Oct 2018
Hi Jonathan - I'll take a look at these issues and your proposed solutions. If you would like to submit a pull request with your fixes I could also look at that.
Jonathan Hughes Thu 25 Oct 2018
Pull request HJSonWriter Enhancements has been submitted.
Matthew Giannini Fri 26 Oct 2018
I merged in your pull request and made a few minor tweaks. Thanks!
Jonathan Hughes Fri 26 Oct 2018
Thanks for accepting. Now it's time to update my master repo.