def METHOD_NAME(payload: Json, variables: VariableMap) -> Json:
    # Sort so that we process the variable with the longest-length bindings first.
    variable_bindings = sorted(
        variables.items(), key=lambda kv: len(kv[1]), reverse=True
    )
    for variable, value in variable_bindings:
        # pyre-fixme[53]: Captured variable `value` is not annotated.
        def uninterpolate(json: JsonScalar) -> JsonScalar:
            if isinstance(json, str):
                return json.replace(value, "${" + variable + "}")
            else:
                return json
        payload = map_json_scalars(json=payload, f=uninterpolate)
    return payload