api-platform / schema-generator

PHP Model Scaffolding from Schema.org and other RDF vocabularies
https://api-platform.com/docs/schema-generator/
MIT License
453 stars 108 forks source link

Support Symfony UID #409

Open vincentchalamon opened 1 year ago

vincentchalamon commented 1 year ago

Description
Add Symfony UID component support on identifiers.

Example

id:
    generationStrategy: 'symfony_uid'
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;

/**
 * @see https://schema.org/identifier
 */
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
#[ApiProperty(types: ['https://schema.org/identifier'])]
private ?Uuid $id = null;