Open pratik261199 opened 1 year ago
Traceback (most recent call last):
File "/Users/pratikghodke/test_project.py", line 63, in <module>
docs.register(CatResource, endpoint='CatResource')
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/extension.py", line 127, in register
self._defer(self._register, target, endpoint, blueprint,
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/extension.py", line 71, in _defer
bound()
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/extension.py", line 147, in _register
paths = self.resource_converter.convert(
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/apidoc.py", line 39, in convert
return [self.get_path(rule, target, **kwargs) for rule in rules]
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/apidoc.py", line 39, in <listcomp>
return [self.get_path(rule, target, **kwargs) for rule in rules]
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/apidoc.py", line 43, in get_path
parent = self.get_parent(target, **kwargs)
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/apidoc.py", line 144, in get_parent
return resolve_resource(resource, **kwargs)
File "/Users/pratikghodke/.virtualenvs/test_env/lib/python3.8/site-packages/flask_apispec/utils.py", line 10, in resolve_resource
return resource(*resource_class_args, **resource_class_kwargs)
TypeError: __init__() missing 1 required positional argument: 'pet_name'
I have upgraded my packages to: flask-2.2.2 injector-0.20.1 Flask-injector-0.14.1 apispec-6.0.2 flask-apispec-0.11.4
I'm using Flask-apispec to auto-generate api documentation, and I'm using injector library. both independently works well in my code but when I use them together, it throws the error missing positional argument. I tried to debug the code, in stack trace, it skips the inject decorator.
Here is a sample code
Everything works well if I comment out the "docs.register(CatResource, endpoint='CatResource')"' Note: Everything was working fine before upgrading libraries to the latest