miLibris / flask-rest-jsonapi

Flask extension to build REST APIs around JSONAPI 1.0 specification.
http://flask-rest-jsonapi.readthedocs.io
MIT License
598 stars 153 forks source link

Specific decorators #201

Open BnGx opened 3 years ago

BnGx commented 3 years ago

It would be better to implement method-specific decorators to give more flexibility of use as appropriate by transforming this definition:

class PersonList (ResourceDetail):
     decorators = (cached, login_required)

in the following and more customizable definition:

class PersonList (ResourceDetail):
     decorators = {
         'get': (cached,),
         'post': (login_required,),
     }