http://www.pgeorgiev.com/?p=1832

http://www.pgeorgiev.com/?p=1832

This hasn't been updated for a while but I thought it was a good idea. I don't know if something similar was implemented after XE2.

It also helps when you have to do unit test. What do you think ?
http://www.pgeorgiev.com/?p=1832

Comments

  1. Alberto Paganini You should add JSONName attribute to each field and JSONOwned attribute for the complex fields

    ReplyDelete
  2. Oliver Münzberg are you referring to my comment on unit testing ? If so, can you please explain better ?

    ReplyDelete
  3. Alberto Paganini The generated classes should look like

    TAssetsClass = class
    private
    ...
    [JSONName('updated_at')]
    FUpdated_at: String;
    [JSONName('uploader')]
    [JSONOwned(true)]
    FUploader: TUploaderClass;
    [JSONName('url')]
    FUrl: String;
    public
    ...

    See http://docwiki.embarcadero.com/Libraries/en/REST.Json.Types.JSONOwnedAttribute

    ReplyDelete

Post a Comment