Upgrade Grape v1.1.0 to v1.3.2
This brings in Ruby 2.7 support and a number of fixes: https://github.com/ruby-grape/grape/blob/master/CHANGELOG.md
- Move all inherited
Grape::API->Grape::API::Instance - Remove use of Virtus since this has been removed from Grape.
- Extract
Rack::Responsefrom API error - Grape v1.2.3 pulled in a fix used in
SafeFile: https://github.com/ruby-grape/grape/pull/1844, so we no longer need to maintain our custom type. - Adapt
WorkhorseFilewith the latest changes to make custom types work with Grape and dry-types. - Ensure
Array[String]is coerced properly.
The change from Virtus to dry-types now requires all strings to be coerced to arrays. Before this was done within Virtus.
- Coerce
Array[Integer]types to arrays of integers
The change from Virtus to dry-types now requires all strings to be coerced to arrays of integers. Before this was done within Virtus.
Rubocop
This merge request also introduces two Rubocop rules for Grape v1.3:
-
Grape::API::Instanceinstead ofGrape::APIis required, unless we solve #215230. -
Grape parameters defined with
Arraytypes (e.g.Array[String],Array[Integer]) must have acoerce_withblock or they will fail to parse properly. See https://github.com/ruby-grape/grape/blob/master/UPGRADING.md for more details.
Closes #195960 (closed)