:mod:`zemfrog.decorators` ========================= .. py:module:: zemfrog.decorators Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: zemfrog.decorators.http_code zemfrog.decorators.api_doc zemfrog.decorators.use_kwargs zemfrog.decorators.marshal_with zemfrog.decorators.paginate zemfrog.decorators.etag zemfrog.decorators.jwt_required zemfrog.decorators.authenticate .. function:: http_code(func: Callable) -> Callable Decorator to generate HTTP status response code automatically according to the key ``code`` in json. :param func: Your view function. .. function:: api_doc(*args, **kwds) -> Callable See here https://flask-smorest.readthedocs.io/en/latest/api_reference.html#flask_smorest.Blueprint.doc .. function:: use_kwargs(*args, **kwds) -> Callable See here https://flask-smorest.readthedocs.io/en/latest/arguments.html .. function:: marshal_with(*args, **kwds) -> Callable See here https://flask-smorest.readthedocs.io/en/latest/response.html# .. function:: paginate(*args, **kwds) -> Callable See here https://flask-smorest.readthedocs.io/en/latest/pagination.html. .. function:: etag(schema=None) -> Callable See here https://flask-smorest.readthedocs.io/en/latest/etag.html .. function:: jwt_required(roles={}) -> Callable Decorator to protect views with JWT & user roles. .. function:: authenticate(roles={}) -> Callable Decorator to add jwt view authentication to API Docs. Reference: https://github.com/tiangolo/full-stack-flask-couchdb/tree/master/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/api/api_v1.