Grape gives the ability to define multi-version API's with fallbacks (i.e. if one hits an endpoint that doesn't exists, it goes up or down a version: version %w(v3 v4), using: :path). Using the array version definition in order to achieve that make it impossible to use grape-route-helpers, which raises NoMethodError: undefined method scan for ['v3', 'v4']:Array in the lookup process.
Steps to reproduce
- Define a multi-version Grape API such as
version %w(v3 v4), using: :path
- Run
rake grape:route_helpers
At this point it will raise NoMethodError: undefined method scan for ['v3', 'v4']:Array. I'm not sure if always taking the last element on the array will make sense in every scenario. I'm willing to work on it, any suggestions?
Grape gives the ability to define multi-version API's with fallbacks (i.e. if one hits an endpoint that doesn't exists, it goes up or down a version:
version %w(v3 v4), using: :path). Using the array version definition in order to achieve that make it impossible to usegrape-route-helpers, which raisesNoMethodError: undefined method scan for ['v3', 'v4']:Arrayin the lookup process.Steps to reproduce
version %w(v3 v4), using: :pathrake grape:route_helpersAt this point it will raise
NoMethodError: undefined method scan for ['v3', 'v4']:Array. I'm not sure if always taking the last element on the array will make sense in every scenario. I'm willing to work on it, any suggestions?