AppSurface Search
API Reference

Scalar

Type

AppSurfaceWebScalarModule

Source

A web module that integrates Scalar API reference documentation into the application.

Remarks

The Scalar UI is available in development by default and hidden in non-development environments unless both Scalar and the AppSurface-owned OpenAPI document are explicitly exposed. Exposing Scalar does not add authentication or authorization; production hosts must protect the route separately when it is reachable by untrusted users.

Method

ConfigureServices

void ConfigureServices(StartupContext context, IServiceCollection services) Source

Configures services needed for Scalar, including endpoint exposure options.

Parameters

  • contextThe startup context.
  • servicesThe service collection.
Method

RegisterDependentModules

void RegisterDependentModules(ModuleDependencyBuilder builder) Source

Registers dependencies for this module, specifically AppSurfaceWebOpenApiModule.

Parameters

  • builderThe module dependency builder.
Method

ConfigureEndpoints

void ConfigureEndpoints(StartupContext context, IEndpointRouteBuilder endpoints) Source

Maps the Scalar API reference endpoint when Scalar and OpenAPI exposure options both allow it.

Parameters

  • contextThe startup context.
  • endpointsThe endpoint route 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.
Type

AppSurfaceWebScalarOptions

Source

Configures AppSurface's Scalar API reference endpoint mapping behavior.

Remarks

Scalar depends on the AppSurface-owned OpenAPI document in the default integration. The Scalar UI is mapped only when this option allows Scalar exposure and AppSurfaceWebOpenApiOptions.ExposeEndpoint also allows the backing OpenAPI endpoint in the same environment. This option does not add authentication or authorization.

Property

ExposeEndpoint

AppSurfaceApiDocumentationEndpointExposure ExposeEndpoint { get; set; } Source

Gets or sets when the Scalar API reference endpoint should be mapped.