Skip to content

Commit

Permalink
fix: patch api-platform/core ValidationException
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Mar 5, 2024
1 parent 97f6a0f commit d64aa88
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/composer.json
Expand Up @@ -113,7 +113,8 @@
},
"patches": {
"api-platform/core": {
"Fix ArraySubsetTrait for PHPUnit 11": "patches/fix__fix_PHPUnit_11_compatibility.patch"
"Fix ArraySubsetTrait for PHPUnit 11": "patches/fix__fix_PHPUnit_11_compatibility.patch",
"Fix ValidationException": "patches/fix(validation)__fix_validation_exception_resource.patch"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -0,0 +1,30 @@
Subject: [PATCH] fix(validation): fix validation exception resource
---
Index: src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
--- a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php (revision 54638d3ca6d497ff829a6978dd1db9137b5bcf3a)
+++ b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php (revision b1dad841a7dcc2e1bd13b8d4917a2612c595796e)
@@ -45,9 +45,10 @@
use ApiPlatform\Symfony\EventListener\AddTagsListener;
use ApiPlatform\Symfony\EventListener\DenyAccessListener;
use ApiPlatform\Symfony\GraphQl\Resolver\Factory\DataCollectorResolverFactory;
-use ApiPlatform\Symfony\Validator\Exception\ValidationException;
+use ApiPlatform\Symfony\Validator\Exception\ValidationException as SymfonyValidationException;
use ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface;
use ApiPlatform\Symfony\Validator\ValidationGroupsGeneratorInterface;
+use ApiPlatform\Validator\Exception\ValidationException;
use Doctrine\Persistence\ManagerRegistry;
use phpDocumentor\Reflection\DocBlockFactoryInterface;
use PHPStan\PhpDocParser\Parser\PhpDocParser;
@@ -373,6 +374,7 @@
{
return [
Error::class,
+ SymfonyValidationException::class,
ValidationException::class,
];
}
6 changes: 5 additions & 1 deletion api/phpunit.xml.dist
Expand Up @@ -17,8 +17,12 @@
</php>

<testsuites>
<testsuite name="Project Test Suite">
<testsuite name="Unit">
<directory>tests</directory>
<exclude>tests/Api</exclude>
</testsuite>
<testsuite name="Functional">
<directory>tests/Api</directory>
</testsuite>
</testsuites>

Expand Down

0 comments on commit d64aa88

Please sign in to comment.