PKGeorgiev / Delphi-JsonToDelphiClass

Generates Delphi Classes based on JSON string (Json To Delphi Class Generator / JSON Data Binding Tool)
MIT License
235 stars 123 forks source link

Object can't be converted from Json array #17

Open caowm opened 4 years ago

caowm commented 4 years ago

This is demo generated TRootClass:

TRootClass = class
private
  FItems: TArray<TItemClass>;
public
  property Items: TArray<TItemClass> read FItems write FItems;
  destructor Destroy; override;
  function ToJsonString: string;
  class function FromJsonString(AJsonString: string): TRootClass;
end;

When calling TRootClass.FromJsonString, it will throw exception.

JensBorrisholt commented 3 years ago

Have a look at my frok

https://github.com/JensBorrisholt/Delphi-JsonToDelphiClass

I have continued the development. And I'm sure it can handle your JSON