(variable)
return _temp
同层次参数中，存在引用关系就先赋值
    eg:
        phone:123
        name:$phone
        => phone:123
           name:123
同层次参数中，存在引用关系就先赋值
    eg:
        phone:123
        name:$phone
        => phone:123
           name:123
同层次参数中，存在引用关系就先赋值 eg : phone : 123 name : $phone = > phone : 123 name : 123
def convert(variable):
    """ 同层次参数中，存在引用关系就先赋值
    eg:
        phone:123
        name:$phone
        => phone:123
           name:123
    """
    _temp = json.dumps(variable)
    content = {v['key']: v['value'] for v in variable if v['key'] != ''}
    for variable_name in extract_variables(_temp):
        if content.get(variable_name):
            # content contains one or several variables
            _temp = _temp.replace(
                "${}".format(variable_name),
                str(content.get(variable_name)), 1
            )
            content = {v['key']: v['value'] for v in json.loads(_temp) if v['key'] != ''}

    return _temp
def convert ( variable ) : _temp = json . dumps ( variable ) content = { v [ 'key' ] : v [ 'value' ] for v in variable if v [ 'key' ] != '' } for variable_name in extract_variables ( _temp ) : if content . get ( variable_name ) : # content contains one or several variables _temp = _temp . replace ( "${}" . format ( variable_name ) , str ( content . get ( variable_name ) ) , 1 ) content = { v [ 'key' ] : v [ 'value' ] for v in json . loads ( _temp ) if v [ 'key' ] != '' } return _temp