Skip to content

Commit

Permalink
Fix ID not found
Browse files Browse the repository at this point in the history
  • Loading branch information
laerciosb committed Apr 21, 2024
1 parent 94bcc49 commit 92f7257
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rspec/openapi/extractors/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ def find_rails_route(request, app: Rails.application, path_prefix: '')
path = route.path.spec.to_s.delete_suffix('(.:format)')

if route.app.matches?(request)
path_id = add_id(request.path, parameters)
if route.app.engine?
route, path = find_rails_route(request, app: route.app.app, path_prefix: path)
next if route.nil?
elsif path_prefix + path == add_id(request.path, parameters)
elsif path_prefix + path == path_id
return [route, path_prefix + path]
else
return [route, nil]
return [route, path_id]
end
return [route, path_prefix + path]
end
Expand Down

0 comments on commit 92f7257

Please sign in to comment.