From a4e8de7a7584a3094d85546079146663f6aee7fc Mon Sep 17 00:00:00 2001 From: Baptiste Lafontaine Date: Thu, 23 Dec 2021 14:13:06 +0100 Subject: [PATCH] Fixes symfony serializer being mandatory --- ModelDescriber/ObjectModelDescriber.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ModelDescriber/ObjectModelDescriber.php b/ModelDescriber/ObjectModelDescriber.php index 5f20cd74b..21f8d030d 100644 --- a/ModelDescriber/ObjectModelDescriber.php +++ b/ModelDescriber/ObjectModelDescriber.php @@ -188,6 +188,9 @@ private function describeProperty(array $types, Model $model, OA\Schema $propert */ private function getAnnotation(\ReflectionClass $reflection, string $className) { + if (false === class_exists($className)) { + return null; + } if (\PHP_VERSION_ID >= 80000) { if (null !== $attribute = $reflection->getAttributes($className, \ReflectionAttribute::IS_INSTANCEOF)[0] ?? null) { return $attribute->newInstance();