You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should work just as you would overwrite the one of a collection operation.
For example:
# src/AppBundle/Resources/config/api_resources/resources.ymlAppBundle\Entity\Answer:
collectionOperations:
api_questions_answer_get_subresource:
method: 'GET'# nothing more to add if we want to keep the default controllerpath: '/foo/{id}/bar'
Before you do this check debug:router to get the operation name and the identifier names (they'll have to stay the same).
When I am naming my collectionOperation to api_teams_users_get_subresource then it will be called api_teams_api_teams_users_get_subresource_collection in the router.
Mhh I need to change the docs on this itś s actually only the suffix. Just like you're doing to replace a collection operation (ie get, put) here it's property_get_subresource:
For example to replace the api_users_person_get_subresource_collection path I did:
The problem is that i don't want to change the api_users_person_get_subresource_collection.
I want change the api_users_person_get_subresource and that's unfortunaley not possible at all :(
# src/AppBundle/Resources/config/api_resources/resources.ymlAppBundle\Entity\Answer:
collectionOperations:
api_questions_answer_get_subresource:
method: 'GET'# nothing more to add if we want to keep the default controllerpath: '/foo/{id}/bar'
Activity
soyuka commentedon Nov 6, 2017
It should work just as you would overwrite the one of a collection operation.
For example:
Before you do this check
debug:router
to get the operation name and the identifier names (they'll have to stay the same).docs
iCodr8 commentedon Nov 6, 2017
When I am naming my collectionOperation to
api_teams_users_get_subresource
then it will be calledapi_teams_api_teams_users_get_subresource_collection
in the router.soyuka commentedon Nov 7, 2017
Mhh I need to change the docs on this itś s actually only the suffix. Just like you're doing to replace a collection operation (ie
get
,put
) here it'sproperty_get_subresource
:For example to replace the
api_users_person_get_subresource_collection
path I did:iCodr8 commentedon Nov 7, 2017
The problem is that i don't want to change the
api_users_person_get_subresource_collection
.I want change the
api_users_person_get_subresource
and that's unfortunaley not possible at all :(fix api-platform#1479
soyuka commentedon Nov 8, 2017
Okaaayy. My bad thought this was fine!
iCodr8 commentedon Nov 8, 2017
So, the correct way was your first opinion?
soyuka commentedon Nov 8, 2017
answer_get_subresource
is the operation namefix api-platform#1479
Merge pull request #1483 from soyuka/fix-subresource-override-operation
fix api-platform#1479
5 remaining items