src/swagger2x.py
def sdf_return_path_info(json_data, returnType):
    """
    Return ocf resource type name: OCF name, e.g. oic.r.grinderAppliance returns grinderAppliance or grinderApplianceResURI
    :json_data: inputted resource type file
    :returnType: "name" or "path" or "description"
    :return: if returnType: "name" - string formatted name: e.g. grinder
                returnType: "description" - returns the description property of the "get" path,
                returnType: "path" the path name, e.g. /GrinderResURI
    """
    rt = swagger_rt(json_data)
    name = rt[0][1]
    path = rt[0][0]
    name = name.replace('oic.r.', '')

    if len(rt) > 1:
        print("WARNING: More than one path found: ", rt)
    if returnType == "name":
        return name
    elif returnType == "description":
        return escape_quotes(remove_nl_crs(json_data["paths"][path]["get"]["description"], True))
    else:
        return path

    Return ocf resource type name: OCF name, e.g. oic.r.grinderAppliance returns grinderAppliance or grinderApplianceResURI
    :json_data: inputted resource type file
    :returnType: "name" or "path" or "description"
    :return: if returnType: "name" - string formatted name: e.g. grinder
                returnType: "description" - returns the description property of the "get" path,
                returnType: "path" the path name, e.g. /GrinderResURI
    
Return ocf resource type name: OCF name, e.g. oic.r.grinderAppliance returns grinderAppliance or grinderApplianceResURI
Return ocf resource type name : OCF name e . g . oic . r . grinderAppliance returns grinderAppliance or grinderApplianceResURI
def sdf_return_path_info(json_data, returnType):
    rt = swagger_rt(json_data)
    name = rt[0][1]
    path = rt[0][0]
    name = name.replace('oic.r.', '')
    if len(rt) > 1:
        print("WARNING: More than one path found: ", rt)
    if returnType == "name":
        return name
    elif returnType == "description":
        return escape_quotes(remove_nl_crs(json_data["paths"][path]["get"]["description"], True))
    else:
        return path
def sdf_return_path_info ( json_data , returnType ) : rt = swagger_rt ( json_data ) name = rt [ 0 ] [ 1 ] path = rt [ 0 ] [ 0 ] name = name . replace ( 'oic.r.' , '' ) if len ( rt ) > 1 : print ( "WARNING: More than one path found: " , rt ) if returnType == "name" : return name elif returnType == "description" : return escape_quotes ( remove_nl_crs ( json_data [ "paths" ] [ path ] [ "get" ] [ "description" ] , True ) ) else : return path
Return ocf resource type name: OCF name, e.g.
Return ocf resource type name : OCF name e . g .
"""
    Return ocf resource type name: OCF name, e.g. oic.r.grinderAppliance returns grinderAppliance or grinderApplianceResURI
    :json_data: inputted resource type file
    :returnType: "name" or "path" or "description"
    :return: if returnType: "name" - string formatted name: e.g. grinder
                returnType: "description" - returns the description property of the "get" path,
                returnType: "path" the path name, e.g. /GrinderResURI
    """
if returnType: "name" - string formatted name: e.g. grinder
returnType: "description" - returns the description property of the "get" path,
returnType: "path" the path name, e.g. /GrinderResURI
if returnType : " name " - string formatted name : e . g . grinder returnType : " description " - returns the description property of the " get " path returnType : " path " the path name e . g . / GrinderResURI
json_data
returnType
json_data
inputted resource type file
inputted resource type file
returnType
"name" or "path" or "description"
" name " or " path " or " description "