flasgger / flasgger

Easy OpenAPI specs and Swagger UI for your Flask API

Home Page:http://flasgger.pythonanywhere.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flassger support for parameter type:file

DaniloMurbach opened this issue · comments

Hello, is there any way to use flasgger to have a parameter type as File ?

For example here is the yml :

Get The Audio Transcription

tags:

  • My TAG API
    consumes:
  • multipart/form-data
    parameters:
  • name: audiofile
    in: formData
    type: file
    required: true
    description: The audio file to upload
    responses:
    200:
    description: OK
    schema:
    key: file

Here is how the swagger looks with this yaml

Screen Shot 2023-12-15 at 00 56 42

However any time that i try to use it i can see the following error

Traceback (most recent call last):
File "/Users/danilomurbach/Library/Python/3.9/lib/python/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/Users/danilomurbach/Library/Python/3.9/lib/python/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/danilomurbach/Library/Python/3.9/lib/python/site-packages/flask/app.py", line 1821, in full_dispatch_request
rv = self.preprocess_request()
File "/Users/danilomurbach/Library/Python/3.9/lib/python/site-packages/flask/app.py", line 2313, in preprocess_request
rv = self.ensure_sync(before_func)()
File "/Users/danilomurbach/Library/Python/3.9/lib/python/site-packages/flasgger/base.py", line 677, in before_request
type=self.SCHEMA_TYPES[
KeyError: 'file'

Here is my pip freeze:
flasgger==0.9.5
Flask==2.2.5
Flask-Cors==3.0.10
Flask-RESTful==0.3.9
flask-restplus==0.13.0
Flask-SQLAlchemy==3.0.5
flask-swagger==0.2.14
jsonify==0.5
jsonschema==4.17.3
Werkzeug==3.0.1