API Platform version(s) affected: 2.5.6
Description
Following this documentation: https://api-platform.com/docs/core/subresources/#using-custom-paths
I try to override the path (and security, and requirements) of a subresource.
It works for the security, but not for path (and so requirements).
How to reproduce
Clone this repo and follow the very small README :
https://github.com/bastoune/api-platform-issue-1581
Having this route with debug:router :
api_organizations_users_get_subresource GET ANY ANY /v2/organizations/{id}/users.{_format}
and this annotation :
* subresourceOperations={
* "api_organizations_users_get_subresource"={
* "method"="GET",
* "path"="/TEEEST/organizations/{organization_id}/users",
* "requirements"={"organization_id": StringHelper::UUIDv4Regex},
* "security"="is_granted('readOrganization', organization_id)"
* }
* }
The security works but not the rest.
If I remove the security, it doesn't work anyway.
@ApiSubResourceannotation on$organisations- VipulwOneToManyrealtions of some Entity with that path by providing it's id. So, if you want to get all users of an organisation then you should add@ApiSubResourceto$userinOrganizationEntity and do the subresource configuration there. - Vipulw@ApiSubresourceis well in theOrganization->$userAnd, wherever (In User OR Organiztion) I put the subresource configuration, i get the same result. - BastienSander