< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.OpenAPIMetadata
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/OpenAPIMetadata.cs
Tag: Kestrun/Kestrun@0d738bf294e6281b936d031e1979d928007495ff
Line coverage
41%
Covered lines: 5
Uncovered lines: 7
Coverable lines: 12
Total lines: 70
Line coverage: 41.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 10/13/2025 - 16:52:37 Line coverage: 100% (5/5) Total lines: 28 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e12/12/2025 - 17:27:19 Line coverage: 41.6% (5/12) Total lines: 70 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
.ctor()100%210%
get_OperationId()100%11100%
get_Tags()100%11100%
get_ExternalDocs()100%210%
get_Deprecated()100%210%
get_RequestBody()100%210%
get_Responses()100%11100%
get_Callbacks()100%210%
get_SecuritySchemes()100%210%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/OpenAPIMetadata.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 OpenAPIMetadata : OpenAPICommonMetadata
 9{
 10    /// <summary>
 11    /// Initializes a new instance of the <see cref="OpenAPIMetadata"/> class with the specified pattern.
 12    /// </summary>
 13    /// <param name="pattern">The route pattern.</param>
 14    public OpenAPIMetadata(string pattern)
 915        : base(pattern)
 16    {
 917    }
 18
 19    /// <summary>
 20    /// Initializes a new instance of the <see cref="OpenAPIMetadata"/> class.
 21    /// </summary>
 022    public OpenAPIMetadata()
 23    {
 024    }
 25    /// <summary>
 26    /// The unique operation ID for the route in OpenAPI documentation.
 27    /// </summary>
 528    public string? OperationId { get; set; }
 29    /// <summary>
 30    /// Comma-separated tags for OpenAPI documentation.
 31    /// </summary>
 1732    public List<string> Tags { get; set; } = []; // Comma-separated tags
 33    /// <summary>
 34    /// External documentation reference for the route.
 35    /// </summary>
 036    public OpenApiExternalDocs? ExternalDocs { get; set; }
 37    /// <summary>
 38    /// Indicates whether the operation is deprecated in OpenAPI documentation.
 39    /// </summary>
 040    public bool Deprecated { get; set; }
 41
 42    /// <summary>
 43    /// The request body applicable for this operation.
 44    /// The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231
 45    /// has explicitly defined semantics for request bodies.
 46    /// In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.
 47    /// </summary>
 048    public IOpenApiRequestBody? RequestBody { get; set; }
 49
 50    /// <summary>
 51    /// REQUIRED. The list of possible responses as they are returned from executing this operation.
 52    /// </summary>
 1153    public OpenApiResponses? Responses { get; set; } = [];
 54
 55    /// <summary>
 56    /// A map of possible out-of band callbacks related to the parent operation.
 57    /// The key is a unique identifier for the Callback Object.
 58    /// Each value in the map is a Callback Object that describes a request
 59    /// that may be initiated by the API provider and the expected responses.
 60    /// The key value used to identify the callback object is an expression, evaluated at runtime,
 61    /// that identifies a URL to use for the callback operation.
 62    /// </summary>
 063    public IDictionary<string, IOpenApiCallback>? Callbacks { get; set; }
 64
 65    /// <summary>
 66    /// A declaration of which security mechanisms can be used for this operation.
 67    /// The list of values includes alternative security requirement objects that can be used.
 68    /// </summary>
 069    public List<Dictionary<string, List<string>>>? SecuritySchemes { get; set; }
 70}