Class: GrapeSwagger::DocMethods::FileParams

Inherits:
Object
  • Object
show all
Defined in:
lib/grape-swagger/doc_methods/file_params.rb

Class Method Summary collapse

Class Method Details

.includes_file_param?(params) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/grape-swagger/doc_methods/file_params.rb', line 7

def includes_file_param?(params)
  return params.any? { |x| x[:type] == 'file' }
end

.to_formdata(params) ⇒ Object



11
12
13
# File 'lib/grape-swagger/doc_methods/file_params.rb', line 11

def to_formdata(params)
  params.each { |x| x[:in] = 'formData' if x[:in] == 'body' }
end