< Summary - Kestrun — Combined Coverage

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Key()100%11100%
get_StatusCode()100%11100%
get_Description()100%11100%
get_SchemaRef()100%11100%
get_Schema()100%11100%
get_ContentType()100%11100%
get_Inline()100%11100%

File(s)

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

#LineLine coverage
 1
 2/// <summary>
 3/// Specifies metadata for an OpenAPI response object.
 4/// Can be attached to PowerShell or C# classes representing reusable responses.
 5/// </summary>
 6[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inher
 7public sealed class OpenApiResponseAttribute : KestrunAnnotation
 8{
 9    /// <summary>
 10    /// Optional component name override for components.responses key.
 11    /// If omitted, the generator will name by member (Class.Property) when used on members,
 12    /// or by class name when applied at class-level.
 13    /// </summary>
 214    public string? Key { get; set; }
 15
 16    /// <summary>
 17    /// The HTTP status code (e.g., "200", "400", "404").
 18    /// </summary>
 219    public string StatusCode { get; set; } = "default";
 20
 21    /// <summary>
 22    /// A short description of the response (required in OpenAPI spec).
 23    /// </summary>
 624    public string? Description { get; set; }
 25
 26    /// <summary>
 27    /// Optional reference to a predefined schema (e.g., "UserInfoResponse").
 28    /// </summary>
 629    public string? SchemaRef { get; set; }
 30
 31    /// <summary>
 32    /// Optional CLR type for the response schema.
 33    /// When set, this takes precedence over SchemaRef and is
 34    /// mapped via InferPrimitiveSchema / PrimitiveSchemaMap.
 35    /// </summary>
 236    public Type? Schema { get; set; }
 37
 38    /// <summary>
 39    /// MIME type of the response payload (default: "application/json").
 40    /// </summary>
 841    public string[] ContentType { get; set; } = ["application/json"];
 42
 43    /// <summary>
 44    /// If true, the schema will be inlined rather than referenced.
 45    /// </summary>
 446    public bool Inline { get; set; }
 47}