< Summary - Kestrun — Combined Coverage

Information
Class: OpenApiProperties
Assembly: Kestrun.Annotations
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun.Annotations/OpenApi/Attributes/OpenApiProperties.cs
Tag: Kestrun/Kestrun@ca54e35c77799b76774b3805b6f075cdbc0c5fbe
Line coverage
68%
Covered lines: 32
Uncovered lines: 15
Coverable lines: 47
Total lines: 138
Line coverage: 68%
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: 52% (25/48) Total lines: 139 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd01/02/2026 - 21:56:10 Line coverage: 56.2% (27/48) Total lines: 139 Tag: Kestrun/Kestrun@f60326065ebb24cf70b241e459b37baf142e6ed601/12/2026 - 18:03:06 Line coverage: 57.4% (27/47) Total lines: 138 Tag: Kestrun/Kestrun@956332ccc921363590dccd99d5707fb20b50966b01/21/2026 - 17:07:46 Line coverage: 68% (32/47) Total lines: 138 Tag: Kestrun/Kestrun@3f6f61710c7ef7d5953cab578fe699c1e5e01a36

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Title()100%11100%
get_Description()100%11100%
get_Type()100%11100%
get_Format()100%11100%
get_Default()100%11100%
get_Example()100%11100%
get_Nullable()100%11100%
get_ReadOnly()100%11100%
get_WriteOnly()100%11100%
get_Deprecated()100%11100%
get_Array()100%11100%
get_MultipleOf()100%11100%
get_Maximum()100%11100%
get_ExclusiveMaximum()100%210%
get_Minimum()100%11100%
get_ExclusiveMinimum()100%210%
get_MaxLength()100%11100%
get_MinLength()100%11100%
get_Pattern()100%11100%
get_MaxItems()100%11100%
get_MinItems()100%11100%
get_UniqueItems()100%11100%
get_MaxProperties()100%11100%
get_MinProperties()100%11100%
get_RequiredProperties()100%11100%
get_Enum()100%11100%
get_ItemsType()100%11100%
get_AdditionalPropertiesAllowed()100%11100%
get_OneOfRefs()100%210%
get_AnyOfRefs()100%210%
get_AllOfRefs()100%210%
get_NotRef()100%210%
get_OneOfTypes()100%210%
get_AnyOfTypes()100%210%
get_AllOfTypes()100%210%
get_NotType()100%210%
get_DiscriminatorPropertyName()100%210%
get_DiscriminatorMappingKeys()100%210%
get_DiscriminatorMappingRefs()100%210%
get_ExternalDocsUrl()100%210%
get_ExternalDocsDescription()100%210%
get_XmlName()100%11100%
get_XmlNamespace()100%11100%
get_XmlPrefix()100%11100%
get_XmlAttribute()100%11100%
get_XmlWrapped()100%11100%
get_UnevaluatedProperties()100%11100%

File(s)

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

#LineLine coverage
 1
 2/// <summary>
 3/// Rich OpenAPI schema metadata for a property or a class.
 4/// Apply to:
 5/// <list type="bullet">
 6/// <item><description>Class (object-level): set <see cref="RequiredProperties"/> array, XML hints, discriminator, etc.<
 7/// <item><description>Property (member-level): set description, format, constraints, enum, etc.</description></item>
 8/// </list>
 9/// </summary>
 10public abstract class OpenApiProperties : KestrunAnnotation
 11{
 12    /// <summary>
 13    /// Human-friendly title for the schema.
 14    /// </summary>
 1415    public string? Title { get; set; }
 16    /// <summary>Markdown-capable description.</summary>
 1317    public string? Description { get; set; }
 18
 19    /// <summary>Explicit OpenAPI type override (otherwise inferred).</summary>
 1420    public OaSchemaType Type { get; set; } = OaSchemaType.None;
 1421    public string? Format { get; set; }
 22    /// <summary>Default value.</summary>
 1423    public object? Default { get; set; }
 24    /// <summary>Example value (single example).</summary>
 1625    public object? Example { get; set; }
 26    /// <summary>Marks the schema as nullable (OAS 3.0).</summary>
 1427    public bool Nullable { get; set; }
 28    /// <summary>Indicates the value is read-only (responses only).</summary>
 1429    public bool ReadOnly { get; set; }
 30    /// <summary>Indicates the value is write-only (requests only).</summary>
 1431    public bool WriteOnly { get; set; }
 32    /// <summary>Marks the schema/property as deprecated.</summary>
 1233    public bool Deprecated { get; set; }
 34    /// <summary>
 35    /// Indicates the property is an array (enables array constraints).
 36    /// </summary>
 737    public bool Array { get; set; }
 38    // ---- Numbers ----
 39    /// <summary>Value must be a multiple of this.</summary>
 1440    public decimal? MultipleOf { get; set; }
 41    /// <summary>Inclusive maximum.</summary>
 1442    public string? Maximum { get; set; }
 43    /// <summary>Exclusive maximum flag.</summary>
 044    public bool ExclusiveMaximum { get; set; }
 45    /// <summary>Inclusive minimum.</summary>
 1446    public string? Minimum { get; set; }
 47    /// <summary>Exclusive minimum flag.</summary>
 048    public bool ExclusiveMinimum { get; set; }
 49
 50    // ---- Strings ----
 51    /// <summary>Maximum length (characters).</summary>
 5352    public int MaxLength { get; set; } = -1;
 53    /// <summary>Minimum length (characters).</summary>
 5354    public int MinLength { get; set; } = -1;
 55    /// <summary>ECMA-262 compliant regex.</summary>
 1456    public string? Pattern { get; set; }
 57
 58    // ---- Arrays ----
 59    /// <summary>Max items in array.</summary>
 5360    public int MaxItems { get; set; } = -1;
 61    /// <summary>Min items in array.</summary>
 5362    public int MinItems { get; set; } = -1;
 63    /// <summary>Items must be unique.</summary>
 1464    public bool UniqueItems { get; set; }
 65
 66    // ---- Objects ----
 67    /// <summary>Max properties an object may contain.</summary>
 5368    public int MaxProperties { get; set; } = -1;
 69    /// <summary>Min properties an object must contain.</summary>
 5370    public int MinProperties { get; set; } = -1;
 71
 72    /// <summary>
 73    /// Object-level required property names (apply this on the CLASS).
 74    /// </summary>
 1475    public string[]? RequiredProperties { get; set; }
 76
 77    // ---- Enum ----
 78    /// <summary>Allowed constant values for the schema.</summary>
 1479    public object[]? Enum { get; set; }
 80
 81    // ---- Array typing ----
 82    /// <summary>Items type by OpenAPI reference (e.g., "#/components/schemas/Address").</summary>
 83    /// <summary>Items type by .NET type for code-first generators.</summary>
 184    public Type? ItemsType { get; set; }
 85
 86    /// <summary>
 87    ///  Indicates whether additionalProperties are allowed (default: false).
 88    /// </summary>
 5389    public bool AdditionalPropertiesAllowed { get; set; } = true;
 90
 91    // ---- Composition ----
 92    /// <summary>oneOf refs (by $ref).</summary>
 093    public string[]? OneOfRefs { get; set; }
 94    /// <summary>anyOf refs (by $ref).</summary>
 095    public string[]? AnyOfRefs { get; set; }
 96    /// <summary>allOf refs (by $ref).</summary>
 097    public string[]? AllOfRefs { get; set; }
 98    /// <summary>not ref (by $ref).</summary>
 099    public string? NotRef { get; set; }
 100    /// <summary>oneOf types (by .NET type).</summary>
 0101    public Type[]? OneOfTypes { get; set; }
 102    /// <summary>anyOf types (by .NET type).</summary>
 0103    public Type[]? AnyOfTypes { get; set; }
 104    /// <summary>allOf types (by .NET type).</summary>
 0105    public Type[]? AllOfTypes { get; set; }
 106    /// <summary>not type (by .NET type).</summary>
 0107    public Type? NotType { get; set; }
 108
 109    // ---- Discriminator ----
 110    /// <summary>Name of the property used to discriminate between schemas.</summary>
 0111    public string? DiscriminatorPropertyName { get; set; }
 112    /// <summary>Payload values matched by the discriminator.</summary>
 0113    public string[]? DiscriminatorMappingKeys { get; set; }
 114    /// <summary>Schema $refs that correspond to the mapping keys.</summary>
 0115    public string[]? DiscriminatorMappingRefs { get; set; }
 116
 117    // ---- External Docs ----
 118    /// <summary>External documentation URL.</summary>
 0119    public string? ExternalDocsUrl { get; set; }
 120    /// <summary>Description for the external docs.</summary>
 0121    public string? ExternalDocsDescription { get; set; }
 122
 123    // ---- XML ----
 124    /// <summary>XML element/attribute name.</summary>
 26125    public string? XmlName { get; set; }
 126    /// <summary>XML namespace.</summary>
 24127    public string? XmlNamespace { get; set; }
 128    /// <summary>XML prefix.</summary>
 20129    public string? XmlPrefix { get; set; }
 130    /// <summary>Indicates the property is an XML attribute.</summary>
 19131    public bool XmlAttribute { get; set; }
 132    /// <summary>Indicates arrays are wrapped in an enclosing element.</summary>
 16133    public bool XmlWrapped { get; set; }
 134    /// <summary>
 135    /// Sets unevaluatedProperties for OpenAPI Schema (null = generator decides).
 136    /// </summary>
 14137    public bool UnevaluatedProperties { get; set; }
 138}