< Summary

Information
Class: ProjectTemplate.Web.Options.ApplicationApiVersioningOptions
Assembly: ProjectTemplate.Web
File(s): /home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Web/Options/ApplicationApiVersioningOptions.cs
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_DefaultMajorVersion()100%11100%
get_DefaultMinorVersion()100%11100%
get_AssumeDefaultVersionWhenUnspecified()100%11100%
get_ReportApiVersions()100%11100%
get_EnableUrlSegmentVersioning()100%11100%
get_EnableHeaderVersioning()100%11100%
get_HeaderName()100%11100%

File(s)

/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Web/Options/ApplicationApiVersioningOptions.cs

#LineLine coverage
 1namespace ProjectTemplate.Web.Options;
 2
 3/// <summary>
 4/// Represents template-level API versioning configuration.
 5/// </summary>
 6public sealed class ApplicationApiVersioningOptions
 7{
 8    /// <summary>
 9    /// Configuration section name for API versioning settings.
 10    /// </summary>
 11    public const string SectionName = "ProjectTemplate:ApiVersioning";
 12
 13    /// <summary>
 14    /// Gets or sets the default major API version.
 15    /// </summary>
 102016    public int DefaultMajorVersion { get; set; } = 1;
 17
 18    /// <summary>
 19    /// Gets or sets the default minor API version.
 20    /// </summary>
 72621    public int DefaultMinorVersion { get; set; }
 22
 23    /// <summary>
 24    /// Gets or sets a value indicating whether an unspecified API version should use the default version.
 25    /// </summary>
 74226    public bool AssumeDefaultVersionWhenUnspecified { get; set; } = true;
 27
 28    /// <summary>
 29    /// Gets or sets a value indicating whether supported and deprecated API versions should be reported in response hea
 30    /// </summary>
 74231    public bool ReportApiVersions { get; set; } = true;
 32
 33    /// <summary>
 34    /// Gets or sets a value indicating whether URL segment versioning is enabled.
 35    /// </summary>
 102836    public bool EnableUrlSegmentVersioning { get; set; } = true;
 37
 38    /// <summary>
 39    /// Gets or sets a value indicating whether header-based versioning is enabled.
 40    /// </summary>
 103241    public bool EnableHeaderVersioning { get; set; } = true;
 42
 43    /// <summary>
 44    /// Gets or sets the request header name used for header-based API versioning.
 45    /// </summary>
 102246    public string HeaderName { get; set; } = "X-API-Version";
 47}