You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NB: IF I add the fooGroup group on ANY attribute of the main joined class (let's say the $id), everything works well as intended, and all joined attribute are now serialized :
Possible Solution
I would think the check for serialization isn't done on the joined entities, but if this check is passed the serialization process is OK.
UPDATE 26/03:
the ApiProperty in SerializerPropertyMetadataFactory->transformLinkStatus function has a builtIn type of the parent DiscriminatorMap class. So I guess this is "logical" that the getClassSerializerGroups does not return all the possible child class groups.
How would a MetadataFactory instanciate an ApiProperty with the correct requested child Discriminator class ?
The text was updated successfully, but these errors were encountered:
API Platform version(s) affected: 3.1.22
Description
I am serializing an object of class
foo
:GET
operation on/foos/1
fooGroup
normalization context groupMy foo class have two
ManyToOne
attributes:barSingleTable
(a class withSINGLE_TABLE
InheritanceType)x
attribute, with thefooGroup
for normalizationbarJoined
(a class withJOINED
InheritanceType)barJoinedA
andbarJoinedB
Y
andZ
containing thefooGroup
for normalizationWhen I fetch
/foos/1
, here is my payload:Here is what I expect:
NB: IF I add the
fooGroup
group on ANY attribute of the main joined class (let's say the$id
), everything works well as intended, and all joined attribute are now serialized :Possible Solution
I would think the check for serialization isn't done on the joined entities, but if this check is passed the serialization process is OK.
UPDATE 26/03:
the
ApiProperty
inSerializerPropertyMetadataFactory->transformLinkStatus
function has abuiltIn
type of the parentDiscriminatorMap
class. So I guess this is "logical" that thegetClassSerializerGroups
does not return all the possible child class groups.How would a MetadataFactory instanciate an
ApiProperty
with the correct requested child Discriminator class ?The text was updated successfully, but these errors were encountered: