Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload multiple files with multipart/form-data request #4276

Closed
fsaintma opened this issue Mar 1, 2018 · 2 comments
Closed

Upload multiple files with multipart/form-data request #4276

fsaintma opened this issue Mar 1, 2018 · 2 comments

Comments

@fsaintma
Copy link

fsaintma commented Mar 1, 2018

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? OpenApi 3.0
Which Swagger-UI version? 3.11.0
How did you install Swagger-UI? Hosted on my local machine
Which browser & version? Chrome Version 63.0.3239.108
Which operating system? Linux Ubuntu

Demonstration API definition

 /testmultipart:
    post:
      summary: Send multipart request.
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
              # The property name 'file' will be used for all files.
                file:
                  type: array
                  items:
                    type: string
                    format: binary
      responses:
        '200':
          description: The request has been sended.

Expected Behavior

I try to test a POST multipart/form-data request with swagger-UI and multiple files. I read the OpenAPI specification documentation with File Upload considerations : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#considerations-for-file-uploads

I also give you a corresponding example of curl command:

curl  -X POST -H "Content-Type: multipart/form-data"  -F "file1=@file1" -F "file2=@file2" "http://localhost/testmultipart"

I suppose that when I "Try it out" my request swagger UI must show me multiple "File Upload" widgets.

Current Behavior

Actually Swagger UI propose in request body the following example value model with application/json schema :

{
  "file": [
    "string"
  ]
}
@webron
Copy link
Contributor

webron commented Mar 1, 2018

This is an unimplemented feature yet. Please follow #3641 for progress.

@lock
Copy link

lock bot commented Jul 2, 2019

Locking due to inactivity.

This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.

If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.

Thanks!

@lock lock bot locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants