Closed floriandiud closed 4 years ago
Hello, Thanks for open sourcing this project, it's nice!
A small post to improve the method-decorators section in the "extending" documentation. https://github.com/linzhiming0826/sanic-restful/blob/master/docs/source/extending.rst#resource-method-decorators
In the authenticate example, you use the sanic_restful_api.abort(401) without adding a message param https://github.com/linzhiming0826/sanic-restful/blob/master/sanic_restful_api/init.py#L19 And the method_decorators = [authenticate] # applies to all inherited resources does't work. Only a dict with the HTTP methods works The https://github.com/linzhiming0826/sanic-restful/blob/master/sanic_restful_api/__init__.py#L270 Also, in the Resource docstring, the example method_decorators = {'get': login_require} is not valid. Only list are accepted.
sanic_restful_api.abort(401)
method_decorators = [authenticate] # applies to all inherited resources
method_decorators = {'get': login_require}
Keep the good work!
thank you very much. It is already supported in version 0.0.9
Hello, Thanks for open sourcing this project, it's nice!
A small post to improve the method-decorators section in the "extending" documentation. https://github.com/linzhiming0826/sanic-restful/blob/master/docs/source/extending.rst#resource-method-decorators
In the authenticate example, you use the
sanic_restful_api.abort(401)
without adding a message param https://github.com/linzhiming0826/sanic-restful/blob/master/sanic_restful_api/init.py#L19 And themethod_decorators = [authenticate] # applies to all inherited resources
does't work. Only a dict with the HTTP methods works The https://github.com/linzhiming0826/sanic-restful/blob/master/sanic_restful_api/__init__.py#L270 Also, in the Resource docstring, the examplemethod_decorators = {'get': login_require}
is not valid. Only list are accepted.Keep the good work!