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

does not support upload #168

Open
yumen opened this issue Nov 3, 2017 · 2 comments
Open

does not support upload #168

yumen opened this issue Nov 3, 2017 · 2 comments

Comments

@yumen
Copy link

@yumen yumen commented Nov 3, 2017

"""
test
---
tags:
  - test
parameters:
  - in: file
    name: formData
    
    type: file
    required: true    
    
responses:
  200:
    description:
"""

hello,this is my yaml,it can not upload file succ,I saw the request payload not have "Content-Disposition" when the post request,is this a bug?need you help and can you give me a upload example,thanks very much.

@DarkSuniuM
Copy link

@DarkSuniuM DarkSuniuM commented Jul 2, 2019

** Bump **
I also have the same problem, tried @yumen's way, didn't work
Also tried this way:

requestBody:
  content:
    multipart/form-data:
      schema:
        properties:
          file:
            type: string
            required: true
            format: binary

According to this SO Answer, The definition is correct and the problem is with the current UI and Editor version.

I also tried to change the UI Version to 3 using this method, but it didn't make uploads work

@ongopongo
Copy link

@ongopongo ongopongo commented Apr 6, 2020

File uploads are working for me.

Here's the relevant part of my Flasgger YAML snippet in my function docstring:

    Upload a file.
    ---
    tags: [SomeTag]
    consumes: [multipart/form-data]
    parameters:
        - name: file
          in: formData
          required: true
          type: file
          description: The file you want to store

As a result, the Swagger UI shows a file upload field.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.