From a6025d873900e5d540627bd6dedae438befd5ed3 Mon Sep 17 00:00:00 2001 From: Dominik Kohler <18621527+kohlerdominik@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:35:48 +0100 Subject: [PATCH] fixed that resolveRelativeUri could receive invalid values --- src/spec/Reference.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spec/Reference.php b/src/spec/Reference.php index 810f53da..be607ed6 100644 --- a/src/spec/Reference.php +++ b/src/spec/Reference.php @@ -354,8 +354,9 @@ private function adjustRelativeReferences($referencedDocument, $basePath, $baseD continue; } - // non strings can't be references - if (is_string($value) === false) { + // only values of type string can be references + // and only keys indicating a reference should be parsed + if (! is_string($value) || ! in_array($key, ['$ref', 'externalValue'], true)) { continue; }