ahausladen / JsonDataObjects

JSON parser for Delphi 2009 and newer
MIT License
413 stars 160 forks source link

Problem with .path[] #10

Closed kattunga closed 9 years ago

kattunga commented 9 years ago

Hi, there is a bug when using .path to set values. I can it reproduce with following code:

procedure TForm2.Button2Click(Sender: TObject);
var
  doc: TJsonObject;
  v: variant;
begin
  doc := TJsonObject.Create;

  doc.Path['ferrcod'] := 2;
  doc.Path['ferrmsg'] := 'Debe haber un usuario';

  Memo1.Lines.Text := doc.ToJSON(false);
end;

Instead of returning:

{
    "ferrcod": 2
    "ferrmsg": "Debe haber un usuario"
}

It returns:

{
    "ferrcod": "Debe haber un usuario"
}

I'm trying the find the problem but I still not found.