< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.OpenAPIPathMetadata
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/OpenAPIPathMetadata.cs
Tag: Kestrun/Kestrun@ca54e35c77799b76774b3805b6f075cdbc0c5fbe
Line coverage
71%
Covered lines: 15
Uncovered lines: 6
Coverable lines: 21
Total lines: 121
Line coverage: 71.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/27/2025 - 20:05:22 Line coverage: 26.3% (5/19) Total lines: 107 Tag: Kestrun/Kestrun@dec745d62965b14e1ed62c0f3ec815e60e53366f01/02/2026 - 00:16:25 Line coverage: 26.3% (5/19) Total lines: 110 Tag: Kestrun/Kestrun@8405dc23b786b9d436fba0d65fb80baa4171e1d001/09/2026 - 06:56:42 Line coverage: 36.8% (7/19) Total lines: 110 Tag: Kestrun/Kestrun@94f8107dc592fa7eaec45c0dd5f9fffbd41bc14501/12/2026 - 18:03:06 Line coverage: 71.4% (15/21) Total lines: 121 Tag: Kestrun/Kestrun@956332ccc921363590dccd99d5707fb20b50966b

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
.ctor(...)100%11100%
get_DocumentIds()100%11100%
get_OperationId()100%11100%
get_Tags()100%11100%
get_ExternalDocs()100%11100%
get_Deprecated()100%11100%
get_RequestBody()100%11100%
get_Responses()100%11100%
get_Callbacks()100%11100%
get_SecuritySchemes()100%11100%
get_PathLikeKind()100%210%
get_IsOpenApiWebhook()100%210%
get_IsOpenApiPath()100%210%
get_IsOpenApiCallback()100%210%
get_DocumentId()100%11100%
get_Expression()100%210%
get_Inline()100%210%
get_Extensions()100%11100%

File(s)

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

#LineLine coverage
 1using Kestrun.OpenApi;
 2using Microsoft.OpenApi;
 3
 4namespace Kestrun.Hosting.Options;
 5
 6/// <summary>
 7/// Metadata for OpenAPI documentation related to the route.
 8/// </summary>
 9public record OpenAPIPathMetadata : OpenAPICommonMetadata
 10{
 11    /// <summary>
 12    /// Initializes a new instance of the <see cref="OpenAPIPathMetadata"/> class with the specified pattern.
 13    /// </summary>
 14    /// <param name="pattern">The route pattern.</param>
 15    /// <param name="mapOptions">The route mapping options.</param>
 16    public OpenAPIPathMetadata(string pattern, MapRouteOptions mapOptions)
 1617        : base(pattern, mapOptions)
 18    {
 1619    }
 20
 21    /// <summary>
 22    /// Initializes a new instance of the <see cref="OpenAPIPathMetadata"/> class.
 23    /// </summary>
 24    /// <param name="mapOptions">The route mapping options.</param>
 25    public OpenAPIPathMetadata(MapRouteOptions mapOptions)
 526        : base(mapOptions)
 27    {
 528    }
 29
 30    /// <summary>
 31    /// The IDs of the OpenAPI documents this metadata belongs to.
 32    /// If empty, it belongs to all documents.
 33    /// </summary>
 2334    public List<string> DocumentIds { get; set; } = [];
 35    /// <summary>
 36    /// The unique operation ID for the route in OpenAPI documentation.
 37    /// </summary>
 1638    public string? OperationId { get; set; }
 39    /// <summary>
 40    /// Comma-separated tags for OpenAPI documentation.
 41    /// </summary>
 4042    public List<string> Tags { get; set; } = []; // Comma-separated tags
 43    /// <summary>
 44    /// External documentation reference for the route.
 45    /// </summary>
 246    public OpenApiExternalDocs? ExternalDocs { get; set; }
 47    /// <summary>
 48    /// Indicates whether the operation is deprecated in OpenAPI documentation.
 49    /// </summary>
 250    public bool Deprecated { get; set; }
 51
 52    /// <summary>
 53    /// The request body applicable for this operation.
 54    /// The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231
 55    /// has explicitly defined semantics for request bodies.
 56    /// In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.
 57    /// </summary>
 458    public IOpenApiRequestBody? RequestBody { get; set; }
 59
 60    /// <summary>
 61    /// REQUIRED. The list of possible responses as they are returned from executing this operation.
 62    /// </summary>
 2763    public OpenApiResponses? Responses { get; set; } = [];
 64
 65    /// <summary>
 66    /// A map of possible out-of band callbacks related to the parent operation.
 67    /// The key is a unique identifier for the Callback Object.
 68    /// Each value in the map is a Callback Object that describes a request
 69    /// that may be initiated by the API provider and the expected responses.
 70    /// The key value used to identify the callback object is an expression, evaluated at runtime,
 71    /// that identifies a URL to use for the callback operation.
 72    /// </summary>
 473    public IDictionary<string, IOpenApiCallback>? Callbacks { get; set; }
 74
 75    /// <summary>
 76    /// A declaration of which security mechanisms can be used for this operation.
 77    /// The list of values includes alternative security requirement objects that can be used.
 78    /// </summary>
 679    public List<Dictionary<string, List<string>>>? SecuritySchemes { get; set; }
 80
 81    /// <summary>
 82    /// The kind of OpenAPI path-like object represented by this metadata.
 83    /// </summary>
 084    public OpenApiPathLikeKind? PathLikeKind { get; set; }
 85
 86    /// <summary>
 87    /// Indicates whether this metadata represents an OpenAPI webhook.
 88    /// </summary>
 089    public bool IsOpenApiWebhook => PathLikeKind == OpenApiPathLikeKind.Webhook;
 90
 91    /// <summary>
 92    /// Indicates whether this metadata represents an OpenAPI path.
 93    /// </summary>
 094    public bool IsOpenApiPath => PathLikeKind == OpenApiPathLikeKind.Path;
 95
 96    /// <summary>
 97    /// Indicates whether this metadata represents an OpenAPI callback.
 98    /// </summary>
 099    public bool IsOpenApiCallback => PathLikeKind == OpenApiPathLikeKind.Callback;
 100
 101    /// <summary>
 102    /// The IDs of the OpenAPI document this metadata belongs to.
 103    /// If null, it belongs to all documents.
 104    /// </summary>
 2105    public string[]? DocumentId { get; set; }
 106
 107    /// <summary>
 108    /// The callback expression for the OpenAPI callback object.
 109    /// </summary>
 0110    public RuntimeExpression? Expression { get; set; }
 111
 112    /// <summary>
 113    /// Indicates whether the callback should be inlined within the parent OpenAPI document.
 114    /// </summary>
 0115    public bool Inline { get; set; }
 116
 117    /// <summary>
 118    /// A map of custom extensions for the OpenAPI object.
 119    /// </summary>
 18120    public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
 121}