Repository navigation
Conversation
…the Faraday middleware Signed-off-by: Inf1mum <vadimlazuk5@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25722
Configuration#use(middleware, *args, &block)collapsed keyword arguments into a positional Hash, andconfigure_faradayreplayed them positionally — a middleware withinitialize(app, app_key:)(like the README's ownOvhSignatureexample) raisedArgumentError: wrong number of arguments.usenow stores[middleware, args, kwargs, block]and the replay forwards*args, **kwargs, █ empty-kwargs forwarding is a no-op on Ruby >= 3.0, and legacy positional-hash callers keep working unchanged. Generatedconfiguration.rbfor petstore and ruby-nextgen-qdrant regenerated; the middleware-seam generator test extended to assert the kwargs forwarding.Verified end-to-end on Ruby 4.0.10 + faraday 2.15.1 (the issue's versions): the middleware receives
app_key:as a true kwarg through a real request, legacy positional-hash middlewares unaffected.RubyNextgenClientCodegenTest24/24; sample rspec 23/23.Summary by cubic
Fixes #25722 by making
Configuration#useforward keyword arguments as real kwargs to Faraday middlewares instead of collapsing them into a positional Hash, which broke middlewares with keyword-only initializers like the README'sOvhSignature.use(middleware, *args, &block)is nowuse(middleware, *args, **kwargs, &block); the stored tuple includes kwargs, and the replay forwards**mw_kwargs.configuration.rbsamples and extended the middleware-seam generator test to assert kwargs forwarding.Written for commit 31c9633. Summary will update on new commits.