Skip to content

[Symfony] ApiResource attribute auto excluded from services #7065

Closed
@Nayte91

Description

@Nayte91

Hello,

On the Symfony side, I was advocating for auto exclude some classes from the service container, based on their attributes. This way, with this PR, Entity and AsMessage are now auto excluded from services, as it won't need to exclude them with Exclude attribute or within the config/services.yaml exclude key.

So I wonder (I don't really know where to check) if the ApiResource tagged classes are already auto excluded, and if they should (I think they do)?

Best regards,

Activity

soyuka

soyuka commented on Apr 5, 2025

@soyuka
Member

indeed its part of our work at #6943 feel free to add a patch excluding resources it'll already be a good step forward

Nayte91

Nayte91 commented on Apr 29, 2025

@Nayte91
Author

I think it's done on this line? adding container.excluded to ApiResource attribute, that's what I thought about.

I think it's OK!

soyuka

soyuka commented on Apr 29, 2025

@soyuka
Member

yes but it'll be available only in 4.2 as they're some deprecations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @soyuka@Nayte91

        Issue actions

          [Symfony] ApiResource attribute auto excluded from services · Issue #7065 · api-platform/core