Skip to content

Commit 98b96c8

Browse files
authored
Merge pull request #1 from appsumo/operation_arrays
Use array of operations to support multiple definitions per method
2 parents db00996 + 85fe8d1 commit 98b96c8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/spec/PathItem.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ protected function attributes(): array
5050
return [
5151
'summary' => Type::STRING,
5252
'description' => Type::STRING,
53-
'get' => Operation::class,
54-
'put' => Operation::class,
55-
'post' => Operation::class,
56-
'delete' => Operation::class,
57-
'options' => Operation::class,
58-
'head' => Operation::class,
59-
'patch' => Operation::class,
60-
'trace' => Operation::class,
53+
'get' => [Operation::class],
54+
'put' => [Operation::class],
55+
'post' => [Operation::class],
56+
'delete' => [Operation::class],
57+
'options' => [Operation::class],
58+
'head' => [Operation::class],
59+
'patch' => [Operation::class],
60+
'trace' => [Operation::class],
6161
'servers' => [Server::class],
6262
'parameters' => [Parameter::class],
6363
];
@@ -116,7 +116,7 @@ public function getOperations()
116116
{
117117
$operations = [];
118118
foreach ($this->attributes() as $attribute => $type) {
119-
if ($type === Operation::class && isset($this->$attribute)) {
119+
if (\is_array($type) && $type[0] === Operation::class && isset($this->$attribute)) {
120120
$operations[$attribute] = $this->$attribute;
121121
}
122122
}

0 commit comments

Comments
 (0)