File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def self.setup(options)
78
78
:summary => route . route_description || '' ,
79
79
:nickname => Random . rand ( 1000000 ) ,
80
80
:httpMethod => route . route_method ,
81
- :parameters => parse_params ( route . route_params )
81
+ :parameters => parse_params ( route . route_params , route . route_path , route . route_method )
82
82
} ]
83
83
}
84
84
end
@@ -95,12 +95,14 @@ def self.setup(options)
95
95
96
96
97
97
helpers do
98
- def parse_params ( params )
98
+ def parse_params ( params , path , method )
99
99
params . map do |param , value |
100
+ value [ :type ] = 'file' if value . is_a? ( Hash ) && value [ :type ] == 'Rack::Multipart::UploadedFile'
101
+
100
102
dataType = value . is_a? ( Hash ) ? value [ :type ] ||'String' : 'String'
101
103
description = value . is_a? ( Hash ) ? value [ :desc ] : ''
102
104
required = value . is_a? ( Hash ) ? !!value [ :required ] : false
103
- paramType = 'path'
105
+ paramType = path . match ( ": #{ param } " ) ? 'path' : ( method == 'POST' ) ? 'body' : 'query '
104
106
{
105
107
paramType : paramType ,
106
108
name : param ,
You can’t perform that action at this time.
0 commit comments