diff --git a/lib/rspec/openapi/extractors/hanami.rb b/lib/rspec/openapi/extractors/hanami.rb index 2884fc5..668eb0d 100644 --- a/lib/rspec/openapi/extractors/hanami.rb +++ b/lib/rspec/openapi/extractors/hanami.rb @@ -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? @@ -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] diff --git a/lib/rspec/openapi/extractors/rack.rb b/lib/rspec/openapi/extractors/rack.rb index 21b9752..4858a49 100644 --- a/lib/rspec/openapi/extractors/rack.rb +++ b/lib/rspec/openapi/extractors/rack.rb @@ -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 diff --git a/lib/rspec/openapi/extractors/rails.rb b/lib/rspec/openapi/extractors/rails.rb index b5d1309..adb2d80 100644 --- a/lib/rspec/openapi/extractors/rails.rb +++ b/lib/rspec/openapi/extractors/rails.rb @@ -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 diff --git a/lib/rspec/openapi/record_builder.rb b/lib/rspec/openapi/record_builder.rb index 32adf97..0e5c1a9 100644 --- a/lib/rspec/openapi/record_builder.rb +++ b/lib/rspec/openapi/record_builder.rb @@ -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,