Skip to content

[Symfony] ApiResource attribute auto excluded from services #7065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nayte91 opened this issue Apr 4, 2025 · 3 comments
Closed

[Symfony] ApiResource attribute auto excluded from services #7065

Nayte91 opened this issue Apr 4, 2025 · 3 comments

Comments

@Nayte91
Copy link

Nayte91 commented Apr 4, 2025

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,

@soyuka
Copy link
Member

soyuka commented Apr 5, 2025

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
Copy link
Author

Nayte91 commented Apr 29, 2025

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!

@Nayte91 Nayte91 closed this as completed Apr 29, 2025
@soyuka
Copy link
Member

soyuka commented Apr 29, 2025

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants