Skip to content

Commit 13ba274

Browse files
author
Jan Hecking
committed
tim-vandecasteele/grape-swagger#26: POST params
Change POST parameters from type 'body' to type 'form'. This allows multiple POST parameters to be submitted via swagger UI using application/x-www-form-urlencoded media type.
1 parent 99f23d3 commit 13ba274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape-swagger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def parse_params(params, path, method)
123123
dataType = value.is_a?(Hash) ? value[:type]||'String' : 'String'
124124
description = value.is_a?(Hash) ? value[:desc] : ''
125125
required = value.is_a?(Hash) ? !!value[:required] : false
126-
paramType = path.match(":#{param}") ? 'path' : (method == 'POST') ? 'body' : 'query'
126+
paramType = path.match(":#{param}") ? 'path' : (method == 'POST') ? 'form' : 'query'
127127
name = (value.is_a?(Hash) && value[:full_name]) || param
128128
{
129129
paramType: paramType,

0 commit comments

Comments
 (0)