sanic-org / sanic-openapi

Easily document your Sanic API with a UI
https://sanic-openapi.readthedocs.io/
MIT License
505 stars 108 forks source link

[Bug]when using in anaconda,find such error:AttributeError: 'Route' object has no attribute 'handler' #222

Closed liuyuzhou closed 3 years ago

liuyuzhou commented 3 years ago

[ERROR] Experienced exception while trying to serve Traceback (most recent call last): File "E:\tools\anaconda\lib\site-packages\sanic\app.py", line 918, in run serve_single(server_settings) File "E:\tools\anaconda\lib\site-packages\sanic\server.py", line 725, in serve_single serve(server_settings) File "E:\tools\anaconda\lib\site-packages\sanic\server.py", line 562, in serve trigger_events(after_start, loop) File "E:\tools\anaconda\lib\site-packages\sanic\server.py", line 352, in trigger_events result = event(loop) File "E:\tools\anaconda\lib\site-packages\sanic_openapi\swagger.py", line 81, in build_spec if hasattr(route.handler, "view_class"): AttributeError: 'Route' object has no attribute 'handler' Traceback (most recent call last): File "F:/workspace/transport_capacity/server_enter.py", line 26, in app.run(host=app_ip_addr, port=app_port, debug=True) File "E:\tools\anaconda\lib\site-packages\sanic\app.py", line 918, in run serve_single(server_settings) File "E:\tools\anaconda\lib\site-packages\sanic\server.py", line 725, in serve_single serve(server_settings) File "E:\tools\anaconda\lib\site-packages\sanic\server.py", line 562, in serve trigger_events(after_start, loop) File "E:\tools\anaconda\lib\site-packages\sanic\server.py", line 352, in trigger_events result = event(loop) File "E:\tools\anaconda\lib\site-packages\sanic_openapi\swagger.py", line 81, in build_spec if hasattr(route.handler, "view_class"): AttributeError: 'Route' object has no attribute 'handler'

artcg commented 3 years ago

dupe of #221

liuyuzhou commented 3 years ago

I use the newest code, the question still. I checkout the newest code. If use pip install,the version it the same as before.

liuyuzhou commented 3 years ago

dupe of #221

So,is the newest code merge to the master branch.

artcg commented 3 years ago

No it is not in master branch, try checking out s21 branch of artcg/sanic-openapi

liuyuzhou commented 3 years ago

it seems I can't see this branch,when will you merge this code to master?