muffineer.middlewares.json_handling module

class muffineer.middlewares.json_handling.JSONTranslator[source]

Bases: object

Serializes Json Object and optionally validates it with Marshmallow

process_request(req, resp)[source]
process_resource(req, resp, resource, params)[source]

Process the request after routing.

Note:
This method is only called when the request matches a route to a resource.
Parameters:
  • req – Request object that will be passed to the routed responder.
  • resp – Response object that will be passed to the responder.
  • resource – Resource object to which the request was routed.
  • params – A dict-like object representing any additional params derived from the route’s URI template fields, that will be passed to the resource’s responder method as keyword arguments.
process_response(req, resp, resource)[source]
Parameters:
  • req
  • resp
  • resource
Returns:

class muffineer.middlewares.json_handling.RequireJSON[source]

Bases: object

process_request(req, resp)[source]