This guide will be removed on April 29, 2022. Please use our new, easier-to-use Toast technical documentation site. All updated content is on the new site.

Detecting and Avoiding Infinite Loops in the Menus API JSON

While unusual, it is technically possible for the following menu structure to be created in the Toast administration back-end:

  • Menu Item A includes Modifier Group B

  • Modifier Group B includes Modifier Option C

  • Modifier Option C's menu item reference is Menu Item A

Menu Item A may be a direct child of a menu group or it may be a modifier option. For more information about the relationship between menu items and modifier options, see Understanding a modifier option's item reference.

This configuration can create an infinite loop that prevents a menu from being resolved. If your integration encounters a modifier option whose item reference is the same as the modifier option's parent menu item (Menu Item A in the example above), your integration should stop looping through the menu JSON and not display the modifier option.

Note

For information about modifier option item references, see Understanding a modifier option's item reference.