configure-swagger-openapi
Installation
SKILL.md
Configure Swagger / OpenAPI in ABP
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.
When to Use
- Standing up the Swagger UI on a
Web/HttpApi.Hostproject withAddAbpSwaggerGen+UseAbpSwaggerUI. - Adding an Authorize button that runs a real login flow:
AddAbpSwaggerGenWithOAuth(authorization-code against an issuer) orAddAbpSwaggerGenWithOidc(OpenID Connect discovery, choose flows). - Pointing the UI at a discovery/metadata address that differs from the token issuer (k8s/docker split-DNS) — that's the specific reason to pick OIDC over OAuth.
- Hiding ABP's built-in endpoints from the document with
HideAbpEndpoints. - Declaring one or more versioned documents via
SwaggerDoc("v1", ...).
When Not to Use
- Publishing app services as controllers (Auto API Controllers,
[RemoteService]) — use expose-http-apis. - Calling a remote ABP API from C# (client proxies) — use consume-remote-services.
- API versioning strategy (query vs URL segment) — use version-http-apis.
- Configuring the OpenIddict server or JWT bearer validation — use configure-openiddict-authentication / configure-openiddict-validation. This skill only tells the Swagger UI where to authorize; it does not set up the auth server.