mORMot2
mORMot2 copied to clipboard
JSON Array Bug
Hello @synopse
I pulled the latest updates from mormot2, and I was testing this code.
function GetJSONListTest(): utf8string;
var
JS, Item: IDocDict;
I: integer;
begin
JS := DocDict();
JS.I['VER'] := 1;
JS.A['ML'] := DocList();
for I := 0 to Pred(Screen.MonitorCount) do
begin
Item := DocDict();
Item.I['ID'] := I;
Item.I['W'] := 1024;
Item.I['H'] := 1024;
JS.A['ML'].Append(Item);
end;
Result := utf8string(JS.GetJson());
end;
Tested on
- Free Pascal Compiler version 3.3.1-15358-gb40d312521 [2024/08/29] for x86_64
- Embarcadero® RAD Studio 12 Version 29.0.51961.7529
And both gives me {"VER":1,"ML":[null,null]}
This code was working before I pulled the latest updates. I'll try to see which commit causes this problem.
Oh my bad I think I need to use AppendDoc not Append
So please close the issue?