Check the docs before asking a question: https://abp.io/docs/latest
Check the samples to see the basic tasks: https://abp.io/docs/latest/samples
The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info:
🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration
button.
- ABP Framework version: v8.0
- UI Type: Blazor WASM
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
I need to make an API Document for my application. I wonder if the Swagger page contains ALL of APIs? For example, where is the definition for API "/connect/token"?
Thanks,
1 Answer(s)
-
0
Hello, some endpoints of ABP are ignored using
ApiExplorerSettings
attribute for security reasons. For exampleTokenController
: https://github.com/abpframework/abp/blob/8d1d89ac7fe3082e342add226e97f417e7f9d287/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.cs#L12If you want to see them in the swagger, you can follow these steps:
1-) Create class
ForceApiExplorerVisibilityConvention
in the AuthServer like the below:public class ForceApiExplorerVisibilityConvention : IApplicationModelConvention { public void Apply(ApplicationModel application) { foreach (var controller in application.Controllers) { // Controller seviyesinde Ignore edilmişse if (controller.ApiExplorer != null && controller.ApiExplorer.IsVisible == false) { controller.ApiExplorer.IsVisible = true; } // Aksiyon seviyesinde Ignore edilmişse foreach (var action in controller.Actions) { if (action.ApiExplorer != null && action.ApiExplorer.IsVisible == false) { action.ApiExplorer.IsVisible = true; } } } } }
2-) Add the following code blocks to the ConfigureServices method of module class in AuthServer project:
context.Services.AddControllers(options => { options.Conventions.Add(new ForceApiExplorerVisibilityConvention()); });
If swagger is added in your
AuthServer
project, you can see the related endpoints as in the picture below: