linzhiming0826 / sanic-restful

Simple framework for creating REST APIs
https://sanic-restful-api.readthedocs.io
MIT License
21 stars 9 forks source link

Errors in documentation #1

Closed floriandiud closed 4 years ago

floriandiud commented 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.

Keep the good work!

linzhiming0826 commented 4 years ago

thank you very much. It is already supported in version 0.0.9