I have an API that has multiple roles, and I want to hide some endpoints for specific roles in docs and also in the /api entrypoint. Is there an easy way to do so?
I found this question
How to hide a route from API Platform documentation
But it hides the endpoint entirely.
You should do as mentioned here.
Also you should implement role check using Symfony security component to decide whether or not to show the endpoint.