Skip to content

YAML null pair is Constructing an object.. #147

@acztassi

Description

@acztassi

For the next situation..

  tteste2 = class
  private
    FTEXTO: string;
    fids22: integer;
    property ids22: integer read fids22 write fids22;
    property TEXTO: string read FTEXTO write FTEXTO;
  end;

  Teste =  class
  public
    Fid: integer;
    Ftete: tteste2;
    Ftete2: tlist<tteste2>;
    property tete2: tlist<tteste2> read Ftete2 write Ftete2;
    property tete: tteste2 read Ftete write Ftete;
    property id: integer read Fid write Fid;
  end;

with the procedure

  x : Teste;
  s: string;
  ser: TYamlSerializer;
begin

   x := Teste.Create;
   ...
   s := ser.ObjectToYaml(X);

then i will get the follow YAML:

tete2: null
tete: null
id: 0

but when I deserialize it. The field "tete" that is an object should be nil,
because It's null in YAML, but the deserializer is creating an empty object in this field

the same occurs to the list object in field "Ftete2"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions