Browse Source

Docs: Add Hide ABP Endpoints Section to Swagger Integration Docs

pull/11688/head
Engincan VESKE 5 years ago
parent
commit
2caba659a6
  1. 20
      docs/en/API/Swagger-Integration.md
  2. 2
      framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwashbuckleDocumentFilter.cs

20
docs/en/API/Swagger-Integration.md

@ -48,9 +48,9 @@ First, we need to use `AddAbpSwaggerGen` extension to configure Swagger in `Conf
```csharp ```csharp
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
var services = contex.Services; var services = context.Services;
//... other configarations. //... other configurations.
services.AddAbpSwaggerGen( services.AddAbpSwaggerGen(
options => options =>
@ -81,6 +81,22 @@ public override void OnApplicationInitialization(ApplicationInitializationContex
} }
``` ```
### Hide ABP Endpoints on Swagger UI
To hide ABP-related endpoints, we can use the `HideAbpEndpoints` method when configuring Swagger options. If you want to hide ABP endpoints, add the following line into your Swagger Configuration:
```csharp
services.AddAbpSwaggerGen(
options =>
{
//... other options
//Hides ABP Related endpoints on Swagger UI
options.HideAbpEndpoints();
}
)
```
## Using Swagger with OAUTH ## Using Swagger with OAUTH
For non MVC/Tiered applications, we need to configure Swagger with OAUTH to handle authorization. For non MVC/Tiered applications, we need to configure Swagger with OAUTH to handle authorization.

2
framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwashbuckleDocumentFilter.cs

@ -8,7 +8,7 @@ namespace Volo.Abp.Swashbuckle;
public class AbpSwashbuckleDocumentFilter : IDocumentFilter public class AbpSwashbuckleDocumentFilter : IDocumentFilter
{ {
protected string[] ActionUrlPrefixes = new[] {"Volo.Abp"}; protected string[] ActionUrlPrefixes = new[] {"Volo."};
public virtual void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) public virtual void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{ {

Loading…
Cancel
Save