Skip to content

No way to specify a 'body' parameter for a PUT request #42

Closed
@abkonsta

Description

@abkonsta

Because of the following code in grape-swagger.rb, around line 126:

paramType = path.match(":#{param}") ? 'path' : (method == 'POST') ? 'body' : 'query'

you cannot have a nice swagger UI for a PUT method with a text box for body. Should the above be amended to be something like this:

paramType = path.match(":#{param}") ? 
  'path' : (method == 'POST' || method == 'PUT') ? 'body' : 'query'

or should we introduce a DSL way to specify param type of 'body', something along the lines of

params do
  optional :body, body: true, desc: 'This parameter is the body of the request'
end

I am willing to submit a pull request once an acceptable approach is determined..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions