Problem
Neither PR #145 nor #146 leaves this dead code on its own, but merging both does. #145 refactored the old body-detection check into two helpers on ParamLocationResolver:
def self.body_param?(spec)
body_annotation?(spec) || [Hash, "Hash"].include?(spec[:type])
end
def self.body_annotation?(spec)
explicit_location(spec) == "body"
end
#146 independently replaced build_flat_params's call site (next if location_resolver.body_param?(spec)) with a direct type check (next if [Hash, "Hash"].include?(spec[:type])). Once both land, body_param? has zero callers in lib/ or test/, and body_annotation? is only called by the now-dead body_param?.
Fix
Delete both methods from lib/grape_oas/api_model_builders/request_params_support/param_location_resolver.rb in a follow-up commit, and confirm no other callers exist via a repo-wide search first.
Why this matters
Left in place, the methods are harmless today but are a trap: someone could later wire body_param? back into a call site without realizing it silently reintroduces the bug #146 fixed (path parameters inheriting param_type: "body" from an outer group getting skipped).
Problem
Neither PR #145 nor #146 leaves this dead code on its own, but merging both does. #145 refactored the old body-detection check into two helpers on
ParamLocationResolver:#146 independently replaced
build_flat_params's call site (next if location_resolver.body_param?(spec)) with a direct type check (next if [Hash, "Hash"].include?(spec[:type])). Once both land,body_param?has zero callers inlib/ortest/, andbody_annotation?is only called by the now-deadbody_param?.Fix
Delete both methods from
lib/grape_oas/api_model_builders/request_params_support/param_location_resolver.rbin a follow-up commit, and confirm no other callers exist via a repo-wide search first.Why this matters
Left in place, the methods are harmless today but are a trap: someone could later wire
body_param?back into a call site without realizing it silently reintroduces the bug #146 fixed (path parameters inheritingparam_type: "body"from an outer group getting skipped).