diff --git a/src/spec/PathItem.php b/src/spec/PathItem.php index 236bda81..3bd05652 100644 --- a/src/spec/PathItem.php +++ b/src/spec/PathItem.php @@ -174,7 +174,8 @@ public function resolveReferences(ReferenceContext $context = null) foreach ($this->$attribute as $k => $item) { if ($item instanceof Reference) { $referencedObject = $item->resolve(); - $this->$attribute[$k] = $referencedObject; + $this->$attribute = + [ $k => $referencedObject ] + $this->$attribute; if (!$referencedObject instanceof Reference && $referencedObject !== null) { $referencedObject->resolveReferences(); }