drupal 8 routing default parameter code example
Example: drupal 8 routing parameters
example.user:
path: '/example/{user}'
defaults:
_controller: '\Drupal\example\Controller\ExampleController::content'
requirements:
_permission: 'access content'
options:
parameters:
user:
type: entity:user