def json_opt_filter_str(key): val = flask.request.json.get(key) return None if val is None else filter_str(val)
def json_filter_str(key): return filter_str(flask.request.json[key])