diff --git a/ModelDescriber/FormModelDescriber.php b/ModelDescriber/FormModelDescriber.php index c4f423f..6bff0e4 100644 --- a/ModelDescriber/FormModelDescriber.php +++ b/ModelDescriber/FormModelDescriber.php @@ -124,7 +124,14 @@ final class FormModelDescriber implements ModelDescriberInterface, ModelRegistry null, $config->getOptions() ); - $property->ref = $this->modelRegistry->register($model); + + $ref = $this->modelRegistry->register($model); + // We need to use allOf for description and title to be displayed + if ($config->hasOption('documentation') && !empty($config->getOption('documentation'))) { + $property->allOf = [new OA\Schema(['ref' => $ref])]; + } else { + $property->ref = $ref; + } return; }