RDP1974 39 Posted Saturday at 11:14 AM hi, can I ask your opinion about this JSON library to adopt? As much as there are good repositories for Delphi, in the last period I feel comfortable with this JsonTools (I handled all the blobs correctly from many devices where other libraries gave me errors in parsing) https://www.getlazarus.org/json/ https://www.getlazarus.org/json/tests/ (all test passed) btw. I am a loyal Delphi customer, I don't want to advertise Lazarus 🙂  Share this post Link to post
silvercoder79 24 Posted Saturday at 11:52 AM I am not one to tell you what you should or should not use... If you are familiar with it and works in the Delphi environment for you then go for it. I also do not have any experience in using the library you mentioned. The test results appear impressive.  My own perspective is that is the tool already has the things I am looking for, I defer to those. In this instance, it would be :  https://docwiki.embarcadero.com/RADStudio/Athens/en/JSON  but if that does not meet your needs then ... Share this post Link to post
Arnaud Bouchez 396 Posted Saturday at 08:07 PM Personal biais: the mORMot 2 Open Source framework has a very efficient JSON library, and several ways to use it: - from RTTI, using classes, records, collections, dynamic arrays, mORMot generics... - from variants, and a custom "document" variant type to store JSON objects or arrays... - from high-level IDocList / IDocDict holders. Â See https://blog.synopse.info/?post/2024/02/01/Easy-JSON-with-Delphi-and-FPC Â It is perhaps the fastest library available, working on Delphi and FPC, with unique features, like: list := DocList('[{"a":10,"b":20},{"a":1,"b":21},{"a":11,"b":20}]'); // sort a list/array by the nested objects field(s) list.SortByKeyValue(['b', 'a']); assert(list.Json = '[{"a":10,"b":20},{"a":11,"b":20},{"a":1,"b":21}]'); // create a dictionary from key:value pairs supplied from code dict := DocDict(['one', 1, 'two', 2, 'three', _Arr([5, 6, 7, 'huit'])]); assert(dict.Len = 3); // one dictionary with 3 elements assert(dict.Json = '{"one":1,"two":2,"three":[5,6,7,"huit"]}'); // convert to JSON with nice formatting (line feeds and spaces) Memo1.Caption := dic.ToString(jsonHumanReadable); // integrated search / filter assert(DocList('[{ab:1,cd:{ef:"two"}}]').First('ab<>0').cd.ef = 'two'); Â 1 Share this post Link to post
RDP1974 39 Posted 6 hours ago also there are many excellent libs (https://github.com/Fr0sT-Brutal/awesome-pascal) https://github.com/paolo-rossi/delphi-neon https://github.com/ahausladen/JsonDataObjects https://github.com/grijjy/GrijjyFoundation  for now I have tested Hausladen JsonDataObjects : that's 3x faster than JsonTools and equally easy Delphi community is unbeatable! Share this post Link to post