-
-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(serializer): check in child classes attribute's groups for serialization #6382
base: 3.3
Are you sure you want to change the base?
feat(serializer): check in child classes attribute's groups for serialization #6382
Conversation
723f297
to
ead9c6c
Compare
c5572f7
to
c7c625f
Compare
c7c625f
to
01d4c0f
Compare
@@ -203,6 +204,18 @@ private function getClassSerializerGroups(string $class): array | |||
$groups[] = $serializerAttributeMetadata->getGroups(); | |||
} | |||
|
|||
if (true === $this->normalizeChildClassAttributeGroups) { | |||
foreach ($serializerClassMetadata->getReflectionClass()->getAttributes() as $reflectionAttribute) { | |||
if (DiscriminatorMap::class !== $reflectionAttribute->getName()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is discriminatorMap an attribute of the serializer? not sure I understand how this works.
@@ -17,6 +17,7 @@ | |||
use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException; | |||
use ApiPlatform\Metadata\ResourceClassResolverInterface; | |||
use ApiPlatform\Metadata\Util\ResourceClassInfoTrait; | |||
use Doctrine\ORM\Mapping\DiscriminatorMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a huge fan of using doctrine in this file, it'd be best inside DoctrineOrmPropertyMetadataFactory?
Original issue created:
Self contained repository for reproduction:
Overall logic:
Remarks: