Merge pull request #1804 from JeResilieMonContrat-com/form_child_documentation

Display non native form type childs description and title properly
This commit is contained in:
Guilhem Niot 2021-08-03 09:37:16 +02:00 committed by GitHub
commit c097e27b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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