Configures Swagger/OpenAPI for ABP applications using Volo.Abp.Swashbuckle, including OAuth/OIDC authorization flows, hiding framework endpoints, and versioned docs.
Ships in abp-api. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ABP ships the Volo.Abp.Swashbuckle package (module AbpSwashbuckleModule) that wraps Swashbuckle with ABP-aware defaults — remote-stream schema mapping, an injected UI script, and one-line OAuth/OIDC authorize setup. Use its extension methods instead of the raw AddSwaggerGen / UseSwaggerUI.
Web / HttpApi.Host project with AddAbpSwaggerGen + UseAbpSwaggerUI.AddAbpSwaggerGenWithOAuth (authorization-code against an issuer) or AddAbpSwaggerGenWithOidc (OpenID Connect discovery, choose flows).HideAbpEndpoints.SwaggerDoc("v1", ...).[RemoteService]) — use expose-http-apis.Already present in the startup template. If missing, from the Web/HttpApi.Host project folder:
abp add-package Volo.Abp.Swashbuckle
Then add the module dependency:
[DependsOn(typeof(AbpSwashbuckleModule))]
public class MyHostModule : AbpModule { }
AddAbpSwaggerGen(Action<SwaggerGenOptions>?) in ConfigureServices, UseAbpSwaggerUI(Action<SwaggerUIOptions>?) in OnApplicationInitialization. UseAbpSwaggerUI calls UseSwaggerUI under the hood, so you still register app.UseSwagger() yourself.
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "Test API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Test API");
});
}
Add another SwaggerDoc("v2", ...) + a matching SwaggerEndpoint(...) per version to expose multiple documents.
Non-MVC / non-tiered hosts need Swagger wired to your auth server so the Authorize button works. Two helpers — pick by whether the discovery address matches the issuer.
AddAbpSwaggerGenWithOAuth(authority, scopes, setupAction?, authorizationEndpoint = "/connect/authorize", tokenEndpoint = "/connect/token") registers an oauth2 authorization-code scheme. It derives the authorize/token URLs from authority + those endpoint paths.
context.Services.AddAbpSwaggerGenWithOAuth(
authority: "https://localhost:44341",
scopes: new Dictionary<string, string> { { "Test", "Test API" } },
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "Test API", Version = "v1" });
});
Supply the client on the UI side (values must match an OpenIddict application configured elsewhere). The Swagger UI is a public (browser) client — it runs in the user's browser and can't keep a secret, so set the client id and scopes with the authorization-code flow and register the client with no secret (ABP's template registers the Swagger client as a public client). Don't call OAuthClientSecret here.
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Test API");
options.OAuthClientId("Test_Swagger");
options.OAuthScopes("Test");
});
Use AddAbpSwaggerGenWithOidc(authority, scopes?, flows?, discoveryEndpoint?, setupAction?, oidcAuthenticationScheme = "oidc") when the browser must reach the OpenID discovery document (.well-known/openid-configuration) at a different URL than the internal issuer — e.g. app deployed to a Kubernetes cluster or Docker swarm, where the public DNS resolves the metadata over the internet but tokens are validated on the internal network.
context.Services.AddAbpSwaggerGenWithOidc(
authority: configuration["AuthServer:Authority"],
scopes: new[] { "SwaggerDemo" },
flows: new[] { AbpSwaggerOidcFlows.AuthorizationCode },
// null => derive discovery from `authority`; set to the public DNS on k8s/docker
discoveryEndpoint: configuration["AuthServer:Authority"],
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "SwaggerDemo API", Version = "v1" });
});
flows is a string[] of AbpSwaggerOidcFlows constants (each shows as a choice in the Authorize modal):
AbpSwaggerOidcFlows.AuthorizationCode ("authorization_code") — default & recommended; no client secret required.AbpSwaggerOidcFlows.Implicit ("implicit") — deprecated JS-app flow.AbpSwaggerOidcFlows.Password ("password") — ROPC; needs username, password, client secret.AbpSwaggerOidcFlows.ClientCredentials ("client_credentials") — server-to-server.Pass flows: null to fall back to AuthorizationCode. Pass discoveryEndpoint: null to derive discovery from authority.
Call HideAbpEndpoints() on the SwaggerGenOptions to drop ABP's framework endpoints from the generated document:
context.Services.AddAbpSwaggerGen(options =>
{
options.HideAbpEndpoints();
});
Related SwaggerGenOptions helpers in the same package: UserFriendlyEnums() (readable enum schemas) and CustomAbpSchemaIds() (collision-safe schema ids for generic types).
/swagger. The UI loads and each SwaggerDoc(...) you declared shows in the document dropdown./swagger/v1/swagger.json and confirm your paths are present; after HideAbpEndpoints(), ABP's framework endpoints are gone.UseAbpSwaggerUI does not register UseSwagger() for you — add app.UseSwagger() before it or the swagger.json endpoint 404s.discoveryEndpoint is usually wrong or unreachable from the browser — check the browser console; the discovery URL must resolve .well-known/openid-configuration over the network the browser uses.AddAbpSwaggerGenWithOAuth only registers the scheme; you still must set OAuthClientId (and OAuthScopes) in UseAbpSwaggerUI, matching a public client registered in your auth server (that registration belongs to the OpenIddict skills, not here). Don't set a client secret for the browser-based Swagger UI.What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/configure-corsConfigure CORS (browser cross-origin access) for an ABP HTTP API host. USE FOR: the App:CorsOrigins setting (comma-separated, trailing-slash trimming), AddCors + WithOrigins, WithAbpExposedHeaders, SetIsOriginAllowedToAllowWildcardSubdomains for wildcard subdomains, the AllowCredentials vs any-origin conflict, UseCors middleware ordering, and which host/gateway to configure in tiered/microservice solutions. DO NOT USE FOR: OpenIddict client redirect / post-logout URIs (registered on the OpenIddict client application at creation/seeding, not a CORS or auth-config setting); RedirectAllowedUrls and named app URLs (configure-app-urls); CSRF/antiforgery and security response headers (secure-web-requests); calling a remote API from C# (consume-remote-services)./consume-remote-servicesCall a remote ABP HTTP API from C# through generated client proxies instead of raw HttpClient. USE FOR: setting up dynamic (runtime) or static (build-time) client proxies, configuring AbpRemoteServiceOptions (BaseUrl / named endpoints), wiring tiered / microservice calls, authenticating proxy calls (forward the current user token with AbpHttpClientIdentityModelWebModule, or client credentials with AbpHttpClientIdentityModelModule + IdentityClients), adding Polly retry to proxy clients. DO NOT USE FOR: exposing your own services as HTTP APIs or auto controllers (use expose-http-apis); choosing sync HTTP vs async events between services or the outbox/inbox (use design-module-and-service-communication); routing proxies through Dapr service invocation (use integrate-dapr-services).
/abp-api:configure-swagger-openapifrom abp-api
npx claudepluginhub abpframework/abp-skills --plugin abp-apiOther plugins' skills for the same job