Skip to content

[Serializer] PropertyNormalizer doesnt process parent class properties #24152

Closed
@ivoba

Description

@ivoba
Q A
Bug report? yes
Feature request? yes
BC Break report? no
RFC? no
Symfony version 2.8 - 3.x

When using PropertyNormalizer on a nested object that has objects which use inheritance the parent class properties arent normalized.
The $reflectionObject in extractAttributes() doesnt get the private properties of the parent class.
This is normal behaviour of the PHP reflection.
However as the PropertyNormalizer doesnt respect private settings of properties anyway, i think it should be default that it also gets the private properties of the parent class.

Therefor extractAttributes() should recursivly call $reflectionObject->getParentClass()->getProperties() to return all properties.

WDYT @dunglas ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions