I would like to merge two routes with ParamConverters on Symfony 5. On the root route I want to get all the records from the Entity table. On the id route I want to get only that particular Id. But as I access the root route i get this Exception: "Unable to guess how to get a Doctrine instance from the request information for parameter "cronjob". "
/**
* @Route("", methods="GET")
* @Route("{id}", methods="GET")
*/
public function restGet(Cronjob $cronjob)
{
...//logic for getting all or one record
}