Merge pull request #484 from bezhermoso/fix_items_for_collection_parameters

[Fix] 'items' parameter for collections in parameters.
This commit is contained in:
William Durand 2014-08-19 22:08:24 +02:00
commit 068d2f1a32

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;
}