From 598958d8a83cfbd44ba36388b2f9ed69e8b86ed4 Mon Sep 17 00:00:00 2001 From: Djordy Koert Date: Sun, 7 Jan 2024 23:33:09 +0100 Subject: [PATCH] fix: undefined type property (#1529) --- src/Annotations/AbstractAnnotation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Annotations/AbstractAnnotation.php b/src/Annotations/AbstractAnnotation.php index 3aeb46ebc..f3e7154e0 100644 --- a/src/Annotations/AbstractAnnotation.php +++ b/src/Annotations/AbstractAnnotation.php @@ -392,6 +392,10 @@ public function jsonSerialize() if (true === $data->nullable) { if (isset($data->oneOf)) { $data->oneOf[] = ['type' => 'null']; + } elseif (isset($data->anyOf)) { + $data->anyOf[] = ['type' => 'null']; + } elseif (isset($data->allOf)) { + $data->allOf[] = ['type' => 'null']; } else { $data->type = (array) $data->type; $data->type[] = 'null';