lib/grape-swagger/endpoint.rb in grape-swagger-0.30.0 vs lib/grape-swagger/endpoint.rb in grape-swagger-0.30.1

- old
+ new

@@ -198,10 +198,13 @@ codes.map! { |x| x.is_a?(Array) ? { code: x[0], message: x[1], model: x[2], examples: x[3], headers: x[4] } : x } codes.each_with_object({}) do |value, memo| value[:message] ||= '' memo[value[:code]] = { description: value[:message] } + + memo[value[:code]][:headers] = value[:headers] if value[:headers] + next build_file_response(memo[value[:code]]) if file_response?(value[:model]) response_model = @item response_model = expose_params_from_model(value[:model]) if value[:model] @@ -215,10 +218,9 @@ @definitions[response_model][:description] = description_object(route) memo[value[:code]][:schema] = build_reference(route, value, response_model) memo[value[:code]][:examples] = value[:examples] if value[:examples] - memo[value[:code]][:headers] = value[:headers] if value[:headers] end end def success_code?(code) status = code.is_a?(Array) ? code.first : code[:code]