#1 2022-03-30 17:56:48

tbo
Member
Registered: 2015-04-20
Posts: 337

InitArrayFromResults() and array with length 1

Delphi 11.1, mORMot2 commit ec20eed

Function InitArrayFromResults() does not serialize an array with length 1. I have the following function:

if json <> '' then
begin
  TDocVariantData(pmoLessonList).InitArrayFromResults(json);
  for var run: PVariant in TDocVariantData(pmoLessonList).Items do
  ...
end;

With JSON like [{...}, {...}] I get an array back. With JSON of this format [{...}], I get back an empty (pmoLessonList=[]) array.

With best regards
Thomas

Offline

#2 2022-03-31 06:50:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,324
Website

Re: InitArrayFromResults() and array with length 1

You are right!

Should be fixed by https://github.com/synopse/mORMot2/commit/3cd541a9

Offline

Board footer

Powered by FluxBB