src/swagger2x.py
def sdf_item_object(itemObject):
    """
    Take the item value and additionally parse for sdf
    :param itemObject: item's value
    :return: json formatted string
    """
    i = 0
    output = "{"
    for i, (itemKey, itemValue) in enumerate(itemObject.items()):
        if itemKey == "enum":
            output = output + "\"" + itemKey + "\": "
            output = output + sdf_enum_array(itemValue)
        else:
            if itemKey == "maximum":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "minimum":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "minItems":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "maxItems":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "$ref":
                # print('  sdf_item_object: $ref!! ', itemKey, itemValue)
                output += sdf_ref_properties(json_data, itemValue)
            elif itemValue is True:
                output = output + "\"" + itemKey + "\": "
                output = output + "true"
            elif itemValue is False:
                output = output + "\"" + itemKey + "\": "
                output += "false"
            elif itemKey == "properties":
                # recursive !!
                output = output + "\"" + itemKey + "\": "
                output += "{" + sdf_property_object(itemValue, "sub") + "}"
            elif itemKey == "required":
                # recursive !!
                output = output + "\"" + itemKey + "\": "
                output = output + sdf_enum_array(itemValue)
            elif isinstance(itemValue, Number):
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            else:
                output = output + "\"" + itemKey + "\": "
                output += "\"" + str(itemValue) + "\""
        if i < len(itemObject) - 1:
            output += ","
        else:
            output += "}"
        i = i + 1
    return output

    Take the item value and additionally parse for sdf
    :param itemObject: item's value
    :return: json formatted string
    
Take the item value and additionally parse for sdf
Take the item value and additionally parse for sdf
def sdf_item_object(itemObject):
    i = 0
    output = "{"
    for i, (itemKey, itemValue) in enumerate(itemObject.items()):
        if itemKey == "enum":
            output = output + "\"" + itemKey + "\": "
            output = output + sdf_enum_array(itemValue)
        else:
            if itemKey == "maximum":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "minimum":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "minItems":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "maxItems":
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            elif itemKey == "$ref":
                output += sdf_ref_properties(json_data, itemValue)
            elif itemValue is True:
                output = output + "\"" + itemKey + "\": "
                output = output + "true"
            elif itemValue is False:
                output = output + "\"" + itemKey + "\": "
                output += "false"
            elif itemKey == "properties":
                output = output + "\"" + itemKey + "\": "
                output += "{" + sdf_property_object(itemValue, "sub") + "}"
            elif itemKey == "required":
                output = output + "\"" + itemKey + "\": "
                output = output + sdf_enum_array(itemValue)
            elif isinstance(itemValue, Number):
                output = output + "\"" + itemKey + "\": "
                output += str(itemValue)
            else:
                output = output + "\"" + itemKey + "\": "
                output += "\"" + str(itemValue) + "\""
        if i < len(itemObject) - 1:
            output += ","
        else:
            output += "}"
        i = i + 1
    return output
def sdf_item_object ( itemObject ) : i = 0 output = "{" for i , ( itemKey , itemValue ) in enumerate ( itemObject . items ( ) ) : if itemKey == "enum" : output = output + "\"" + itemKey + "\": " output = output + sdf_enum_array ( itemValue ) else : if itemKey == "maximum" : output = output + "\"" + itemKey + "\": " output += str ( itemValue ) elif itemKey == "minimum" : output = output + "\"" + itemKey + "\": " output += str ( itemValue ) elif itemKey == "minItems" : output = output + "\"" + itemKey + "\": " output += str ( itemValue ) elif itemKey == "maxItems" : output = output + "\"" + itemKey + "\": " output += str ( itemValue ) elif itemKey == "$ref" : output += sdf_ref_properties ( json_data , itemValue ) elif itemValue is True : output = output + "\"" + itemKey + "\": " output = output + "true" elif itemValue is False : output = output + "\"" + itemKey + "\": " output += "false" elif itemKey == "properties" : output = output + "\"" + itemKey + "\": " output += "{" + sdf_property_object ( itemValue , "sub" ) + "}" elif itemKey == "required" : output = output + "\"" + itemKey + "\": " output = output + sdf_enum_array ( itemValue ) elif isinstance ( itemValue , Number ) : output = output + "\"" + itemKey + "\": " output += str ( itemValue ) else : output = output + "\"" + itemKey + "\": " output += "\"" + str ( itemValue ) + "\"" if i < len ( itemObject ) - 1 : output += "," else : output += "}" i = i + 1 return output
Take the item value and additionally parse for sdf
Take the item value and additionally parse for sdf
"""
    Take the item value and additionally parse for sdf
    :param itemObject: item's value
    :return: json formatted string
    """ # print('  sdf_item_object: $ref!! ', itemKey, itemValue)
 # recursive !!
 # recursive !!

json formatted string
json formatted string
itemObject
None