Ejemplo n.º 1
0
 def wrapped(*args, **kwargs):
     use_args_wrapper = parser.use_args(schema, locations=locations)
     # Function wrapped with use_args
     func_with_args = use_args_wrapper(func)
     ret = func_with_args(*args, **kwargs)
     # Serialize and jsonify the return value
     return jsonify(schema.dump(ret, many=list_view).data)
Ejemplo n.º 2
0
 def wrapped(*args, **kwargs):
     partial = request.method != "POST"
     schema = schema_cls(partial=partial)
     use_args_wrapper = parser.use_args(schema, locations=locations)
     # Function wrapped with use_args
     func_with_args = use_args_wrapper(func)
     ret = func_with_args(*args, **kwargs)
     return schema.dump(ret, many=list_view)