Skip to content

Commit

Permalink
mhh
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Aug 10, 2023
1 parent 0f8509c commit de8a395
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

namespace ApiPlatform\Serializer;

use ApiPlatform\Exception\InvalidArgumentException;
use ApiPlatform\Exception\InvalidArgumentException as LegacyInvalidArgumentException;
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
use ApiPlatform\Metadata\IriConverterInterface;
use ApiPlatform\Metadata\Link;
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
Expand Down Expand Up @@ -75,7 +76,7 @@ private function updateObjectToPopulate(array $data, array &$context): void
{
try {
$context[self::OBJECT_TO_POPULATE] = $this->iriConverter->getResourceFromIri((string) $data['id'], $context + ['fetch_data' => true]);
} catch (InvalidArgumentException) {
} catch (LegacyInvalidArgumentException|InvalidArgumentException) {
$operation = $this->resourceMetadataCollectionFactory->create($context['resource_class'])->getOperation();
$uriVariables = $this->getContextUriVariables($data, $operation, $context);
$iri = $this->iriConverter->getIriFromResource($context['resource_class'], UrlGeneratorInterface::ABS_PATH, $operation, ['uri_variables' => $uriVariables]);
Expand Down

0 comments on commit de8a395

Please sign in to comment.