Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently the menu resource does not provide enough information to construct a new representation of the menu in a decoupled environment. Any links contained within that menu are not represented within the response.
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
TBd
API changes
TBD
Data model changes
TBD
Comments
Comment #2
Wim LeersComment #3
Wim LeersComment #4
dawehnerAgreed that this is useful. I'm wondering whether we should expose the tree structure or flatten it and let the client deal with the hierarchy.
On top of that I'm wondering whether there are best practises around exposing hierarchical structures in general.
Comment #5
Wim Leers#4: great questions!
Comment #6
GrandmaGlassesRopeManComment #7
GrandmaGlassesRopeManI think exposing the tree structure makes the most sense, it puts the effort of reconstruction on the client, and we also aren't forcing something on them. Possibly something like the following?
Comment #10
Wim LeersApparently there is a contrib module that provides this: https://www.drupal.org/project/rest_menu_tree.
Comment #11
Wim LeersAnd there's also https://www.drupal.org/project/rest_menu_items, which appears to be more popular and more complete.
Since there are 2 options in contrib, marking this as postponed. It's probably better to let this mature in contrib first.
Comment #16
Wim LeersFocus has shifted to
jsonapi.module
instead ofrest.module
, so changing component.