Skip to content

Commit 9efefe1

Browse files
committed
Fix handling of HTTP status codes from routes
1 parent 9e5720a commit 9efefe1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape-swagger/endpoint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def response_object(route)
220220
end
221221

222222
def http_codes_from_route(route)
223-
if route.http_codes.is_a?(Array) && route.http_codes.any? { |code| code[:code].between?(200, 299) }
223+
if route.http_codes.is_a?(Array) && route.http_codes.any? { |code| code.first.between?(200, 299) }
224224
route.http_codes.clone
225225
else
226226
success_codes_from_route(route) + (route.http_codes || route.options[:failure] || [])

0 commit comments

Comments
 (0)