src/swagger2x.py
def sdf_ref_properties(json_data, url):
    """
    load referenced json property and return string formatted as sdf json schema
    :param json_data: json_data of the inputted resource type
    :param url: location of schema file and reference property, e.g. https://openconnectivityfoundation.github.io/IoTDataModels/schemas/oic.baseresource.properties-schema.json#/definitions/range_integer
    :           or if local reference, #/definitions/AirFlowControlBatch-Retrieve
    :return: string formatted as json schema
    """
    if "https" in url:
        ref_json_dict = load_json_schema_fromURL(url)
        sdf_make_reference_external(ref_json_dict, url)
    elif "http" in url:
        ref_json_dict = load_json_schema_fromURL(url)
        sdf_make_reference_external(ref_json_dict, url)
    else:
        ref_json_dict = json_data

    keyValue = url.split("/")[-1]

    output = ""
    lookup = None
    try:
        lookup = ref_json_dict['definitions'][keyValue]
    except:
        print("!!!!sdf_ref_properties : error in finding", keyValue, flush=True)

    output += sdf_properties_block(lookup)
    return output

    load referenced json property and return string formatted as sdf json schema
    :param json_data: json_data of the inputted resource type
    :param url: location of schema file and reference property, e.g. https://openconnectivityfoundation.github.io/IoTDataModels/schemas/oic.baseresource.properties-schema.json#/definitions/range_integer
    :           or if local reference, #/definitions/AirFlowControlBatch-Retrieve
    :return: string formatted as json schema
    
load referenced json property and return string formatted as sdf json schema
:param json_data: json_data of the inputted resource type
:param url: location of schema file and reference property, e.g.
load referenced json property and return string formatted as sdf json schema : param json_data : json_data of the inputted resource type : param url : location of schema file and reference property e . g .
def sdf_ref_properties(json_data, url):
    if "https" in url:
        ref_json_dict = load_json_schema_fromURL(url)
        sdf_make_reference_external(ref_json_dict, url)
    elif "http" in url:
        ref_json_dict = load_json_schema_fromURL(url)
        sdf_make_reference_external(ref_json_dict, url)
    else:
        ref_json_dict = json_data
    keyValue = url.split("/")[-1]
    output = ""
    lookup = None
    try:
        lookup = ref_json_dict['definitions'][keyValue]
    except:
        print("!!!!sdf_ref_properties : error in finding", keyValue, flush=True)
    output += sdf_properties_block(lookup)
    return output
def sdf_ref_properties ( json_data , url ) : if "https" in url : ref_json_dict = load_json_schema_fromURL ( url ) sdf_make_reference_external ( ref_json_dict , url ) elif "http" in url : ref_json_dict = load_json_schema_fromURL ( url ) sdf_make_reference_external ( ref_json_dict , url ) else : ref_json_dict = json_data keyValue = url . split ( "/" ) [ - 1 ] output = "" lookup = None try : lookup = ref_json_dict [ 'definitions' ] [ keyValue ] except : print ( "!!!!sdf_ref_properties : error in finding" , keyValue , flush = True ) output += sdf_properties_block ( lookup ) return output
load referenced json property and return string formatted as sdf json schema
:param json_data: json_data of the inputted resource type
:param url: location of schema file and reference property, e.g.
load referenced json property and return string formatted as sdf json schema : param json_data : json_data of the inputted resource type : param url : location of schema file and reference property e . g .
"""
    load referenced json property and return string formatted as sdf json schema
    :param json_data: json_data of the inputted resource type
    :param url: location of schema file and reference property, e.g. https://openconnectivityfoundation.github.io/IoTDataModels/schemas/oic.baseresource.properties-schema.json#/definitions/range_integer
    :           or if local reference, #/definitions/AirFlowControlBatch-Retrieve
    :return: string formatted as json schema
    """
json_data
url