ForgeTrust.AppSurface.Web.OpenApi
0.1.0-rc.1
dotnet add package ForgeTrust.AppSurface.Web.OpenApi --version 0.1.0-rc.1
NuGet\Install-Package ForgeTrust.AppSurface.Web.OpenApi -Version 0.1.0-rc.1
<PackageReference Include="ForgeTrust.AppSurface.Web.OpenApi" Version="0.1.0-rc.1" />
<PackageVersion Include="ForgeTrust.AppSurface.Web.OpenApi" Version="0.1.0-rc.1" />
<PackageReference Include="ForgeTrust.AppSurface.Web.OpenApi" />
paket add ForgeTrust.AppSurface.Web.OpenApi --version 0.1.0-rc.1
#r "nuget: ForgeTrust.AppSurface.Web.OpenApi, 0.1.0-rc.1"
#:package ForgeTrust.AppSurface.Web.OpenApi@0.1.0-rc.1
#addin nuget:?package=ForgeTrust.AppSurface.Web.OpenApi&version=0.1.0-rc.1&prerelease
#tool nuget:?package=ForgeTrust.AppSurface.Web.OpenApi&version=0.1.0-rc.1&prerelease
ForgeTrust.AppSurface.Web.OpenApi
This package provides a modular integration for OpenAPI (Swagger) document generation in AppSurface web applications.
Overview
The AppSurfaceWebOpenApiModule simplifies the configuration of OpenAPI by:
- Registering the necessary services via
AddOpenApi. - Configuring the
EndpointsApiExplorer. - Mapping the OpenAPI documentation endpoint when endpoint exposure options allow it.
- Providing default document and operation transformers to clean up and brand the generated documentation based on the
StartupContext.
Release Guidance
AppSurface has cut the first coordinated v0.1.0 release candidate. Before installing this package from a prerelease feed, read the v0.1.0 RC 1 release note for current release risk, migration guidance, and package readiness.
Usage
To enable OpenAPI support in your application, add the AppSurfaceWebOpenApiModule as a dependency in your root module:
public class MyModule : IAppSurfaceWebModule
{
public void RegisterDependentModules(ModuleDependencyBuilder builder)
{
builder.AddModule<AppSurfaceWebOpenApiModule>();
}
// ...
}
Features
- Document Transformation: Automatically updates the API title and tags based on the application name defined in the
StartupContext. - Controlled Endpoint Mapping: Calls
endpoints.MapOpenApi()during endpoint configuration only whenAppSurfaceWebOpenApiOptions.ExposeEndpointallows the active environment. - Production-Safe Default: Maps
/openapi/{documentName}.jsonin Development and hides it in non-development environments unless the host opts in.
Endpoint Exposure
AppSurfaceWebOpenApiOptions binds from the AppSurfaceWebOpenApi configuration section.
{
"AppSurfaceWebOpenApi": {
"ExposeEndpoint": "DevelopmentOnly"
}
}
ExposeEndpoint uses AppSurfaceApiDocumentationEndpointExposure:
DevelopmentOnly(0): maps the OpenAPI endpoint only whenStartupContext.IsDevelopmentistrue. This is the default.Always(1): maps the endpoint in every environment.Never(2): never maps the endpoint, including in Development.
Use Always only when the host intentionally exposes API metadata and protects it with host-owned controls such as authorization, private networking, or a reverse proxy policy. AppSurface only decides whether to map the endpoint; it does not add authentication or authorization.
Code-first configuration is also supported:
services.Configure<AppSurfaceWebOpenApiOptions>(options =>
{
options.ExposeEndpoint = AppSurfaceApiDocumentationEndpointExposure.Always;
});
Invalid enum values fail options validation at startup when the options are read.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CliWrap (>= 3.10.1)
- ForgeTrust.AppSurface.Web (>= 0.1.0-rc.1)
- Microsoft.AspNetCore.OpenApi (>= 10.0.8)
- Microsoft.Extensions.Hosting (>= 10.0.8)
- Microsoft.Extensions.Logging.Console (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ForgeTrust.AppSurface.Web.OpenApi:
| Package | Downloads |
|---|---|
|
ForgeTrust.AppSurface.Web.Scalar
ForgeTrust.AppSurface.Web.Scalar package for AppSurface application composition. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-rc.1 | 27 | 5/31/2026 |
| 0.1.0-preview.4 | 58 | 5/25/2026 |
| 0.1.0-preview.3 | 55 | 5/20/2026 |
| 0.1.0-preview.2 | 59 | 5/14/2026 |