I think changing from url
to route_name
is the solution, you normally use url
only for external links.
You don't find entity routes in static yml files because they are created dynamically. You could use the Devel module and visit
/devel/routes
or from the command line with Drupal Console:
drupal debug:router
See https://drupalconsole.com/docs/en/commands/debug-router
Then when you have found the route name you have to add the entity id as route parameter.
Example:
mymodule.links.menu.yml
mymodule.node7:
title: 'Node 7'
route_name: 'entity.node.canonical'
route_parameters: { node: '7' }