ForgeTrust.AppSurface.Web.OpenApi 0.2.0-preview.2

This is a prerelease version of ForgeTrust.AppSurface.Web.OpenApi.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package ForgeTrust.AppSurface.Web.OpenApi --version 0.2.0-preview.2
                    
NuGet\Install-Package ForgeTrust.AppSurface.Web.OpenApi -Version 0.2.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ForgeTrust.AppSurface.Web.OpenApi" Version="0.2.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ForgeTrust.AppSurface.Web.OpenApi" Version="0.2.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="ForgeTrust.AppSurface.Web.OpenApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ForgeTrust.AppSurface.Web.OpenApi --version 0.2.0-preview.2
                    
#r "nuget: ForgeTrust.AppSurface.Web.OpenApi, 0.2.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ForgeTrust.AppSurface.Web.OpenApi@0.2.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ForgeTrust.AppSurface.Web.OpenApi&version=0.2.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ForgeTrust.AppSurface.Web.OpenApi&version=0.2.0-preview.2&prerelease
                    
Install as a Cake Tool

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 ships as a coordinated package family. Before installing this package from a prerelease feed, check the package chooser and release hub for current release risk, migration guidance, and 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 when AppSurfaceWebOpenApiOptions.ExposeEndpoint allows the active environment.
  • Production-Safe Default: Maps /openapi/{documentName}.json in 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 when StartupContext.IsDevelopment is true. 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.


📂 Back to Web List | 🏠 Back to Root

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0-preview.4 37 7/18/2026
0.2.0-preview.2 52 7/3/2026
0.2.0-preview.1 55 6/28/2026
0.1.0 113 7/2/2026
0.1.0-rc.4 71 6/16/2026
0.1.0-rc.3 67 6/8/2026
0.1.0-rc.2 62 6/3/2026
0.1.0-rc.1 65 5/31/2026
0.1.0-preview.4 71 5/25/2026
0.1.0-preview.3 68 5/20/2026
0.1.0-preview.2 68 5/14/2026