jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

TypeError: schema2parameters() got an unexpected keyword argument 'default_in' #203

Closed aprilahijriyan closed 4 years ago

aprilahijriyan commented 4 years ago

I have a simple project to build a REST API, but something goes wrong.

Reproduction step:

$ pip install zemfrog
$ zemfrog create test_zemfrog
$ cd test_zemfrog
$ pip install flask-apispec
$ pip install -r requirements.txt
$ flask

Output:

Traceback (most recent call last):
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask/cli.py", line 556, in list_commands
    rv.update(info.load_app().cli.list_commands(ctx))
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask/cli.py", line 392, in load_app
    app = locate_app(self, import_name, None, raise_if_not_found=False)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask/cli.py", line 240, in locate_app
    __import__(module_name)
  File "/home/titiw/test_zemfrog/wsgi.py", line 3, in <module>
    app = create_app(__name__)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/zemfrog/app.py", line 43, in create_app
    loader.load_docs(app)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/zemfrog/loader.py", line 164, in load_docs
    docs.register(view, blueprint=name)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/extension.py", line 125, in register
    resource_class_args, resource_class_kwargs)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/extension.py", line 72, in _defer
    bound()
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/extension.py", line 140, in _register
    paths = self.view_converter.convert(target, endpoint, blueprint)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/apidoc.py", line 39, in convert
    return [self.get_path(rule, target, **kwargs) for rule in rules]
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/apidoc.py", line 39, in <listcomp>
    return [self.get_path(rule, target, **kwargs) for rule in rules]
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/apidoc.py", line 53, in get_path
    for method, view in operations.items()
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/apidoc.py", line 54, in <dictcomp>
    if method.lower() in (set(valid_methods) - excluded_methods)
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/apidoc.py", line 66, in get_operation
    'parameters': self.get_parameters(rule, view, docs, parent),
  File "/home/titiw/test_zemfrog/venv/lib/python3.6/site-packages/flask_apispec/apidoc.py", line 99, in get_parameters
    extra_params += converter(schema, **options) if args else []
TypeError: schema2parameters() got an unexpected keyword argument 'default_in'

Anyone can help me? thank you!

Regards, April

aprilahijriyan commented 4 years ago

Problem solved at #202