diff --git a/src/spec/PathItem.php b/src/spec/PathItem.php index 4b2debcd..623656fa 100644 --- a/src/spec/PathItem.php +++ b/src/spec/PathItem.php @@ -50,14 +50,14 @@ protected function attributes(): array return [ 'summary' => Type::STRING, 'description' => Type::STRING, - 'get' => Operation::class, - 'put' => Operation::class, - 'post' => Operation::class, - 'delete' => Operation::class, - 'options' => Operation::class, - 'head' => Operation::class, - 'patch' => Operation::class, - 'trace' => Operation::class, + 'get' => [Operation::class], + 'put' => [Operation::class], + 'post' => [Operation::class], + 'delete' => [Operation::class], + 'options' => [Operation::class], + 'head' => [Operation::class], + 'patch' => [Operation::class], + 'trace' => [Operation::class], 'servers' => [Server::class], 'parameters' => [Parameter::class], ]; @@ -116,7 +116,7 @@ public function getOperations() { $operations = []; foreach ($this->attributes() as $attribute => $type) { - if ($type === Operation::class && isset($this->$attribute)) { + if (\is_array($type) && $type[0] === Operation::class && isset($this->$attribute)) { $operations[$attribute] = $this->$attribute; } }