zemfrog.decorators

Module Contents

Functions

http_code(func: Callable) → Callable

Decorator to generate HTTP status response code automatically

api_doc(*args, **kwds) → Callable

See here https://flask-smorest.readthedocs.io/en/latest/api_reference.html#flask_smorest.Blueprint.doc

use_kwargs(*args, **kwds) → Callable

See here https://flask-smorest.readthedocs.io/en/latest/arguments.html

marshal_with(*args, **kwds) → Callable

See here https://flask-smorest.readthedocs.io/en/latest/response.html#

paginate(*args, **kwds) → Callable

See here https://flask-smorest.readthedocs.io/en/latest/pagination.html.

etag(schema=None) → Callable

See here https://flask-smorest.readthedocs.io/en/latest/etag.html

jwt_required(roles={}) → Callable

Decorator to protect views with JWT & user roles.

authenticate(roles={}) → Callable

Decorator to add jwt view authentication to API Docs.

zemfrog.decorators.http_code(func: Callable)Callable[source]

Decorator to generate HTTP status response code automatically according to the key code in json.

Parameters

func – Your view function.

zemfrog.decorators.api_doc(*args, **kwds)Callable[source]

See here https://flask-smorest.readthedocs.io/en/latest/api_reference.html#flask_smorest.Blueprint.doc

zemfrog.decorators.use_kwargs(*args, **kwds)Callable[source]

See here https://flask-smorest.readthedocs.io/en/latest/arguments.html

zemfrog.decorators.marshal_with(*args, **kwds)Callable[source]

See here https://flask-smorest.readthedocs.io/en/latest/response.html#

zemfrog.decorators.paginate(*args, **kwds)Callable[source]

See here https://flask-smorest.readthedocs.io/en/latest/pagination.html.

zemfrog.decorators.etag(schema=None)Callable[source]

See here https://flask-smorest.readthedocs.io/en/latest/etag.html

zemfrog.decorators.jwt_required(roles={})Callable[source]

Decorator to protect views with JWT & user roles.

zemfrog.decorators.authenticate(roles={})Callable[source]

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.