Skip to content

[Serializer] ignored_attributes key is ignored in Objectnormalizer when we use default_context configuration key #52776

Closed
@gcrispyn

Description

@gcrispyn

Symfony version(s) affected

5.4.31

Description

When I setup a default_context inside framework.yml, the array defined in ignored_attributes is not injected into ObjectNormalizer

How to reproduce

Create that configuration in framweork.yml :

serializer:
    circular_reference_handler: 'App\Serializer\CircularReferenceHandler'
    default_context:
        ignored_attributes:
            - '__initializer__'
            - '__cloner__'
            - '__isInitialized__'
        enable_max_depth: true

If you dump the serializer, you will see this :

image

Possible Solution

No response

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