Conversion limitations from Swagger 1.2 to 2.0
developWhen converting from Swagger 1.2 to 2.0, be aware of the following structural changes and limitations:
Parameter Mapping: allowMultiple to collectionFormat
In Swagger 1.2, arrays were often defined using allowMultiple: true. In Swagger 2.0, this is replaced by the collectionFormat property. For example, a string with multiple allowed values will be converted to use collectionFormat: "csv" and an items object.
Example Conversion:
Input (1.2):
{
"allowMultiple":true,
"type":"string",
"enum":[
"available",
"pending",
"sold"
]
}Output (2.0):
{
"collectionFormat":"csv",
"items":{
"type":"string",
"enum":["available", "pending", "sold"]
}
}basePath Restrictions
Swagger 1.2 allows multiple basePath definitions. However, Swagger 2.0 only allows a single basePath. If your resource files define different basePath values, pyswagger will raise an Exception and refuse to proceed with the conversion.