Skip to content

Update Releases API for Grape 1.7 compatibility

Vasilii Iakliushin requested to merge 395809_fix_releases_api into master

What does this MR do and why?

Contributes to #395809 (closed)

Problem

There is a change to parameter renaming functionality in Grape >= 1.6.0. https://github.com/ruby-grape/grape/blob/master/UPGRADING.md#upgrading-to--160

We need to update parameters for compatibility reasons.

When we send direct_asset_path (expected param) to Releases API, Grape converts it to filepath and applies necessary validations. Both Grape versions 1.5.2 and 1.7.0 treat it equally.

However, when we send filepath (deprecated param). Grape 1.7.0 removes it from the declared_params list, because it expects to receive direct_asset_path. But current version 1.5.2 doesn't remove it from declared_params.

Another problem - usage of params instead of declared_params.

Solution

Don't use as for parameters renaming. Instead define two separate params and redefine them.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vasilii Iakliushin

Merge request reports

Loading