When generating Swagger/OpenAPI documentation in v4 it do not contain endpoints for users or roles/permissions. In v3 we have the user-permissions-roles and user-permissions-users endpoints.
However in v4 I can use the /users endpoint but can not get role(s) and the populate and fields query parameters are not available.
What can I do to get the user roles with the new v4 REST APIs?
BTW - The new API endpoints are much better than before. I use Client Generator for TypeScript/Angular which generates the service and model classes from the OpenAPI spec json file - ready to use in just a few seconds. Well done!
Any solutions for this please, its urgent?
Previously v3, I used to get user.role after login in response but now I get this: also seems like I can’t use populate=* too.
Hello mate.
Yes, indeed in V4 there are a bug where user-role relationship will not populate even if you use the populate argument in your query. For now there is a work around to this until the official version is fixed
Create a strapi-server.js file in /src/extensions/users-permissions/ and put this code in