Skip to content

Commit

Permalink
Remove UUID proeprty describer from service container if third party …
Browse files Browse the repository at this point in the history
…libs are missing
  • Loading branch information
stollr committed Apr 28, 2023
1 parent 28f7671 commit d982d33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DependencyInjection/NelmioApiDocExtension.php
Expand Up @@ -150,6 +150,11 @@ public function load(array $configs, ContainerBuilder $container)
$container->registerForAutoconfiguration(ModelDescriberInterface::class)
->addTag('nelmio_api_doc.model_describer');

// Remove UUID describer if none of the supported libraries exists
if (!class_exists(\Symfony\Component\Uid\Uuid::class) && !class_exists(\Ramsey\Uuid\UuidInterface::class)) {
$container->removeDefinition('nelmio_api_doc.object_model.property_describers.uuid');
}

// Import services needed for each library
$loader->load('php_doc.xml');

Expand Down

0 comments on commit d982d33

Please sign in to comment.