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

Automatically set the location of an argument if it is a file #66

Open
alvarolopez opened this issue Oct 30, 2019 · 0 comments
Open

Automatically set the location of an argument if it is a file #66

alvarolopez opened this issue Oct 30, 2019 · 0 comments

Comments

@alvarolopez
Copy link
Contributor

If I define the following argument and add it to my spec, the Swagger spec and UI correctly renders it (i.e. I can upload a file from the UI, and the spec contains the correct properties).

fields.Field(
    description="Data file to perform inference.",
    required=True,
    location="form",
    type="file"
)

However, files must be sent as multipart/form-data, therefore adding the location="form" is mandatory in such cases.

As a wishlist, this could be avoided if we automatically set location="form" if a defined argument is of type file.

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

No branches or pull requests

1 participant