< Summary - Kestrun — Combined Coverage

Information
Class: OpenApiHeaderAttribute
Assembly: Kestrun.Annotations
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun.Annotations/OpenApi/Attributes/OpenApiHeaderAttribute.cs
Tag: Kestrun/Kestrun@0d738bf294e6281b936d031e1979d928007495ff
Line coverage
78%
Covered lines: 11
Uncovered lines: 3
Coverable lines: 14
Total lines: 61
Line coverage: 78.5%
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: 78.5% (11/14) Total lines: 61 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_StatusCode()100%210%
get_Key()100%11100%
get_Description()100%11100%
get_Required()100%11100%
get_Deprecated()100%11100%
get_AllowEmptyValue()100%11100%
get_Style()100%11100%
get_Explode()100%11100%
get_Type()100%11100%
get_Format()100%210%
get_Example()100%11100%
get_AllowReserved()100%11100%
get_ExampleRef()100%210%
get_SchemaRef()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun.Annotations/OpenApi/Attributes/OpenApiHeaderAttribute.cs

#LineLine coverage
 1/// <summary>
 2/// Specifies metadata for an OpenAPI Header component. Can be applied to classes,
 3/// properties, or fields to contribute entries under components.headers.
 4/// </summary>
 5[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inher
 6public sealed class OpenApiHeaderAttribute : KestrunAnnotation
 7{
 8    /// <summary>
 9    /// The HTTP status code (e.g., "200", "400", "404").
 10    /// This is only used when applied to method parameters to
 11    /// associate the property with a specific response.
 12    /// </summary>
 013    public string? StatusCode { get; set; }
 14
 15    /// <summary>Optional component key override. If omitted, generator will use class/member naming rules.</summary>
 316    public required string? Key { get; set; }
 17
 18    /// <summary>Header description.</summary>
 219    public string? Description { get; set; }
 20
 21    /// <summary>Whether the header is required.</summary>
 222    public bool Required { get; set; }
 23
 24    /// <summary>Whether the header is deprecated.</summary>
 225    public bool Deprecated { get; set; }
 26
 27    /// <summary>Whether the header allows empty value.</summary>
 228    public bool AllowEmptyValue { get; set; }
 29
 30    /// <summary>Serialization style hint.</summary>
 131    public OaParameterStyle Style { get; set; } = OaParameterStyle.Simple;
 32
 33    /// <summary>Explode flag for serialization.</summary>
 234    public bool Explode { get; set; }
 35
 36    /// <summary>Schema reference (components.schemas) for the header value.</summary>
 137    public required string Type { get; set; }
 38
 39    /// <summary>
 40    /// Format hint for the header value (e.g., "date-time", "uuid").
 41    /// </summary>
 042    public string? Format { get; set; }
 43
 44    /// <summary>Inline example for header value.</summary>
 345    public object? Example { get; set; }
 46
 47    /// <summary>
 48    /// When true, indicates that the header value allows reserved characters.
 49    /// </summary>
 250    public bool AllowReserved { get; set; }
 51
 52    /// <summary>
 53    /// Optional reference to an example component (e.g., "ExampleUser").
 54    /// </summary>
 055    public string? ExampleRef { get; set; }
 56
 57    /// <summary>
 58    /// Optional reference to a schema component (e.g., "HeaderSchema").
 59    /// </summary>
 360    public string? SchemaRef { get; set; }
 61}