jmcarp / flask-apispec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'OpenAPIConverter' object has no attribute 'fields2parameters'

anandtripathi5 opened this issue · comments

Suddenly, I am facing issue with flask-apispec and the error looks like this

    docs.register(url.resource)
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/extension.py", line 121, in register
    resource_class_args, resource_class_kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/extension.py", line 68, in _defer
    bound()
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/extension.py", line 143, in _register
    resource_class_kwargs=resource_class_kwargs,
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/apidoc.py", line 42, in convert
    return [self.get_path(rule, target, **kwargs) for rule in rules]
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/apidoc.py", line 42, in <listcomp>
    return [self.get_path(rule, target, **kwargs) for rule in rules]
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/apidoc.py", line 53, in get_path
    for method, view in six.iteritems(operations)
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/apidoc.py", line 54, in <dictcomp>
    if method.lower() in (set(valid_methods) - {'head'})
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/apidoc.py", line 66, in get_operation
    'parameters': self.get_parameters(rule, view, docs, parent),
  File "/usr/local/lib/python3.7/site-packages/flask_apispec/apidoc.py", line 92, in get_parameters
    converter = openapi.fields2parameters
AttributeError: 'OpenAPIConverter' object has no attribute 'fields2parameters'

Libraries used is:

Flask==0.10.1
flask-apispec==0.8.5
Flask-RESTful==0.3.6
marshmallow==2.8.0
webargs==5.5.2

Any solution for this! I have already tried to bump flask-apispec/marshmallow and webargs but no luck

I found the solution, recently the apispec is being installed as version apispec==4.0.0 that is causing a problem. I have installed it back to apispec==3.2.0 and it worked.