Closed eblaudez closed 3 years ago
Thanks for the report! This bug has been fixed, just waiting on a release, but you can use the code from the bugfix branch
pip install git+https://github.com/artcg/sanic-openapi.git@s21
Or downgrade to sanic 20.12 while you wait
Describe the bug With sanic 21.3.2 the service (app.run) does not start due to an Attribute Error. Please notice that will work with previous versions of sanic and sanic-openapi (all will be broken after an upgrade of the packages)
Screenshots No screen shot : service does not start
To Reproduce
Expected behavior Service should run (-;
Environment (please complete the following information):
Additional context
Installed sanic modules : sanic==21.3.2 sanic-openapi==0.6.2 sanic-plugin-toolkit==1.0.0 sanic-routing==0.4.2 sanicargs==2.1.0
Traceback of the error : app.run(host=host, port=port,workers=workers) File "/usr/local/lib/python3.8/dist-packages/sanic/app.py", line 918, in run serve_single(server_settings) File "/usr/local/lib/python3.8/dist-packages/sanic/server.py", line 725, in serve_single serve(**server_settings) File "/usr/local/lib/python3.8/dist-packages/sanic/server.py", line 562, in serve trigger_events(after_start, loop) File "/usr/local/lib/python3.8/dist-packages/sanic/server.py", line 352, in trigger_events result = event(loop) File "/home/searchai_svc/.local/lib/python3.8/site-packages/sanic_openapi/swagger.py", line 81, in build_spec if hasattr(route.handler, "view_class"): AttributeError: 'Route' object has no attribute 'handler'