Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [#2918](https://github.com/ruby-grape/grape/pull/2918): Skip the dry-types round trip when a value already is the declared type - [@ericproulx](https://github.com/ericproulx).
* [#2917](https://github.com/ruby-grape/grape/pull/2917): Read path captures out of the router's union match instead of re-running the route's pattern - [@ericproulx](https://github.com/ericproulx).
* [#2921](https://github.com/ruby-grape/grape/pull/2921): Pin the router's request-time isolation regressions through requests instead of its instance variables - [@ericproulx](https://github.com/ericproulx).
* [#2926](https://github.com/ruby-grape/grape/pull/2926): Skip the renamed-params lookup in `declared` when nothing is renamed - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

### 4.0.0 (2026-09-07)
Expand Down
5 changes: 4 additions & 1 deletion lib/grape/declared_params_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ def declare_leaf(passed_params, declared_param:, params_nested_path:, memo:, ren
end
end

# The lookup key is the param's whole path, built fresh -- two Arrays and a
# String per declared param -- and only an API using +as:+ has anything to
# find with it, so the common empty table is not asked.
def build_memo_key(params_nested_path, declared_param, renamed_params)
renamed_param_name = renamed_params[nested_path_for(params_nested_path, declared_param)]
renamed_param_name = renamed_params[nested_path_for(params_nested_path, declared_param)] unless renamed_params.empty?
param = renamed_param_name || declared_param
@stringify ? param.to_s : param.to_sym
end
Expand Down
Loading