Skip to content

Class OpenApiEndpointOptions

Namespace: Cephalon.AspNetCore.Documentation
Assembly: Cephalon.AspNetCore.dll

Configures the host-level OpenAPI JSON and Scalar UI endpoints exposed by Cephalon ASP.NET Core hosts.

public sealed class OpenApiEndpointOptions

objectOpenApiEndpointOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

These options stay in the ASP.NET Core adapter because they describe HTTP route layout for generated documentation assets rather than engine-core behavior.

Initializes a new with the canonical Cephalon OpenAPI and Scalar routes.

public OpenApiEndpointOptions()

Gets the root configuration section used for OpenAPI endpoint routing.

public const string SectionName = "OpenApi"

string

Gets or sets the HTTP status codes that Cephalon’s behavior-owned REST helpers publish in OpenAPI documents by default.

public IReadOnlyList<int> BehaviorRestDocumentedStatusCodes { get; set; }

IReadOnlyList<int>

This list controls documentation metadata only. It does not change the runtime HTTP status codes emitted by ASP.NET Core.

Gets or sets the route pattern used by MapOpenApi(…).

public string RoutePattern { get; set; }

string

The pattern must include the {documentName} placeholder so versioned and named documents remain addressable.

Gets or sets the route prefix used by the Scalar UI.

public string ScalarRoutePrefix { get; set; }

string

The value may be supplied with or without a leading slash. Cephalon normalizes it to a rooted path such as /scalar.

FromConfiguration(IConfiguration, string)

Section titled “ FromConfiguration(IConfiguration, string)”

Binds and normalizes OpenAPI endpoint options from configuration.

public static OpenApiEndpointOptions FromConfiguration(IConfiguration configuration, string sectionPath = "OpenApi")

configuration IConfiguration

The application configuration root.

sectionPath string

The configuration section path to bind.

OpenApiEndpointOptions

The normalized OpenAPI endpoint options.