src/swagger2x.py
def sdf_make_reference_external(iter_json_data, url):
    """
    Checks all $ref and prepend the url to it if it is
    a local reference (e.g. start with #)
    :param json data
    :param url url to be prefixed to the local reference
    :return: data
    """
    url_base = url.split("#")[0]
    for property_name, property_data in iter_json_data.items():
        if property_name == "$ref":
            if property_data[0] == "#":
                new_url = url_base + property_data
                iter_json_data[property_name] = new_url
        if isinstance(property_data, dict):
            sdf_make_reference_external(property_data, url)

    Checks all $ref and prepend the url to it if it is
    a local reference (e.g. start with #)
    :param json data
    :param url url to be prefixed to the local reference
    :return: data
    
Checks all $ref and prepend the url to it if it is
a local reference
:param json data
:param url url to be prefixed to the local reference
:return: data
Checks all $ref and prepend the url to it if it is a local reference : param json data : param url url to be prefixed to the local reference : return : data
def sdf_make_reference_external(iter_json_data, url):
    url_base = url.split("#")[0]
    for property_name, property_data in iter_json_data.items():
        if property_name == "$ref":
            if property_data[0] == "#":
                new_url = url_base + property_data
                iter_json_data[property_name] = new_url
        if isinstance(property_data, dict):
            sdf_make_reference_external(property_data, url)
def sdf_make_reference_external ( iter_json_data , url ) : url_base = url . split ( "#" ) [ 0 ] for property_name , property_data in iter_json_data . items ( ) : if property_name == "$ref" : if property_data [ 0 ] == "#" : new_url = url_base + property_data iter_json_data [ property_name ] = new_url if isinstance ( property_data , dict ) : sdf_make_reference_external ( property_data , url )
Checks all $ref and prepend the url to it if it is
a local reference (e.g.
Checks all $ref and prepend the url to it if it is a local reference ( e . g .
"""
    Checks all $ref and prepend the url to it if it is
    a local reference (e.g. start with #)
    :param json data
    :param url url to be prefixed to the local reference
    :return: data
    """
iter_json_data
url