src/swagger2x.py
def swagger_rt(json_data):
    """
    get the rt value from the example
    :param json_data: the swagger file as json struct
    :return: array of arrays of found values e.g. [ [a,b],[a,b] ]
    """
    rt_values = []
    for path, item in json_data["paths"].items():
        try:
            x_example = item["get"]["responses"]["200"]["x-example"]
            rt = x_example.get("rt")
            for rt_value in rt:
                rt_values.append([path, rt_value])
        except:
            try:
                rt = item["post"]["responses"]["200"]["x-example"]["rt"]
                for rt_value in rt:
                    rt_values.append([path, rt_value])
            except:
                pass
    return rt_values

    get the rt value from the example
    :param json_data: the swagger file as json struct
    :return: array of arrays of found values e.g. [ [a,b],[a,b] ]
    
get the rt value from the example
get the rt value from the example
def swagger_rt(json_data):
    rt_values = []
    for path, item in json_data["paths"].items():
        try:
            x_example = item["get"]["responses"]["200"]["x-example"]
            rt = x_example.get("rt")
            for rt_value in rt:
                rt_values.append([path, rt_value])
        except:
            try:
                rt = item["post"]["responses"]["200"]["x-example"]["rt"]
                for rt_value in rt:
                    rt_values.append([path, rt_value])
            except:
                pass
    return rt_values
def swagger_rt ( json_data ) : rt_values = [ ] for path , item in json_data [ "paths" ] . items ( ) : try : x_example = item [ "get" ] [ "responses" ] [ "200" ] [ "x-example" ] rt = x_example . get ( "rt" ) for rt_value in rt : rt_values . append ( [ path , rt_value ] ) except : try : rt = item [ "post" ] [ "responses" ] [ "200" ] [ "x-example" ] [ "rt" ] for rt_value in rt : rt_values . append ( [ path , rt_value ] ) except : pass return rt_values
get the rt value from the example
get the rt value from the example
"""
    get the rt value from the example
    :param json_data: the swagger file as json struct
    :return: array of arrays of found values e.g. [ [a,b],[a,b] ]
    """
array of arrays of found values e.g.
array of arrays of found values e . g .
json_data
the swagger file as json struct
the swagger file as json struct