Fixed collectionFormat conversion
@@ -838,25 +838,37 @@ public class SwaggerConverter implements SwaggerParserExtension {
ArraySchema a = new ArraySchema();
// TODO: convert arrays to proper template format
- if ("query".equals(v2Parameter.getIn())) {
+
String cf = sp.getCollectionFormat();
+ if (StringUtils.isEmpty(cf)) {
+ cf = "csv";
+ }
+
switch (cf) {
case "ssv":
+ if ("query".equals(v2Parameter.getIn())) {
v3Parameter.setStyle(Parameter.StyleEnum.SPACEDELIMITED);
+ }
break;
case "pipes":
+ if ("query".equals(v2Parameter.getIn())) {
v3Parameter.setStyle((Parameter.StyleEnum.PIPEDELIMITED));
+ }
+ break;
+ case "tsv":
break;
case "multi":
break;
case "csv":
default:
- v3Parameter.setExplode(true);
+ if ("query".equals(v2Parameter.getIn())) {
+ v3Parameter.setExplode(false);
}
}
+
Property items = sp.getItems();
Schema itemsSchema = convert(items);
a.setItems(itemsSchema);
