Browse Source

[yamlSerializer] Serialize order: Parent classes properties first

Exilon 5 years ago
parent
commit
326b1156d6
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Quick.YAML.Serializer.pas

+ 4 - 3
Quick.YAML.Serializer.pas

@@ -1,13 +1,13 @@
 { ***************************************************************************
 { ***************************************************************************
 
 
-  Copyright (c) 2015-2019 Kike Pérez
+  Copyright (c) 2015-2020 Kike Pérez
 
 
   Unit        : Quick.YAML.Serializer
   Unit        : Quick.YAML.Serializer
   Description : YAML Serializer
   Description : YAML Serializer
   Author      : Kike Pérez
   Author      : Kike Pérez
   Version     : 1.0
   Version     : 1.0
   Created     : 12/04/2019
   Created     : 12/04/2019
-  Modified    : 10/12/2019
+  Modified    : 31/03/20120
 
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
 
@@ -49,6 +49,7 @@ uses
   {$ENDIF}
   {$ENDIF}
   DateUtils,
   DateUtils,
   Quick.Commons,
   Quick.Commons,
+  Quick.RTTI.Utils,
   Quick.YAML,
   Quick.YAML,
   Quick.Value,
   Quick.Value,
   Quick.Arrays;
   Quick.Arrays;
@@ -1033,7 +1034,7 @@ begin
     rType := ctx.GetType(aObject.ClassInfo);
     rType := ctx.GetType(aObject.ClassInfo);
     try
     try
       //s := rType.ToString;
       //s := rType.ToString;
-      for rProp in rType.GetProperties do
+      for rProp in TRTTI.GetProperties(rType,roFirstBase) do
       begin
       begin
         ExcludeSerialize := False;
         ExcludeSerialize := False;
         propertyname := rProp.Name;
         propertyname := rProp.Name;