Skip to content

Commit

Permalink
fix: check that api-platform/ramsey-uuid is installed before register…
Browse files Browse the repository at this point in the history
…ing related services (#6696)

* fix: check that api-platform/ramsey-uuid is installed before registering related services

* fix: suggest in Symfony's package composer.json
  • Loading branch information
dunglas authored Oct 7, 2024
1 parent 6dfa89b commit f7f605d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use ApiPlatform\Metadata\UriVariableTransformerInterface;
use ApiPlatform\Metadata\UrlGeneratorInterface;
use ApiPlatform\Problem\Serializer\ConstraintViolationListNormalizer;
use ApiPlatform\RamseyUuid\Serializer\UuidDenormalizer;
use ApiPlatform\State\ApiResource\Error;
use ApiPlatform\State\ParameterProviderInterface;
use ApiPlatform\State\ProcessorInterface;
Expand Down Expand Up @@ -221,7 +222,7 @@ private function registerCommonConfiguration(ContainerBuilder $container, array
$loader->load('api.xml');
$loader->load('filter.xml');

if (class_exists(Uuid::class)) {
if (class_exists(UuidDenormalizer::class) && class_exists(Uuid::class)) {
$loader->load('ramsey_uuid.xml');
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"api-platform/doctrine-odm": "To support MongoDB. Only versions 4.0 and later are supported.",
"api-platform/elasticsearch": "To support Elasticsearch.",
"api-platform/graphql": "To support GraphQL.",
"api-platform/ramsey-uuid": "To support Ramsey's UUID identifiers.",
"ocramius/package-versions": "To display the API Platform's version in the debug bar.",
"phpstan/phpdoc-parser": "To support extracting metadata from PHPDoc.",
"psr/cache-implementation": "To use metadata caching.",
"ramsey/uuid": "To support Ramsey's UUID identifiers.",
"symfony/cache": "To have metadata caching when using Symfony integration.",
"symfony/config": "To load XML configuration files.",
"symfony/expression-language": "To use authorization and mercure advanced features.",
Expand Down

0 comments on commit f7f605d

Please sign in to comment.