FamilySearch/gedcomx-php

SourceDescription Serialization Error

Opened this issue · 0 comments

When serializing a SourceDescription object, the descriptions key is serialized as description (singular).

Example:

<?php
require 'vendor/autoload.php';

use Gedcomx\Gedcomx;
use Gedcomx\Source\SourceDescription;
use Gedcomx\Common\TextValue;

$sD = new SourceDescription();
$sD->setId('c1');

$treeTitle = new TextValue();
$treeTitle->setValue("Test Title");

$treeDescription = new TextValue();
$treeDescription->SetValue("Test Description);

$sD->setTitles(array($treeTitle));
$sD->setDescriptions(array($treeDescription));

echo $sD->toJson();
exit;
?>

Produces

{
  "id": "c1",
  "titles": [
    {
      "value": "Test Title"
    }
  ],
  "description": [
    {
      "value": "Test Description"
    }
  ]
}