Skip to content

Fix middleware with keywords #2546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 9, 2025

Conversation

ericproulx
Copy link
Contributor

@ericproulx ericproulx commented Mar 8, 2025

This PR fix #2544. It adds the ruby2_keyword_hash flag dynamically since its serialized in the namespace_stackable. Contrary to Rails, when calling use, insert, insert_before, its serializing the arguments and not calling the stack. Thus, ruby2_keywords have no meaning in Grape's stack.

Flag hash arg with `ruby2_keywords_hash`
Add spec
@ericproulx ericproulx marked this pull request as ready for review March 8, 2025 10:03
@klass = klass
@args = args
@block = block
end

def name; klass.name; end # rubocop:disable Style/SingleLineMethods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems silly to stick it to 1 line and disable a rubocop rule on it.

@dblock dblock merged commit 97f2413 into ruby-grape:master Mar 9, 2025
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled keyword arguments for attaching middleware
2 participants