1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +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'; $rule['type'] = ($rule['type']) ? $rule['type'] : 'none';
if(\is_array($rule['type'])) { if(\is_array($rule['type'])) {
// THIS IS NOT SUPPORTED IN 2.0!!! $items = [
// $items = [ 'oneOf' => \array_map(function($type) {
// 'oneOf' => \array_map(function($type) { return ['$ref' => '#/definitions/'.$type];
// return ['$ref' => '#/definitions/'.$type]; }, $rule['type'])
// }, $rule['type']) ];
// ];
$items = [];
} else { } else {
$items = [ $items = [
'$ref' => '#/definitions/'.$rule['type'], '$ref' => '#/definitions/'.$rule['type'],