SaveApis.Framework

Documentation for SaveApis.Framework

View on GitHub

OpenApiInstaller — Web

Key: OpenApi
Default Enabled:
Package: SaveApis.Framework.Web


Purpose

Generates an OpenAPI (v3) document from the registered controllers and exposes it at /openapi/v1.json. When Zitadel is enabled, the document is automatically enhanced with an OAuth2 Authorization Code security scheme.


What It Does

Builder phase:

Application phase:


Dependencies

Dependency Direction Requirement Description
AuthenticationInstaller After Optional  
AuthorizationInstaller After Optional  
ZitadelInstaller After Optional Required to inject the Zitadel security scheme
ControllerInstaller After Required Controllers must be registered before OpenAPI document is generated
ScalarInstaller Before Optional Scalar reads the OpenAPI document

Configuration

This installer has no dedicated configuration section. It reads Zitadel:Authority and Zitadel:Scopes from the Zitadel section (via GetOption<ZitadelOptions>) to build the security scheme.

See ZitadelInstaller configuration for those options.


InstallerContext Extension

installer.WithOpenApi(bool enabled = true);

Example — disable in production:

if (!builder.Environment.IsDevelopment())
    installer.WithOpenApi(false);

Notes