In the previous blog post we learned how to decorate a field of a class with attributes to adjust the Json serialization to our needs. This post is about serializing fields of type TObjectList<T> or descendants thereof.
Serializing objects to Json as well as de-serializing them with the Delphi standard libraries has been subject to many discussions. While the majority suggests to use another library or a self implemented solution, there are others who would prefer the built-in tools for a couple of reasons. Simplicity and the availability with every (decent) Delphi installation being the most mentioned ones.
The ease and elegance of a TRESTRequest.AddBody<T>(myInstance) call is hard to attain with other means. I guess it is not myself alone being tempted to make use of it. With a bit of care taken when designing the objects to serialize the results are often quite satisfying and fit the requirements. Nourishing this with some advanced techniques shown in this post may be enough to keep the benefits without the need for external code. Continue reading “Serializing Objects with TJson”
Today Delphi is going to be 25 years old! Continue reading “Happy 25th Birthday, Delphi!”
Seems Delphi 10.3.3 Rio adds some bogus entries for Android 64 into the dproj files when opening a project from a previous version. As this undermines the normalizing algorithm in Project Magician I added some code to clean up that mess first.
With the official release of Delphi 10.3.3 Rio comes a new version of Project Magician. This was necessary to support the new platforms introduced in the latest Rio updates.
I also took the opportunity to add some small bug fixes and enhancements.