Problem/Motivation
We want to provide a JSON representation of any Drupal menu data to enable the use-case #1 of the decoupled initiative: #3189459: (use case #1) Provide an API response for "stateless menu" use case.
The format of the response follows IETF's proposed linkset format to avoid creating too many drupalism.
This was previously built in https://www.drupal.org/project/decoupled_menus
Proposed resolution
Since this menu data is read-only and doesn't fit in the JSON:API context, a new route has been declared in the system module directly meaning all websites will have it available without installing a new module.
The route is /system/menu/{menu}/linkset
with menu
being the machine name of the menu requested.
The links returned are the ones the requesting user has access to.
Remaining tasks
- Agree on where the code should live (system module, rest module, new module?)
- Review and fix what comes up :)
API changes
New endpoint to get menu data: /system/menu/[menu name]/linkset
Release notes snippet
TODO