ashleysommer / sanic-restplus

Fully featured framework for fast, easy and documented API development with Sanic
http://flask-restplus.readthedocs.org
Other
104 stars 14 forks source link

sanic-restplus breaks on sanic 19.12.2 #17

Closed DavidBord closed 3 years ago

DavidBord commented 4 years ago

Run the quick start example on Sanic 19.12.2 and got this error message:

[2020-01-28 07:26:29 +0200] [53084] [INFO] Goin' Fast @ http://127.0.0.1:8000
[2020-01-28 07:26:29 +0200] [53084] [INFO] Starting worker [53084]
KeyError('PROPAGATE_EXCEPTIONS')
[2020-01-28 07:26:31 +0200] [53084] [ERROR] Exception occurred while handling uri: 'http://localhost:8000/todos'
Traceback (most recent call last):
  File "/Users/db/venvs/untitled3/lib/python3.7/site-packages/sanic/app.py", line 946, in handle_request
    request, request_name=name
TypeError: _run_request_middleware() got an unexpected keyword argument 'request_name'
[2020-01-28 07:26:31 +0200] - (sanic.access)[INFO][127.0.0.1:49633]: GET http://localhost:8000/todos  500 144
ashleysommer commented 4 years ago

Hi @DavidBord

I should put a notice in the Readme on the GitHub landing page about this.

It is related to this issue: https://github.com/ashleysommer/sanicpluginsframework/issues/15 Unfortunately the latest released version of Sanic-Plugins-Framework doesn't work on Sanic 19.12.0.

You can get around the problem by manually updating to the latest beta SPF.

DavidBord commented 4 years ago

Hi, Thanks for the quick reply. For the latest beta SPF I get the following exception:

    rest_assoc.api(api)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/restplus.py:10: in api
    return plug.api(reg, *args, api_class=api_class, **kwargs)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/restplus.py:76: in api
    api.init_api(reg, **kwargs)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:212: in init_api
    self._init_app(app, context)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:222: in _init_app
    self._register_specs()
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:273: in _register_specs
    resource_class_args=(self, )
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:354: in _register_view
    spf._plugin_register_route(resource_func, restplus, context, rule,
E   AttributeError: 'SanicPluginsFramework' object has no attribute '_plugin_register_route'
ashleysommer commented 4 years ago

Hi @DavidBord Thanks for the report. I forgot that Sanic-Restplus will need some modification to work with the new SPF version. I'm working on a new Beta release today that should fix it.

ashleysommer commented 4 years ago

@DavidBord I've just pushed two new versions.