src/swagger2x.py
def swagger_properties_get(json_data, input_path):
    """
    get the properties  from the schema that is referenced by the path in get (or post)
    :param json_data: the swagger file as json struct
    :param input_path: the path to which the if should be queried
    :return: list of if values
    """
    prop_block = {}
    schema = None
    for path, path_item in json_data["paths"].items():
        if input_path == path:
            try:
                schema = path_item["get"]["responses"]["200"]["schema"]
            except:
                try:
                    schema = path_item["post"]["responses"]["200"]["schema"]
                except:
                    pass
            if schema is not None:
                schema_ref = schema["$ref"]
                def_data = json_data["definitions"]
                for def_name, def_item in def_data.items():
                    full_def_name = "#/definitions/" + def_name
                    if full_def_name in [schema_ref]:
                        prop_block = find_key_link(def_item, "properties")
                        return prop_block
            else:
                print("swagger_properties: schema not found:", input_path)
    return prop_block

    get the properties  from the schema that is referenced by the path in get (or post)
    :param json_data: the swagger file as json struct
    :param input_path: the path to which the if should be queried
    :return: list of if values
    
get the properties  from the schema that is referenced by the path in get (or post)
get the properties from the schema that is referenced by the path in get ( or post )
def swagger_properties_get(json_data, input_path):
    prop_block = {}
    schema = None
    for path, path_item in json_data["paths"].items():
        if input_path == path:
            try:
                schema = path_item["get"]["responses"]["200"]["schema"]
            except:
                try:
                    schema = path_item["post"]["responses"]["200"]["schema"]
                except:
                    pass
            if schema is not None:
                schema_ref = schema["$ref"]
                def_data = json_data["definitions"]
                for def_name, def_item in def_data.items():
                    full_def_name = "#/definitions/" + def_name
                    if full_def_name in [schema_ref]:
                        prop_block = find_key_link(def_item, "properties")
                        return prop_block
            else:
                print("swagger_properties: schema not found:", input_path)
    return prop_block
def swagger_properties_get ( json_data , input_path ) : prop_block = { } schema = None for path , path_item in json_data [ "paths" ] . items ( ) : if input_path == path : try : schema = path_item [ "get" ] [ "responses" ] [ "200" ] [ "schema" ] except : try : schema = path_item [ "post" ] [ "responses" ] [ "200" ] [ "schema" ] except : pass if schema is not None : schema_ref = schema [ "$ref" ] def_data = json_data [ "definitions" ] for def_name , def_item in def_data . items ( ) : full_def_name = "#/definitions/" + def_name if full_def_name in [ schema_ref ] : prop_block = find_key_link ( def_item , "properties" ) return prop_block else : print ( "swagger_properties: schema not found:" , input_path ) return prop_block
get the properties  from the schema that is referenced by the path in get (or post)
get the properties from the schema that is referenced by the path in get ( or post )
"""
    get the properties  from the schema that is referenced by the path in get (or post)
    :param json_data: the swagger file as json struct
    :param input_path: the path to which the if should be queried
    :return: list of if values
    """
list of if values
list of if values
json_data
the swagger file as json struct
the swagger file as json struct
input_path
the path to which the if should be queried
the path to which the if should be queried