Skip to content

Commit

Permalink
Merge pull request #1938 from magnetik/1937
Browse files Browse the repository at this point in the history
Fixes symfony serializer being mandatory
  • Loading branch information
GuilhemN committed Dec 23, 2021
2 parents 16608de + a4e8de7 commit cc6731a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ModelDescriber/ObjectModelDescriber.php
Expand Up @@ -188,6 +188,9 @@ private function describeProperty(array $types, Model $model, OA\Schema $propert
*/
private function getAnnotation(\ReflectionClass $reflection, string $className)
{
if (false === class_exists($className)) {
return null;
}
if (\PHP_VERSION_ID >= 80000) {
if (null !== $attribute = $reflection->getAttributes($className, \ReflectionAttribute::IS_INSTANCEOF)[0] ?? null) {
return $attribute->newInstance();
Expand Down

0 comments on commit cc6731a

Please sign in to comment.