This commit is contained in:
Michael Schimmel
2025-10-30 20:27:44 +01:00
parent 798aa08f02
commit 0526ec8a24
17 changed files with 193 additions and 137 deletions
+8 -4
View File
@@ -24,8 +24,9 @@ type
implementation
uses
System.Generics.Collections,
Myc.Data.Decimal,
System.Generics.Collections;
Myc.Data.Keyword;
{ TRttiAstHelper }
@@ -35,7 +36,8 @@ var
fieldsArray: TJSONArray;
i: Integer;
fieldObj: TJSONObject;
kindStr: string;
kindStr, fieldName: string;
fieldKey: IKeyword;
fields: TArray<TScalarRecordField>;
begin
jsonValue := TJSONObject.ParseJSONValue(AJson);
@@ -55,9 +57,11 @@ begin
if not Assigned(fieldObj) then
continue;
fields[i].Name := fieldObj.GetValue<string>('name');
fieldName := fieldObj.GetValue<string>('name');
fieldKey := TKeywordRegistry.Intern(fieldName);
kindStr := fieldObj.GetValue<string>('kind');
fields[i].Kind := TScalar.TKind(GetEnumValue(TypeInfo(TScalar.TKind), kindStr));
fields[i] := TScalarRecordField.Create(fieldKey, TScalar.TKind(GetEnumValue(TypeInfo(TScalar.TKind), kindStr)));
end;
Result := TScalarRecordDefinition.Create(fields);
finally