Swagger-editor: Request multipart/form-data without boundary

Created on 8 Jul 2016  ยท  3Comments  ยท  Source: swagger-api/swagger-editor

My Swagger

"/users":
    post:
      description: "ํšŒ์› ๊ฐ€์ž…(์œ ์ € ์ƒ์„ฑ)"
      tags:
        - Users
      consumes: [
        "multipart/form-data",
        "application/x-www-form-urlencoded"
      ]
      produces:
        - application/json
      parameters:
        -
          name: email
          in: formData
          required: true
          description: "๊ฐ€์ž… ์ด๋ฉ”์ผ"
          type: string
        -
          name: password
          in: formData
          required: true
          description: "๊ฐ€์ž… ๋น„๋ฐ€๋ฒˆํ˜ธ"
          type: string
        -
          name: gender
          in: formData
          required: true
          description: "์„ฑ๋ณ„ 'm' or 'f'"
          type: string
        -
          name: location
          in: formData
          required: true
          description: "์ง€์—ญ ์ •๋ณด '์„œ์šธ', '์ธ์ฒœ', '๊ฒฝ๊ธฐ๋„'..."
          type: string
        -
          name: name
          in: formData
          required: true
          description: "์ด๋ฆ„"
          type: string
        -
          name: age
          in: formData
          required: true
          description: "๋‚˜์ด"
          type: integer
        -
          name: avatar
          in: formData
          required: true
          description: "ํ”„๋กœํ•„ ์‚ฌ์ง„"
          type: file

      responses:
        200:
          description: OK
  • Swagger Editor version(from Help > About menu): 2.10.1
  • My browser: Chrome

Issue

multipart/form-data request is sent without any boundaries or multipart information. so parameters are messed up. see below

2016-07-08 2 43 17

My app server accepts like this.

Parameters: {"email: [email protected]\npassword: asdfasdf\ngender: m\nlocation: seoul\nname: aaaa\nage: 55\navatar: C:\\fakepath\\images-2.jpg"=>"[FILTERED]"}

I read #666 and #599 but i can't find any solution.

Is there any progress in this issue?

file upload bug

Most helpful comment

Thanks for reporting.
Try operation and file uploads have some bugs. I think we should refactor the file upload piece.

All 3 comments

Thanks for reporting.
Try operation and file uploads have some bugs. I think we should refactor the file upload piece.

Tried swagger for the first time today and immediately hit this bug. It affects the swagger UI and also the client code generators that I tried; C# and typescript node.

I have made some improvements in file parameters. Please check to see if it has fixed this issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

confuser picture confuser  ยท  6Comments

gerbsen picture gerbsen  ยท  3Comments

marcopiraccini picture marcopiraccini  ยท  3Comments

SteveNewhouse picture SteveNewhouse  ยท  5Comments

jemerald picture jemerald  ยท  4Comments