< Summary - Kestrun — Combined Coverage

Information
Class: KrPartAttribute
Assembly: Kestrun.Annotations
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun.Annotations/Form/KrPartAttribute.cs
Tag: Kestrun/Kestrun@d9261bd752e45afa789d10bc0c82b7d5724d9589
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 84
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 02/05/2026 - 00:28:18 Line coverage: 100% (9/9) Total lines: 84 Tag: Kestrun/Kestrun@d9261bd752e45afa789d10bc0c82b7d5724d9589

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Description()100%11100%
get_Required()100%11100%
get_AllowMultiple()100%11100%
get_ContentTypes()100%11100%
get_Extensions()100%11100%
get_MaxBytes()100%11100%
get_DecodeMode()100%11100%
get_DestinationPath()100%11100%
get_StoreToDisk()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun.Annotations/Form/KrPartAttribute.cs

#LineLine coverage
 1
 2
 3/// <summary>
 4/// Defines a rule for a named multipart part.
 5/// </summary>
 6[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, 
 7public sealed class KrPartAttribute : KestrunAnnotation
 8{
 9    /// <summary>
 10    /// Gets or sets the description of the part.
 11    /// </summary>
 3712    public string? Description { get; set; }
 13
 14    /// <summary>
 15    /// Gets or sets a value indicating whether the part is required.
 16    /// </summary>
 9417    public bool Required { get; set; }
 18
 19    /// <summary>
 20    /// Gets or sets a value indicating whether multiple parts with the same name are allowed.
 21    /// </summary>
 8722    public bool AllowMultiple { get; set; } = true;
 23
 24    /// <summary>
 25    /// Gets or sets the allowed content types for the part.
 26    /// </summary>
 19227    public string[] ContentTypes { get; set; } = [];
 28
 29    /// <summary>
 30    /// Gets or sets the allowed file extensions for file parts.
 31    /// </summary>
 8632    public string[] Extensions { get; set; } = [];
 33
 34    /// <summary>
 35    /// Gets or sets the maximum number of bytes allowed for the part.
 36    /// </summary>
 11337    public long MaxBytes { get; set; }
 38
 39    /// <summary>
 40    /// Gets or sets the decode mode for the part.
 41    /// </summary>
 3742    public KrPartDecodeMode DecodeMode { get; set; } = KrPartDecodeMode.None;
 43
 44    /// <summary>
 45    /// Gets or sets the destination path override for the part.
 46    /// </summary>
 3747    public string? DestinationPath { get; set; }
 48
 49    /// <summary>
 50    /// Gets or sets a value indicating whether the part should be stored to disk.
 51    /// </summary>
 8652    public bool StoreToDisk { get; set; } = true;
 53}
 54
 55/// <summary>
 56/// Represents decode mode options for parts (scaffold only).
 57/// </summary>
 58public enum KrPartDecodeMode
 59{
 60    /// <summary>
 61    /// No decoding.
 62    /// </summary>
 63    None,
 64
 65    /// <summary>
 66    /// Decode as UTF-8 text.
 67    /// </summary>
 68    TextUtf8,
 69
 70    /// <summary>
 71    /// Decode as JSON (placeholder).
 72    /// </summary>
 73    Json,
 74
 75    /// <summary>
 76    /// Decode as Base64 (placeholder).
 77    /// </summary>
 78    Base64,
 79
 80    /// <summary>
 81    /// Decode as Base64 URL (placeholder).
 82    /// </summary>
 83    Base64Url
 84}