Skip to content

[Serializer] regression with attribute serialization #58689

@oleg-andreyev

Description

@oleg-andreyev

Symfony version(s) affected

6.4.7

Description

Similar as #54983

But $attribute = 'segments[Default]'

Suspect #52917

In 6.4.6 ObjectObjectNormalizer::isAllowedAttribute did not exist and we were relying on AbstractNormalizer::isAllowedAttribute and PropertyAccess component can easly write segments[Default] into $segments field as ['Default' => '<value>']

In 6.4.7 ObjectObjectNormalizer::isAllowedAttribute and now it cannot detect that $segments is writeable.

How to reproduce

https://github.com/oleg-andreyev/bug_app/blob/issue-58689/tests/BugTest.php

Possible Solution

Similar to #57187 but instead of "adding" yet another condition,
looks like ObjectNormalizer::$propertyInfoExtractor is using ReflectionExtractor by default thus does not take into account PropertyAccessor information.

Additional Context

No response

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy