Custom module implementation for menu items as JSON
You'll want to use this kind of implementation based on the Alias Manager service.

&lt;?php
$path_alias = \Drupal::service('path.alias_manager')-&gt;getAliasByPath($system_path, $langcode);
?&gt;


Details and a further explanation can be found on D.O https://www.drupal.org/node/1853148

If you'd be willing, I'd also like to see the full code for that resource.