Another solution, provided your objects are derived from TPersistent, which is compiled in $m+ state, is simply to use the default object streaming mechanism, which is a built-in (Read/WriteComponentResFile). I have been using that for 10's of years, actually since early Delphi. everybody seems to forget that mechanism.
But Benny is right: if you require JSON you can also do that in FreePascal, there are multiple good json libraries for fpc, fpjson is the default and good.
Paweld option is similar to the above, but json format.