Ver Fonte

[jsonSerializer] Serialize order: Parent classes properties first

Exilon há 5 anos atrás
pai
commit
3f8288a98b
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      Quick.Json.Serializer.pas

+ 3 - 2
Quick.Json.Serializer.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Version     : 1.11
   Created     : 21/05/2018
-  Modified    : 22/03/2020
+  Modified    : 31/03/2020
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
@@ -55,6 +55,7 @@ uses
     {$ENDIF}
     Variants,
   {$ENDIF}
+  Quick.RTTI.Utils,
   DateUtils,
   Quick.Commons,
   Quick.JSON.Utils;
@@ -1077,7 +1078,7 @@ begin
   try
     rType := ctx.GetType(aObject.ClassInfo);
     //s := rType.ToString;
-    for rProp in rType.GetProperties do
+    for rProp in TRTTI.GetProperties(rType,roFirstBase) do
     begin
       ExcludeSerialize := False;
       propertyname := rProp.Name;