mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Merge pull request #476 from bezhermoso/swagger-collection-parameter
[Fix] Missing handling for DataTypes::COLLECTION in parameters (input)
This commit is contained in:
commit
d32381d18d
@ -407,6 +407,22 @@ class SwaggerFormatter implements FormatterInterface
|
||||
$models
|
||||
);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user