mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-04-02 21:36:14 +03:00
Merge pull request #523 from jeskew/master
Update parser to convert empty array defaults to null
This commit is contained in:
commit
3889e7ff24
1 changed files with 7 additions and 1 deletions
|
@ -115,7 +115,13 @@ class JmsMetadataParser implements ParserInterface, PostParserInterface
|
|||
$params = array();
|
||||
|
||||
$reflection = new \ReflectionClass($className);
|
||||
$defaultProperties = $reflection->getDefaultProperties();
|
||||
$defaultProperties = array_map(function ($default) {
|
||||
if (is_array($default) && count($default) === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $default;
|
||||
}, $reflection->getDefaultProperties());
|
||||
|
||||
// iterate over property metadata
|
||||
foreach ($meta->propertyMetadata as $item) {
|
||||
|
|
Loading…
Add table
Reference in a new issue