< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.OpenAPICommonMetadata
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/OpenAPICommonMetadata.cs
Tag: Kestrun/Kestrun@ca54e35c77799b76774b3805b6f075cdbc0c5fbe
Line coverage
94%
Covered lines: 17
Uncovered lines: 1
Coverable lines: 18
Total lines: 73
Line coverage: 94.4%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
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: 66.6% (10/15) Total lines: 65 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd01/02/2026 - 00:16:25 Line coverage: 66.6% (12/18) Total lines: 73 Tag: Kestrun/Kestrun@8405dc23b786b9d436fba0d65fb80baa4171e1d001/09/2026 - 06:56:42 Line coverage: 94.4% (17/18) Total lines: 73 Tag: Kestrun/Kestrun@94f8107dc592fa7eaec45c0dd5f9fffbd41bc145

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_MapOptions()100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
get_Enabled()100%11100%
get_Pattern()100%11100%
get_Summary()100%11100%
get_Description()100%11100%
get_CorsPolicy()100%210%
get_Servers()100%11100%
get_Parameters()100%11100%

File(s)

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

#LineLine coverage
 1using Microsoft.OpenApi;
 2
 3namespace Kestrun.Hosting.Options;
 4
 5/// <summary>
 6/// Metadata for OpenAPI documentation related to the route.
 7/// </summary>
 8public record OpenAPICommonMetadata
 9{
 10    /// <summary>
 11    /// The route mapping options associated with this metadata.
 12    /// </summary>
 2113    public MapRouteOptions MapOptions { get; init; }
 14    /// <summary>
 15    /// Initializes a new instance of the <see cref="OpenAPICommonMetadata"/> class with the specified pattern.
 16    /// </summary>
 17    /// <param name="pattern">The route pattern.</param>
 18    /// <param name="mapOptions">The route mapping options.</param>
 1619    public OpenAPICommonMetadata(string pattern, MapRouteOptions mapOptions)
 20    {
 1621        Pattern = pattern;
 1622        MapOptions = mapOptions;
 1623        Enabled = true;
 1624    }
 25    /// <summary>
 26    /// Initializes a new instance of the <see cref="OpenAPICommonMetadata"/> class.
 27    /// </summary>
 28    /// <param name="mapOptions">The route mapping options.</param>
 529    public OpenAPICommonMetadata(MapRouteOptions mapOptions)
 30    {
 531        Pattern = "/";
 532        MapOptions = mapOptions;
 533        Enabled = true;
 534    }
 35    /// <summary>
 36    /// Indicates whether OpenAPI documentation is enabled for this route.
 37    /// </summary>
 2338    public bool Enabled { get; set; }
 39
 40    /// <summary>
 41    /// The relative path for the route in OpenAPI documentation.
 42    /// </summary>
 2343    public string Pattern { get; set; }
 44
 45    /// <summary>
 46    /// A brief summary of the route for OpenAPI documentation.
 47    /// </summary>
 1848    public string? Summary { get; set; }
 49    /// <summary>
 50    /// A detailed description of the route for OpenAPI documentation.
 51    /// </summary>
 1452    public string? Description { get; set; }
 53
 54    /// <summary>
 55    /// The name of the CORS policy to apply to this route.
 56    /// </summary>
 057    public string? CorsPolicy { get; set; }
 58
 59    /// <summary>
 60    /// An alternative server array to service this operation.
 61    /// If an alternative server object is specified at the Path Item Object or Root level,
 62    /// it will be overridden by this value.
 63    /// </summary>
 2564    public IList<OpenApiServer>? Servers { get; set; } = [];
 65
 66    /// <summary>
 67    /// A list of parameters that are applicable for this operation.
 68    /// If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
 69    /// The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and lo
 70    /// The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/
 71    /// </summary>
 2572    public IList<IOpenApiParameter>? Parameters { get; set; } = [];
 73}