1

I have some endpoints in my REST API (Java + Spring Boot under the hood). I am using SpringFox with Swagger-UI do have some documentation. But I have a problem now. I would like to show for endpoints for user related to his role.

So, for example, some user with role A should see only /endpoint-A1 and /endpoint-A2 and user with role B should see only /endpoint-B1 and /endpoint-B2, and admin role should see all the endpoints.

As far as I researched, it is not an option to achieve this with SpringFox. And I understand that because there is no place to interact between Spring Security and SpringFox on this field. Correct me if I'm wrong.

But I thought maybe you know an option, to use Spring Boot code and generate the documentation bases on it and export it somewhere - I do not need to host it as SpringFox is doing. I only need to have this generated to separate files based on user roles. Later I will manage the user roles somehow. Do you know such a tool? Or maybe you have any idea how to achieve that in another way?

Piotr Pradzynski
  • 4,190
  • 5
  • 23
  • 43

0 Answers0