Jump to content

Recommended Posts

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

I'm using the standard System.JSON library. It supports everything I needed until now, except merging.

Share this post


Link to post
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 by Remy Lebeau

Share this post


Link to post

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×