Skip to content

[Serializer] Missing "container.excluded" error after upgrade to 7.4 #62687

@chr-hertel

Description

@chr-hertel

Symfony version(s) affected

7.4

Description

After upgrading one app to Symfony 7.4, bin/console cache:clear --env=prod runs into:

In AttributeMetadataPass.php line 37:
The resource "App\Test" tagged "serializer.attribute_metadata" is missing the "container.excluded" tag.                                                                                                           

With App\Test like:

<?php

namespace App;

use Symfony\Component\Serializer\Attribute\SerializedName;

final readonly class Test
{
    #[SerializedName('test')]
    public string $name;
}

Potentially related to #61532 and #62185.

How to reproduce

git clone git@github.com:chr-hertel/repro-serializer-attr-74.git
cd repro-serializer-attr-74
composer install
bin/console cache:clear --env=prod

see https://github.com/chr-hertel/repro-serializer-attr-74

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