grape-swagger
grape-swagger copied to clipboard
Question: How to hide endpoint documentation for specific users
Of course we want something different than 'standard'. :P
We want to make the API documentation different for our users, based on what scopes their applications have. So, ideally, the user logs in with their application credentials, and only see the documentation of their endpoints. However, would it be possible to hide endpoint documentation based on some checks of us?
We found that it is possible to add a lambda function the 'hidden' property, but since this is evaluated out of context I haven't found a way to use any request parameters or session variables. Is this correct? Is there any other way to do what we wanted? We found a method with a middleware that scrubs the endpoints from the returned body, but this is kind of ugly. Any other ideas perhaps? I'm stuck after a full day trying and searching. Any help would be appreciated a lot.
This is correct, however I think we'd welcome a feature that evaluates the endpoint condition based on the request.
Just got merged https://github.com/ruby-grape/grape-swagger/pull/493