mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fix: 'items' parameter for collections in parameters.
This commit is contained in:
parent
fd0d78e0a8
commit
d99c209f7d
@ -417,10 +417,13 @@ class SwaggerFormatter implements FormatterInterface
|
|||||||
$prop['description'] ?: $prop['dataType'],
|
$prop['description'] ?: $prop['dataType'],
|
||||||
$models
|
$models
|
||||||
);
|
);
|
||||||
|
$items = array(
|
||||||
|
'$ref' => $ref,
|
||||||
|
);
|
||||||
} elseif (isset($this->typeMap[$prop['subType']])) {
|
} elseif (isset($this->typeMap[$prop['subType']])) {
|
||||||
$items = $this->typeMap[$prop['subType']];
|
$items = array('type' => $this->typeMap[$prop['subType']]);
|
||||||
} else {
|
} else {
|
||||||
$items = 'string';
|
$items = array('type' => 'string');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -461,6 +464,10 @@ class SwaggerFormatter implements FormatterInterface
|
|||||||
$parameter['defaultValue'] = $prop['default'];
|
$parameter['defaultValue'] = $prop['default'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($items)) {
|
||||||
|
$parameter['items'] = $items;
|
||||||
|
}
|
||||||
|
|
||||||
$parameters[] = $parameter;
|
$parameters[] = $parameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user