def json_input(f):
@wraps(f)<EOL>def json_input_decorator(*args, **kwargs):<EOL><INDENT>task_data = _get_data_from_args(args)<EOL>if task_data is None:<EOL><INDENT>logging.error("<STR_LIT>")<EOL><DEDENT>if task_data.payload:<EOL><INDENT>try:<EOL><INDENT>is_transformed = request.get_json()<EOL>if not is_transformed:<EOL><INDENT>task_data.transform_payload(json.loads)<EOL><DEDENT><DEDENT>except (ValueError, RuntimeError):<EOL><INDENT>logging.error(<EOL>"<STR_LIT>")<EOL>task_data.transform_payload(json.loads)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>task_data.transform_payload(lambda _: {})<EOL><DEDENT>return f(*args, **kwargs)<EOL><DEDENT>return json_input_decorator<EOL>
Expects task input data in json format and parse this data.