diff --git a/features/api/audiences.feature b/features/api/audiences.feature index 572d457879f..2b30728619d 100644 --- a/features/api/audiences.feature +++ b/features/api/audiences.feature @@ -49,11 +49,9 @@ Feature: And the JSON should be equal to: """ { - "type": "@string@", - "title": "An error occurred", - "status": 400, - "violations": { - "name": "Cette valeur ne doit pas ĂȘtre vide.", + "message": "Validation Failed", + "status": "error", + "violations": [ { "propertyPath": "name", "message": "Cette valeur ne doit pas ĂȘtre vide." diff --git a/src/Api/IriConverterDecorator.php b/src/Api/IriConverterDecorator.php index 00fa74e6e87..fe51d0afe14 100644 --- a/src/Api/IriConverterDecorator.php +++ b/src/Api/IriConverterDecorator.php @@ -18,9 +18,10 @@ public function getResourceFromIri(string $iri, array $context = [], ?Operation { if (Uuid::isValid($iri)) { $iri = $this->decorated->getIriFromResource(resource: $context['resource_class'], context: ['uri_variables' => ['uuid' => $iri]]); - } elseif (is_a($context['resource_class'], BaseEventCategory::class, true)) { - $iri = $this->decorated->getIriFromResource(resource: $context['resource_class'], context: ['uri_variables' => ['slug' => $iri]]); } + // elseif (is_a($context['resource_class'], BaseEventCategory::class, true)) { + // $iri = $this->decorated->getIriFromResource(resource: $context['resource_class'], context: ['uri_variables' => ['slug' => $iri]]); + // } return $this->decorated->getResourceFromIri($iri, $context, $operation); } diff --git a/src/Normalizer/EntityCategoryFromSlugDenormalizer.php b/src/Normalizer/EntityCategoryFromSlugDenormalizer.php index ee31e3e6dd4..9468922df69 100644 --- a/src/Normalizer/EntityCategoryFromSlugDenormalizer.php +++ b/src/Normalizer/EntityCategoryFromSlugDenormalizer.php @@ -2,7 +2,7 @@ namespace App\Normalizer; -use ApiPlatform\Exception\ItemNotFoundException; +use ApiPlatform\Metadata\Exception\ItemNotFoundException; use App\Entity\Event\EventCategory; use App\Repository\EventCategoryRepository; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;