1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

Swagger2 array fix

This commit is contained in:
Matej Baco 2021-09-21 14:16:24 +02:00
parent a87d482e49
commit b97542e581

View file

@ -440,14 +440,11 @@ class Swagger2 extends Format
$rule['type'] = ($rule['type']) ? $rule['type'] : 'none';
if(\is_array($rule['type'])) {
// THIS IS NOT SUPPORTED IN 2.0!!!
// $items = [
// 'oneOf' => \array_map(function($type) {
// return ['$ref' => '#/definitions/'.$type];
// }, $rule['type'])
// ];
$items = [];
$items = [
'oneOf' => \array_map(function($type) {
return ['$ref' => '#/definitions/'.$type];
}, $rule['type'])
];
} else {
$items = [
'$ref' => '#/definitions/'.$rule['type'],