arjun-g / vs-swagger-viewer

Swagger Viewer lets you preview and validate Swagger 2.0 and OpenAPI files as you type in Visual Studio Code.
MIT License
170 stars 47 forks source link

multipart file upload not working #53

Open tuxedo0801 opened 5 years ago

tuxedo0801 commented 5 years ago

I have the following OAS3 snippet in my YAML:

  /task:
    post:
      tags:
        - app
      summary: create task
      operationId: createTask
      description: |
        todo
      responses:
        '200':
          description: OK
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                offerNumber: # metadata part
                  description: 'offernumber which has been created upfront'
                  type: string
                  example: '20180042'
                trayImages: # image part
                  type: array
                  items:
                    type: string
                    format: base64
              required:
                - offerNumber
                - trayImages
            encoding:
              trayImages:
                contentType: image/png, image/jpeg
        required: true

When display this on swaggerhub.com, it shows correctly:

image

When showing the same YAML in VScode with latest Swagger Viewer, it looks like this:

51120191-d7c5fc80-1814-11e9-99dd-ebf52828a375

the part with the requestbody and the multipart file upload is totally missing. When I click on try-it-out it's getting worse. On Swaggerhib I can add multiple files to the request.

A few months ago, I had the same issue on swaggerhub. Now they have fixed it.

Can you please fix this as well?

joschiwald commented 5 years ago

Looks like fixed in ad75d4cbe6264252765573ba2543def0ed8ccd1e Try out version 2.2.2