mattetti / Weasel-Diesel

DSL to describe, document and test web services
MIT License
438 stars 21 forks source link

Problem with file upload #19

Open ghost opened 11 years ago

ghost commented 11 years ago

it's api code

describe_service "/image" do |service|
  service.formats   :json
  service.http_verb :post
  service.disable_auth # on by default

  #INPUT
  service.param.file  :upload_file

  # OUTPUT
  service.response do |response|
    response.object do |obj|

    end
  end

  # DOCUMENTATION
  service.documentation do |doc|
    doc.overall "test"
  end

  service.implementation do

  end

end

It's file upload page

<html>
<head>
    <title>file upload form</title>
</head>
<body>
<form enctype="multipart/form-data" action="image" method="post">
    Select file:<br>
    <input name="upload_file" type="file"><br>
    <input type="submit" value="upload">
</form>
</body>
</html>

when I upload the file ,get exception

{"error":"Request included unexpected parameter: upload_file"}
theCrab commented 10 years ago

@mattetti any idea why this is a bug?

mattetti commented 10 years ago

Unfortunately, I don't :(

On Wed, Jan 8, 2014 at 1:48 PM, The Crab notifications@github.com wrote:

@mattetti https://github.com/mattetti any idea why this is a bug?

— Reply to this email directly or view it on GitHubhttps://github.com/mattetti/Weasel-Diesel/issues/19#issuecomment-31881280 .

theCrab commented 10 years ago

I am thinking it's down to the service.response block.

dsshap commented 10 years ago

@theCrab were you able to figure this out?