Skip to content

Commit

Permalink
replace request.method for request.request_method
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrieiz committed Apr 23, 2024
1 parent 53ad9b1 commit 5cccb81
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/openapi/extractors/hanami.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class << RSpec::OpenAPI::Extractors::Hanami = Object.new
# @param [RSpec::Core::Example] example
# @return Array
def request_attributes(request, example)
route = Hanami.app.router.recognize(request.path, method: request.method)
route = Hanami.app.router.recognize(request.path, method: request.request_method)

return RSpec::OpenAPI::Extractors::Rack.request_attributes(request, example) unless route.routable?

Expand All @@ -71,7 +71,7 @@ def request_attributes(request, example)

raw_path_params = route.params.filter { |_key, value| RSpec::OpenAPI::Extractors.number_or_nil(value) }

result = InspectorAnalyzer.call(request.method, add_id(path, route))
result = InspectorAnalyzer.call(request.request_method, add_id(path, route))

summary ||= result[:summary]
tags ||= result[:tags]
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/openapi/extractors/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def request_attributes(request, example)
deprecated = metadata[:deprecated]
raw_path_params = request.path_parameters
path = request.path
summary ||= "#{request.method} #{path}"
summary ||= "#{request.request_method} #{path}"
[path, summary, tags, operation_id, required_request_params, raw_path_params, description, security, deprecated]
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/openapi/extractors/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def request_attributes(request, example)
# TODO: Use .except(:controller, :action, :format) when we drop support for Ruby 2.x
raw_path_params = raw_path_params.slice(*(raw_path_params.keys - RSpec::OpenAPI.ignored_path_params))

summary ||= "#{request.method} #{path}"
summary ||= "#{request.request_method} #{path}"

[path, summary, tags, operation_id, required_request_params, raw_path_params, description, security, deprecated]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/openapi/record_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def build(context, example:, extractor:)
request_headers, response_headers = extract_headers(request, response)

RSpec::OpenAPI::Record.new(
http_method: request.method,
http_method: request.request_method,
path: path,
path_params: raw_path_params,
query_params: request.query_parameters,
Expand Down

0 comments on commit 5cccb81

Please sign in to comment.