add id to docgen normalization fo a person

This commit is contained in:
Julien Fastré 2022-03-03 15:01:14 +01:00
parent 3df2335cf4
commit bf4a3a2c91
2 changed files with 3 additions and 1 deletions

View File

@ -74,6 +74,7 @@ class PersonDocGenNormalizer implements
$data = [ $data = [
'type' => 'person', 'type' => 'person',
'id' => $person->getId(),
'isNull' => false, 'isNull' => false,
'civility' => $this->normalizer->normalize($person->getCivility(), $format, array_merge($context, ['docgen:expects' => Civility::class])), 'civility' => $this->normalizer->normalize($person->getCivility(), $format, array_merge($context, ['docgen:expects' => Civility::class])),
'firstName' => $person->getFirstName(), 'firstName' => $person->getFirstName(),
@ -151,7 +152,7 @@ class PersonDocGenNormalizer implements
$normalizer = new NormalizeNullValueHelper($this->normalizer, 'type', 'person'); $normalizer = new NormalizeNullValueHelper($this->normalizer, 'type', 'person');
$attributes = [ $attributes = [
'firstName', 'lastName', 'age', 'altNames', 'text', 'id', 'firstName', 'lastName', 'age', 'altNames', 'text',
'civility' => Civility::class, 'civility' => Civility::class,
'birthdate' => DateTimeInterface::class, 'birthdate' => DateTimeInterface::class,
'deathdate' => DateTimeInterface::class, 'deathdate' => DateTimeInterface::class,

View File

@ -38,6 +38,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
use ProphecyTrait; use ProphecyTrait;
private const BLANK = [ private const BLANK = [
'id' => '',
'firstName' => '', 'firstName' => '',
'lastName' => '', 'lastName' => '',
'altNames' => '', 'altNames' => '',