Since Delphi 2010, the compiler generates additional RTTI at compilation, so
record fields are described, and available at
By the way, this enhanced RTTI is one of the reasons why executables did grow so much in newer versions of the compiler.
SynCommons.pas unit is now able to use this enhanced
information, and let any
record be serialized via
RecordSave() functions, and all
internal JSON marshalling process.
In short, you have nothing to do.
Just use your
record as parameters, and, with Delphi 2010 and up,
they will be serialized as valid JSON objects.
Of course, text-based
definition or callback-based registration are still at hand, and will be
used with older versions of Delphi.
But you could be used to by-pass or extend the enhanced-RTTI serialization, even on newer versions of the compiler.