Skip to content

Commit ef54e37

Browse files
author
abluchet
committed
Remove compatibility layer for bad identifiers 404 through PropertyNotFound
1 parent 8396bdf commit ef54e37

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/Bridge/Symfony/Routing/IriConverter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ public function getItemFromIri(string $iri, array $context = [])
8181

8282
$attributes = AttributesExtractor::extractAttributes($parameters);
8383

84-
if ($this->identifierDenormalizer) {
85-
$context[ChainIdentifierDenormalizer::HAS_IDENTIFIER_DENORMALIZER] = true;
86-
}
87-
8884
try {
8985
$identifiers = $this->extractIdentifiers($parameters, $attributes);
9086
} catch (InvalidIdentifierException $e) {
9187
throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
9288
}
9389

90+
if ($this->identifierDenormalizer) {
91+
$context[ChainIdentifierDenormalizer::HAS_IDENTIFIER_DENORMALIZER] = true;
92+
}
93+
9494
if (isset($attributes['subresource_operation_name'])) {
9595
if ($item = $this->getSubresourceData($identifiers, $attributes, $context)) {
9696
return $item;

src/DataProvider/OperationDataProviderTrait.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace ApiPlatform\Core\DataProvider;
1515

1616
use ApiPlatform\Core\Exception\InvalidIdentifierException;
17-
use ApiPlatform\Core\Exception\PropertyNotFoundException;
1817
use ApiPlatform\Core\Exception\RuntimeException;
1918
use ApiPlatform\Core\Identifier\Normalizer\ChainIdentifierDenormalizer;
2019

@@ -62,11 +61,7 @@ private function getCollectionData(array $attributes, array $context)
6261
*/
6362
private function getItemData($identifiers, array $attributes, array $context)
6463
{
65-
try {
66-
return $this->itemDataProvider->getItem($attributes['resource_class'], $identifiers, $attributes['item_operation_name'], $context);
67-
} catch (PropertyNotFoundException $e) {
68-
return null;
69-
}
64+
return $this->itemDataProvider->getItem($attributes['resource_class'], $identifiers, $attributes['item_operation_name'], $context);
7065
}
7166

7267
/**

0 commit comments

Comments
 (0)