diff --git a/lib/rspec/openapi/extractors/rails.rb b/lib/rspec/openapi/extractors/rails.rb index b5d1309..62c5922 100644 --- a/lib/rspec/openapi/extractors/rails.rb +++ b/lib/rspec/openapi/extractors/rails.rb @@ -12,10 +12,10 @@ def request_attributes(request, example) route, path = find_rails_route(fixed_request) - raise "No route matched for #{fixed_request.request_method} #{fixed_request.path_info}" if route.nil? - return RSpec::OpenAPI::Extractors::Rack.request_attributes(request, example) unless path + raise "No route matched for #{fixed_request.request_method} #{fixed_request.path_info}" if route.nil? + metadata = example.metadata[:openapi] || {} summary = metadata[:summary] || RSpec::OpenAPI.summary_builder.call(example) tags = metadata[:tags] || RSpec::OpenAPI.tags_builder.call(example)