Skip to content

Commit dad8b7d

Browse files
fix(validation): move validation exception resource (#6204)
* fix(validation): fix validation exception resource * Update src/Symfony/Validator/Exception/ValidationException.php Co-authored-by: Antoine Bluchet <[email protected]> --------- Co-authored-by: Antoine Bluchet <[email protected]>
1 parent 54638d3 commit dad8b7d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@
4545
use ApiPlatform\Symfony\EventListener\AddTagsListener;
4646
use ApiPlatform\Symfony\EventListener\DenyAccessListener;
4747
use ApiPlatform\Symfony\GraphQl\Resolver\Factory\DataCollectorResolverFactory;
48-
use ApiPlatform\Symfony\Validator\Exception\ValidationException;
48+
use ApiPlatform\Symfony\Validator\Exception\ValidationException as SymfonyValidationException;
4949
use ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface;
5050
use ApiPlatform\Symfony\Validator\ValidationGroupsGeneratorInterface;
51+
use ApiPlatform\Validator\Exception\ValidationException;
5152
use Doctrine\Persistence\ManagerRegistry;
5253
use phpDocumentor\Reflection\DocBlockFactoryInterface;
5354
use PHPStan\PhpDocParser\Parser\PhpDocParser;
@@ -373,6 +374,7 @@ private function getClassNameResources(): array
373374
{
374375
return [
375376
Error::class,
377+
SymfonyValidationException::class,
376378
ValidationException::class,
377379
];
378380
}

src/Symfony/Validator/Exception/ValidationException.php

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
* Thrown when a validation error occurs.
2828
*
2929
* @author Kévin Dunglas <[email protected]>
30+
*
31+
* @deprecated since API Platform 3.3, use {@see BaseValidationException} instead
3032
*/
3133
#[ErrorResource(
3234
uriTemplate: '/validation_errors/{id}',

0 commit comments

Comments
 (0)