< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.OpenApiMapRouteOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/OpenApiMapRouteOptions.cs
Tag: Kestrun/Kestrun@0d738bf294e6281b936d031e1979d928007495ff
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 56
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 12/12/2025 - 17:27:19 Line coverage: 0% (0/14) Branch coverage: 0% (0/2) Total lines: 56 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd 12/12/2025 - 17:27:19 Line coverage: 0% (0/14) Branch coverage: 0% (0/2) Total lines: 56 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)0%620%
get_DocId()100%210%
get_SpecVersion()100%210%
get_VersionVarName()100%210%
get_FormatVarName()100%210%
get_RefreshVarName()100%210%
get_DefaultFormat()100%210%
get_DefaultVersion()100%210%
get_MapOptions()100%210%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/OpenApiMapRouteOptions.cs

#LineLine coverage
 1using Microsoft.OpenApi;
 2
 3namespace Kestrun.Hosting.Options;
 4
 5/// <summary>
 6/// Options for OpenAPI map route.
 7/// </summary>
 8public record OpenApiMapRouteOptions
 9{
 10    /// <summary>
 11    /// Constructor for OpenApiMapRouteOptions.
 12    /// </summary>
 13    /// <param name="mapOptions"></param>
 014    public OpenApiMapRouteOptions(MapRouteOptions mapOptions)
 15    {
 016        MapOptions = mapOptions;
 017        if (MapOptions.Pattern == null)
 18        {
 19            //MapOptions.Pattern = "/openapi/{version:regex(^v(2\\.0|3\\.0(\\.\\d+)?|3\\.1(\\.\\d+)?)$)}/{file:regex(^([
 020            MapOptions.Pattern = "/openapi/{version}/openapi.{format}";
 21        }
 022    }
 23    /// <summary>
 24    /// The document ID to serve.
 25    /// </summary>
 026    public string DocId { get; set; } = Authentication.IOpenApiAuthenticationOptions.DefaultSchemeName;
 27    /// <summary>
 28    /// The supported OpenAPI spec versions.
 29    /// </summary>
 030    public OpenApiSpecVersion[] SpecVersion { get; set; } =
 031      [OpenApiSpecVersion.OpenApi2_0, OpenApiSpecVersion.OpenApi3_0, OpenApiSpecVersion.OpenApi3_1];
 32    /// <summary>
 33    /// The name of the route variable for version.
 34    /// </summary>
 035    public string VersionVarName { get; set; } = "version";
 36    /// <summary>
 37    /// The name of the route variable for format.
 38    /// </summary>
 039    public string FormatVarName { get; set; } = "format";
 40    /// <summary>
 41    /// The name of the query variable for refresh.
 42    /// </summary>
 043    public string RefreshVarName { get; set; } = "refresh";
 44    /// <summary>
 45    /// The default format to use if not specified in the route.
 46    /// </summary>
 047    public string DefaultFormat { get; set; } = "json";
 48    /// <summary>
 49    /// The default version to use if not specified in the route.
 50    /// </summary>
 051    public string DefaultVersion { get; set; } = "v3.0";
 52    /// <summary>
 53    /// The map route options.
 54    /// </summary>
 055    public MapRouteOptions MapOptions { get; set; }
 56}