Bill Meyer 337 Posted April 17, 2020 My colleagues tell me they have identified a problem in the copy of superobject which we use in D2007. The problem is not present in the version we use in XE7, but I am not aware of what may be different, and no one appears to have noted when and where the two versions were acquired. I am also told that there have been a great many forks of superobject, which makes it all more confusing. What version do people here use, and what is considered the gold standard now, if there is one? Share this post Link to post
Lars Fosdal 1792 Posted April 17, 2020 Using the std TJson class in REST.Json. Probably not considered gold std. Share this post Link to post
aehimself 396 Posted April 17, 2020 I'm using the standard System.JSON library. It supports everything I needed until now, except merging. Share this post Link to post
Remy Lebeau 1397 Posted April 18, 2020 (edited) 12 hours ago, Bill Meyer said: My colleagues tell me they have identified a problem in the copy of superobject which we use in D2007. The problem is not present in the version we use in XE7, but I am not aware of what may be different, and no one appears to have noted when and where the two versions were acquired. SuperObject is open-source. Just diff the two versions to see what is different between them. Or, just update the D2007 code to use the same version that the XE7 code is using. Or update both codes to the latest version. Quote I am also told that there have been a great many forks of superobject, which makes it all more confusing. So pick ONE and stick with it for both codes. Quote What version do people here use, and what is considered the gold standard now, if there is one? I don't do JSON processing in my code. Edited April 18, 2020 by Remy Lebeau Share this post Link to post
Angus Robertson 574 Posted April 18, 2020 I integrated SuperObject into the ICS library two years ago since we support D7 to 10.3 with mostly the same code, I used v1.2 from https://github.com/hgourvest/superobject which is not the latest, later versions added time zone stuff which made it harder to stabilise and duplicated stuff we had already. With a few tweaks and new compiler version checks, it works fine on all those versions of Delphi. https://svn.overbyte.be/svn/ics/trunk/Source/OverbyteIcsSuperObject.pas Angus Share this post Link to post
Edwin Yip 154 Posted April 18, 2020 mORMot's TDocVariant supports back to D7 so I think it should work well with D2007 all the way to the newest Delphi. Share this post Link to post
stijnsanders 35 Posted April 18, 2020 If anyone cares to try another alternative, I've created my own JSON handler, based on work I had done before to handle BSON for a rough-and-raw handler for MongoDB: https://github.com/stijnsanders/jsonDoc#jsondoc I really dislike long lists of overloads, so it extensively uses Delphi's own Variant type. It also tries to prevent too much allocation of Variant instances. If you need to process identical or similar JSON objects in sequence, re-use the same instance to re-use the allocated keys and values. Share this post Link to post