Skip to content

Instantly share code, notes, and snippets.

@tongueroo
Last active May 23, 2023 12:20
Show Gist options
  • Save tongueroo/c9baa7e98d5ad68bbdd770fde4651963 to your computer and use it in GitHub Desktop.
Save tongueroo/c9baa7e98d5ad68bbdd770fde4651963 to your computer and use it in GitHub Desktop.

ActiveSupport to_json and Grape Infinite Loop

Notes to Reproduce ActiveSupport to_json and Grape Infinite Loop Issue

Use console to reproduce:

$ jets c
route = Jets::Router.routes[4]
route.to_h # calls to_json and will produce infinite loop. this has been fixed
route.to_json # infinite loop. this has been fixed
GrapeApp.to_json # will still produce infinite loop

Note: The to_h and to_json has been fixed in Jets. The GrapeApp.to_json was root of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment