Skip to content

Commit

Permalink
Removed ramsey/uuid support from property describer
Browse files Browse the repository at this point in the history
  • Loading branch information
stollr committed Apr 2, 2024
1 parent 7f30251 commit 1150db6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DependencyInjection/NelmioApiDocExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function load(array $configs, ContainerBuilder $container): void
->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)) {
if (class_exists(\Symfony\Component\Uid\Uuid::class)) {
$container->register('nelmio_api_doc.object_model.property_describers.uuid', UuidPropertyDescriber::class)
->setPublic(false)
->addTag('nelmio_api_doc.object_model.property_describer');
Expand Down
4 changes: 1 addition & 3 deletions src/PropertyDescriber/UuidPropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Nelmio\ApiDocBundle\PropertyDescriber;

use OpenApi\Annotations as OA;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\PropertyInfo\Type;
use Symfony\Component\Uid\AbstractUid;

Expand All @@ -32,7 +31,6 @@ public function supports(array $types): bool
{
return 1 === count($types)
&& Type::BUILTIN_TYPE_OBJECT === $types[0]->getBuiltinType()
&& (is_a($types[0]->getClassName(), AbstractUid::class, true)
|| is_a($types[0]->getClassName(), UuidInterface::class, true));
&& is_a($types[0]->getClassName(), AbstractUid::class, true);
}
}

0 comments on commit 1150db6

Please sign in to comment.