Closed bytedreamer closed 4 years ago
we have a similar task on our todo, but thats to annotate (may be disable) the try button. We try not to do any validations, to keep the API testable, for instance
Is there a use-case that you are after ?
Certain calls are restricted based on the user's permissions. We want the user to be able to view only the calls for which they have access.
The workflow for an user accessing the API Documentation:
One way to accomplish this is to dynamically create JSON spec file based on user permissions. For this to work, the JSON spec file needs to be reloaded anytime the login status changes. The JSON retrieval also needs to include the OAuth2 bearer token after login.
I dont think at present we will be taking that route. but keep an eye on this space, we plan to programmatically allow hide certain paths. once we provide that feature you can do it at your end. I will provide an event when a auth-key is applied, that will help you do what you exactly want.
The goal is to only show the API endpoints that are authorized. A call to retrieve the spec should include the authorization header so that endpoints could be filtered.