Merge pull request #476 from bezhermoso/swagger-collection-parameter

[Fix] Missing handling for DataTypes::COLLECTION in parameters (input)
This commit is contained in:
William Durand 2014-08-16 14:29:11 +02:00
commit d32381d18d

View File

@ -407,6 +407,22 @@ class SwaggerFormatter implements FormatterInterface
$models $models
); );
break; break;
case DataTypes::COLLECTION:
$type = 'array';
if ($prop['subType'] === DataTypes::MODEL) {
$ref = $this->registerModel(
$prop['subType'],
isset($prop['children']) ? $prop['children'] : null,
$prop['description'] ?: $prop['dataType'],
$models
);
} elseif (isset($this->typeMap[$prop['subType']])) {
$items = $this->typeMap[$prop['subType']];
} else {
$items = 'string';
}
break;
} }
} }