Display form type childs description and title properly

This commit is contained in:
Yoann Laissus 2021-03-30 14:19:33 +02:00
parent bf77277f2f
commit 7858afec09

View File

@ -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;
}