mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Collection handling fix.
This commit is contained in:
parent
5fa69a0504
commit
0d17c10b70
@ -448,19 +448,20 @@ class SwaggerFormatter implements FormatterInterface
|
||||
|
||||
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']
|
||||
);
|
||||
$items = array(
|
||||
'$ref' => $ref
|
||||
);
|
||||
if ($prop['subType'] === null) {
|
||||
$items = array('type' => 'string');
|
||||
} elseif (isset($this->typeMap[$prop['subType']])) {
|
||||
$items = array('type' => $this->typeMap[$prop['subType']]);
|
||||
} else {
|
||||
$items = array('type' => 'string');
|
||||
$ref =
|
||||
$this->registerModel(
|
||||
$prop['subType'],
|
||||
isset($prop['children']) ? $prop['children'] : null,
|
||||
$prop['description'] ?: $prop['dataType']
|
||||
);
|
||||
$items = array(
|
||||
'$ref' => $ref,
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user