A while ago I found this...
http://pgeorgiev.com/introducing-jsontodelphiclass/ and the associated git
https://github.com/PKGeorgiev/Delphi-JsonToDelphiClassThese, basically, take some sample JSON and a Delphi unit is created to handle live data. This appears to work in a limited sense. When I say limited I mean that real-world data APIs have a habit of evolving and the JSON you can realistically expect from some API is frequently missing some field or another.
In the worst cases fields can change type (that's not fun).
I've got the basics of JSON Schema analysis working OK and now I want to take the results of the analysis and automate the generation of FPC units based on that analysis.
The analysis code takes a series of JSON records and then builds a list of key = 'json type' objects. I also want to make the types more reflect the arbitrary data processed so that for example whereas JSON has the concept of a number I can decide if a number is an integer or real for example (there are quite a lot of type conversions that can be automated)
Any pointers on automating the creation of the end-product unit code based on the results of the analysed json?