Remove namespace_reverse_stackable from public DSL interface #2602
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.
Remove namespace_reverse_stackable from public DSL interface
Summary
This PR removes the
namespace_reverse_stackable
method from the public DSL interface inGrape::DSL::Settings
and replaces its usage with direct access toinheritable_setting.namespace_reverse_stackable
.Changes Made
DSL Interface Changes
namespace_reverse_stackable
method fromGrape::DSL::Settings
Grape::DSL::Desc
to use direct inheritable_setting access instead ofnamespace_setting
Grape::DSL::RequestResponse
to use direct inheritable_setting access for rescue handlersTest Improvements
request_response_spec.rb
by extendingGrape::DSL::Settings
instead of manually stubbing methodsBenefits
Files Modified
lib/grape/dsl/desc.rb
- Use direct inheritable_setting accesslib/grape/dsl/request_response.rb
- Use direct inheritable_setting access for rescue handlerslib/grape/dsl/settings.rb
- Remove namespace_reverse_stackable methodspec/grape/dsl/request_response_spec.rb
- Update tests to verify actual behaviorBreaking Changes
This change removes a public method from the DSL interface. However, this method was primarily used internally and direct access to
inheritable_setting.namespace_reverse_stackable
provides the same functionality.Testing
All existing tests pass with the updated implementation. The rescue_from functionality continues to work as expected with the new direct access pattern.