Scalar
ForgeTrust.Runnable.Web.Scalar
This package integrates the Scalar API Reference UI into Runnable web applications.
Overview
The RunnableWebScalarModule provides a modern, interactive API documentation interface. It depends on ForgeTrust.Runnable.Web.OpenApi and automatically configures everything needed to serve the Scalar UI.
Usage
Simply add the RunnableWebScalarModule to your module dependencies:
public class MyModule : IRunnableWebModule
{
public void RegisterDependentModules(ModuleDependencyBuilder builder)
{
builder.AddModule<RunnableWebScalarModule>();
}
// ...
}
Features
- Built-in Dependency: Automatically registers the
RunnableWebOpenApiModule. - Automatic UI Mapping: Maps the Scalar API reference endpoint using
MapScalarApiReference(). - Zero Config: Works out of the box with the default Runnable startup pipeline.
RunnableWebScalarModule
A web module that integrates Scalar API reference documentation into the application.
ConfigureServices
void ConfigureServices(StartupContext context, IServiceCollection services)
Configures services needed for Scalar; currently no implementation is required.
Parameters
contextThe startup context.servicesThe service collection.
RegisterDependentModules
void RegisterDependentModules(ModuleDependencyBuilder builder)
Registers dependencies for this module, specifically RunnableWebOpenApiModule.
Parameters
builderThe module dependency builder.
ConfigureEndpoints
void ConfigureEndpoints(StartupContext context, IEndpointRouteBuilder endpoints)
Maps the Scalar API reference endpoint.
Parameters
contextThe startup context.endpointsThe endpoint route builder.
ConfigureHostBeforeServices
void ConfigureHostBeforeServices(StartupContext context, IHostBuilder builder)
Executes pre-service host configuration; currently no implementation is required.
Parameters
contextThe startup context.builderThe host builder.
ConfigureHostAfterServices
void ConfigureHostAfterServices(StartupContext context, IHostBuilder builder)
Executes post-service host configuration; currently no implementation is required.
Parameters
contextThe startup context.builderThe host builder.
ConfigureWebApplication
void ConfigureWebApplication(StartupContext context, IApplicationBuilder app)
Configures the web application pipeline; currently no implementation is required.
Parameters
contextThe startup context.appThe application builder.