I'm working on a symfony 5 project.
I use ramsey/uuid.
My doctrine.yaml
dbal:
types:
uuid: Ramsey\Uuid\Doctrine\UuidType
My route in my controller
/**
* @Route(
* "/job/{id}",
* name="job_show",
* methods={"GET"}
* )
*/
I would like to add the requirements to verify if the "id" parameter is a uuid.
I tried with several regex but none work :
Regex tried :
requirements={"id"="/^[a-f0-9]{8}\-[a-f0-9]{4}\-4[a-f0-9]{3}\-[a-f0-9]{4}\-[a-f0-9]{12}$/"}
requirements={"id"="/^[a-f0-9\-]{36}$/"}
Every time I get this error:
No route found for "GET /job/dc5a945c-25a1-4760-bd69-970d94560cce"
I have watch severals similar questions like Searching for UUIDs in text with regex but none helped me.
Does anyone know where my error may come from or how to do it differently ?