Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: include "User" endpoints in the "Swagger Module" #116

Open
MarGraz opened this issue Feb 26, 2024 · 8 comments
Open

Discussion: include "User" endpoints in the "Swagger Module" #116

MarGraz opened this issue Feb 26, 2024 · 8 comments

Comments

@MarGraz
Copy link

MarGraz commented Feb 26, 2024

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

@MarGraz MarGraz changed the title Discussion: include user endpoints in the "Swagger Module" Discussion: include "User" endpoints in the "Swagger Module" Feb 26, 2024
@hishamco
Copy link
Member

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

@MarGraz
Copy link
Author

MarGraz commented Feb 27, 2024

@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

@hishamco
Copy link
Member

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

@MarGraz
Copy link
Author

MarGraz commented Feb 27, 2024

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.

@MarGraz
Copy link
Author

MarGraz commented Feb 28, 2024

@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

@hishamco
Copy link
Member

@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

@MarGraz
Copy link
Author

MarGraz commented Feb 28, 2024

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

@hishamco
Copy link
Member

In case the API Controller is not approved in OC and we find it's useful we can add it in OCC.Users module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants