RazorDocs Search
API Reference

OpenApi

Type

AppSurfaceWebOpenApiModule

Source

A web module that integrates OpenAPI/Swagger document generation into the application.

Remarks

Use AppSurfaceWebOpenApiModule when AppSurface should own the default OpenAPI service and endpoint wiring for an app. The module registers ASP.NET Core OpenAPI generation, endpoint API exploration, document and operation transformers, and maps the OpenAPI endpoint during endpoint configuration. The default document title is {ApplicationName} | v1, and the built-in transformers remove the framework implementation tag ForgeTrust.AppSurface.Web while preserving other tags. Register a custom module or add additional OpenAPI options when an application needs multiple documents, custom versioning, authentication metadata, or different tag policies. Pitfall: transformer tag collections may be null and this module must run before consumers expect the MapOpenApi endpoint to be mapped.

Method

ConfigureServices

void ConfigureServices(StartupContext context, IServiceCollection services) Source

Configures services needed for OpenAPI, including document and operation transformers to customize the generated schema.

Parameters

  • contextThe startup context that supplies the application name used in the generated document title.
  • servicesThe service collection receiving OpenAPI and endpoint exploration registrations.

Remarks

ConfigureServices reads StartupContext.ApplicationName for the default document title, registers singleton-safe transformer delegates through ASP.NET Core OpenAPI options, and adds endpoint API exploration. Call this through normal AppSurface module startup rather than invoking it after the host service provider has been built.

Method

ConfigureEndpoints

void ConfigureEndpoints(StartupContext context, IEndpointRouteBuilder endpoints) Source

Maps the OpenAPI document endpoint.

Parameters

  • contextThe startup context.
  • endpointsThe endpoint route builder.
Method

RegisterDependentModules

void RegisterDependentModules(ModuleDependencyBuilder builder) Source

Registers dependencies for this module; currently no implementation is required.

Parameters

  • builderThe module dependency builder.
Method

ConfigureHostBeforeServices

void ConfigureHostBeforeServices(StartupContext context, IHostBuilder builder) Source

Executes pre-service host configuration; currently no implementation is required.

Parameters

  • contextThe startup context.
  • builderThe host builder.
Method

ConfigureHostAfterServices

void ConfigureHostAfterServices(StartupContext context, IHostBuilder builder) Source

Executes post-service host configuration; currently no implementation is required.

Parameters

  • contextThe startup context.
  • builderThe host builder.
Method

ConfigureWebApplication

void ConfigureWebApplication(StartupContext context, IApplicationBuilder app) Source

Configures the web application pipeline; currently no implementation is required.

Parameters

  • contextThe startup context.
  • appThe application builder.