Browse Source

Merge pull request #11688 from abpframework/EngincanV/issue-11677

Docs: Add Hide ABP Endpoints Section to Swagger Integration Docs
pull/11797/head
albert 5 years ago
committed by GitHub
parent
commit
ff3dd82a05
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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
If you want to hide ABP's default endpoints, call the `HideAbpEndpoints` method in your Swagger configuration as shown in the following example:
```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