< 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@0d738bf294e6281b936d031e1979d928007495ff
Line coverage
66%
Covered lines: 10
Uncovered lines: 5
Coverable lines: 15
Total lines: 65
Line coverage: 66.6%
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@826bf9dcf9db118c5de4c78a3259bce9549f0dcd

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
.ctor()100%210%
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    /// Initializes a new instance of the <see cref="OpenAPICommonMetadata"/> class with the specified pattern.
 12    /// </summary>
 13    /// <param name="pattern">The route pattern.</param>
 914    public OpenAPICommonMetadata(string pattern)
 15    {
 916        Pattern = pattern;
 917        Enabled = true;
 918    }
 19    /// <summary>
 20    /// Initializes a new instance of the <see cref="OpenAPICommonMetadata"/> class.
 21    /// </summary>
 022    public OpenAPICommonMetadata()
 23    {
 024        Pattern = "/";
 025        Enabled = true;
 026    }
 27    /// <summary>
 28    /// Indicates whether OpenAPI documentation is enabled for this route.
 29    /// </summary>
 930    public bool Enabled { get; set; }
 31
 32    /// <summary>
 33    /// The relative path for the route in OpenAPI documentation.
 34    /// </summary>
 935    public string Pattern { get; set; }
 36
 37    /// <summary>
 38    /// A brief summary of the route for OpenAPI documentation.
 39    /// </summary>
 740    public string? Summary { get; set; }
 41    /// <summary>
 42    /// A detailed description of the route for OpenAPI documentation.
 43    /// </summary>
 344    public string? Description { get; set; }
 45
 46    /// <summary>
 47    /// The name of the CORS policy to apply to this route.
 48    /// </summary>
 049    public string? CorsPolicy { get; set; }
 50
 51    /// <summary>
 52    /// An alternative server array to service this operation.
 53    /// If an alternative server object is specified at the Path Item Object or Root level,
 54    /// it will be overridden by this value.
 55    /// </summary>
 1156    public IList<OpenApiServer>? Servers { get; set; } = [];
 57
 58    /// <summary>
 59    /// A list of parameters that are applicable for this operation.
 60    /// If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
 61    /// The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and lo
 62    /// The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/
 63    /// </summary>
 1164    public IList<IOpenApiParameter>? Parameters { get; set; } = [];
 65}