Fix: 'items' parameter for collections in parameters.

This commit is contained in:
Bez Hermoso 2014-08-19 12:20:42 -07:00
parent fd0d78e0a8
commit d99c209f7d

View File

@ -417,10 +417,13 @@ class SwaggerFormatter implements FormatterInterface
$prop['description'] ?: $prop['dataType'],
$models
);
$items = array(
'$ref' => $ref,
);
} elseif (isset($this->typeMap[$prop['subType']])) {
$items = $this->typeMap[$prop['subType']];
$items = array('type' => $this->typeMap[$prop['subType']]);
} else {
$items = 'string';
$items = array('type' => 'string');
}
break;
}
@ -461,6 +464,10 @@ class SwaggerFormatter implements FormatterInterface
$parameter['defaultValue'] = $prop['default'];
}
if (isset($items)) {
$parameter['items'] = $items;
}
$parameters[] = $parameter;
}