From 7926dc68d1d0e9df7ff6439487beb782dd124671 Mon Sep 17 00:00:00 2001 From: Antoine Bluchet Date: Mon, 8 Jul 2024 10:17:27 +0200 Subject: [PATCH] fix: parameter not found when no value (#6458) --- src/Metadata/Parameter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Metadata/Parameter.php b/src/Metadata/Parameter.php index 88dc06fd5fc..be68bc03412 100644 --- a/src/Metadata/Parameter.php +++ b/src/Metadata/Parameter.php @@ -14,6 +14,7 @@ namespace ApiPlatform\Metadata; use ApiPlatform\OpenApi; +use ApiPlatform\State\ParameterNotFound; use ApiPlatform\State\ParameterProviderInterface; use Symfony\Component\Validator\Constraint; @@ -107,7 +108,7 @@ public function getConstraints(): Constraint|array|null */ public function getValue(): mixed { - return $this->extraProperties['_api_values'] ?? null; + return $this->extraProperties['_api_values'] ?? new ParameterNotFound(); } /**