Hi guys,

I am facing a problem regarding my Swagger Implementation. I am pretty new 
to Swagger, so I probably am making a rookie mistake here.

I use Swagger-js for a NodeJS API. I uploaded my Swagger.yaml as an 
attachement.

The API works fine so far. I am now trying to implement a file upload, but 
when *using the mock* and the editor, I get the message:

ERROR Server not found or an error occurred

and in the console:

Error: Multipart: Boundary not found

    at new Multipart (/Volumes/Transcend/Users/david/dev/projects/
einfachverschickt.de/partner_api/node_modules/busboy/lib/types/multipart.js:
58:11)

    at Multipart (/Volumes/Transcend/Users/david/dev/projects/
einfachverschickt.de/partner_api/node_modules/busboy/lib/types/multipart.js:
26:12)

    at Busboy.parseHeaders (/Volumes/Transcend/Users/david/dev/projects/
einfachverschickt.de/partner_api/node_modules/busboy/lib/main.js:64:22)

    at new Busboy (/Volumes/Transcend/Users/david/dev/projects/
einfachverschickt.de/partner_api/node_modules/busboy/lib/main.js:21:10)

    at multerMiddleware (/Volumes/Transcend/Users/david/dev/projects/
einfachverschickt.de/partner_api/node_modules/multer/lib/make-middleware.js:
32:16)

    at /Volumes/Transcend/Users/david/dev/projects/einfachverschickt.de/
partner_api/node_modules/swagger-tools/middleware/swagger-metadata.js:83:7

    at /Volumes/Transcend/Users/david/dev/projects/einfachverschickt.de/
partner_api/node_modules/swagger-tools/middleware/swagger-metadata.js:302:5

    at /Volumes/Transcend/Users/david/dev/projects/einfachverschickt.de/
partner_api/node_modules/async/lib/async.js:356:13

    at async.forEachOf.async.eachOf (/Volumes/Transcend/Users/david/dev/
projects/einfachverschickt.de/partner_api/node_modules/async/lib/async.js:
233:13)

    at _asyncMap (/Volumes/Transcend/Users/david/dev/projects/
einfachverschickt.de/partner_api/node_modules/async/lib/async.js:355:9)

If I try it *without the mock*, the error gets even more weird.

Via POSTman I try to upload a file from my desktop:
POST /v1/imageUpload HTTP/1.1
Host: 127.0.0.1:7998
api_key: 1
Content-Type: multipart/form-data; 
boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache
Postman-Token: c247f634-7a7c-ad99-429e-81f32fc4e633

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename=""
Content-Type: 


------WebKitFormBoundary7MA4YWxkTrZu0gW--

The swagger validator kicks in and responds with:
{
  "message": "Request validation failed: Parameter (file) is required",
  "code": "REQUIRED",
  "failedValidation": true,
  "path": [
    "paths",
    "/imageUpload",
    "post",
    "parameters",
    "0"
  ],
  "paramName": "file"
}


What am I missing here? I would really appreciate your help.

Kind regards,
David

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: swagger.yaml
Description: Binary data

Reply via email to