Skip to content

Commit

Permalink
feat(serializer): context IRI in HAL or JsonApi format (#6215)
Browse files Browse the repository at this point in the history
  • Loading branch information
pupaxxo authored May 24, 2024
1 parent 8c0aafe commit 77c57fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public function normalize(mixed $object, ?string $format = null, array $context
}

$context = $this->initContext($resourceClass, $context);
$iri = $this->iriConverter->getIriFromResource($object, UrlGeneratorInterface::ABS_PATH, $context['operation'] ?? null, $context);
$context['iri'] = $iri;

$iri = $context['iri'] ??= $this->iriConverter->getIriFromResource($object, UrlGeneratorInterface::ABS_PATH, $context['operation'] ?? null, $context);
$context['object'] = $object;
$context['format'] = $format;
$context['api_normalize'] = true;
Expand Down

0 comments on commit 77c57fd

Please sign in to comment.