src/swagger2x.py
def find_key(rec_dict, target, depth=0):
    """
    find key "target" in recursive dict
    :param rec_dict: dict to search in, json schema dict, so it is combination of dict and arrays
    :param target: target key to search for
    :param depth: depth of the search (recursion)
    :return:
    """
    try:
        if isinstance(rec_dict, dict):
            for key, value in rec_dict.items():
                if key == target:
                    return rec_dict[key]
            for key, value in rec_dict.items():
                r = find_key(value, target, depth + 1)
                if r is not None:
                    return r
    except:
        traceback.print_exc()

    find key "target" in recursive dict
    :param rec_dict: dict to search in, json schema dict, so it is combination of dict and arrays
    :param target: target key to search for
    :param depth: depth of the search (recursion)
    :return:
    
find key "target" in recursive dict
find key " target " in recursive dict
def find_key(rec_dict, target, depth=0):
    try:
        if isinstance(rec_dict, dict):
            for key, value in rec_dict.items():
                if key == target:
                    return rec_dict[key]
            for key, value in rec_dict.items():
                r = find_key(value, target, depth + 1)
                if r is not None:
                    return r
    except:
        traceback.print_exc()
def find_key ( rec_dict , target , depth = 0 ) : try : if isinstance ( rec_dict , dict ) : for key , value in rec_dict . items ( ) : if key == target : return rec_dict [ key ] for key , value in rec_dict . items ( ) : r = find_key ( value , target , depth + 1 ) if r is not None : return r except : traceback . print_exc ( )
find key "target" in recursive dict
find key " target " in recursive dict
"""
    find key "target" in recursive dict
    :param rec_dict: dict to search in, json schema dict, so it is combination of dict and arrays
    :param target: target key to search for
    :param depth: depth of the search (recursion)
    :return:
    """
None
rec_dict
dict to search in, json schema dict, so it is combination of dict and arrays
dict to search in json schema dict so it is combination of dict and arrays
target
target key to search for
target key to search for
depth
depth of the search (recursion)
depth of the search ( recursion )