OrchardCoreContrib.Modules
OrchardCoreContrib.Modules copied to clipboard
Discussion: include "User" endpoints in the "Swagger Module"
Hello,
following the discussion here, I'm interested in knowing if it's possible to include user endpoints in the "Swagger Module" to retrieve user information. I looked through "OrchardCore.Users" but couldn't find any ApiController for this purpose. Should I create a custom controller?
Additionally, I tried using GraphQL and have opened a discussion here.
Thank you
I looked through "OrchardCore.Users" but couldn't find any ApiController for this purpose. Should I create a custom controller?
I think you need to expose it via ApiController
, please let me know what kind of information that you need to expose, maybe we can add it in OCC if it's not accepted in OC
@hishamco thank you for your reply.
I want to expose some properties from this User model, like: Username
, Email
, IsEnabled
, IsLockoutEnabled
, RoleNames
. I want to use it in a Orchard Core "Workflow".
I need also to add some custom properties, but first I need to check how to extend the User model to do this.
Thank you
As you know the user information is sensitive, but you can add your API controller that accesses the underlying OC.Users
APIs to achieve that
Yes I know, but I want to use it in a "Workflow", and I'm still not able to do it creating a "Query" (here the discussion), so I think the only way is to create a custom API controller.
@hishamco, Piedone replied to me here, confirming that it's possible to perform queries against the UserIndex
table. This means I can use the saved query in the "Workflow".
Thank you
@MarGraz seems your last question about the query not the Swagger which might confuse me & Zoltan to come back and forth between the two repos :)
Please wait for the reply there, and let me know if you need any help regarding the swagger module
Oh, I'm sorry 😟
I believe Zoltan's response is fine. Of course, if I need to expose a User API endpoint, I will create a custom API controller and follow your readme to include it in the Swagger.
Thank you
In case the API Controller is not approved in OC and we find it's useful we can add it in OCC.Users
module