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';