< Summary

Information
Class: ArturRios.Util.WebApi.Configuration.WebApiStartupOptions
Assembly: ArturRios.Util.WebApi
File(s): /home/runner/work/dotnet-webapi-util/dotnet-webapi-util/src/Configuration/WebApiStartupOptions.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 27
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 5
Fully covered methods: 5
Total methods: 5
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Swagger()100%11100%
get_TraceActivity()100%11100%
get_UseInvalidModelStateEnvelope()100%11100%
get_CorsPolicy()100%11100%
get_Middlewares()100%11100%

File(s)

/home/runner/work/dotnet-webapi-util/dotnet-webapi-util/src/Configuration/WebApiStartupOptions.cs

#LineLine coverage
 1using ArturRios.Util.WebApi.Middleware;
 2
 3namespace ArturRios.Util.WebApi.Configuration;
 4
 5/// <summary>Options that tune the standard sequence <see cref="WebApiStartup"/> builds the application with.</summary>
 6public class WebApiStartupOptions
 7{
 8    /// <summary>Whether and how Swagger is generated and served.</summary>
 419    public WebApiSwaggerOptions Swagger { get; } = new();
 10
 11    /// <summary>Whether <see cref="TraceActivityMiddleware"/> logs the client's IP address and tags it on the request's
 12    /// activity. Both default to <see langword="true"/>. A <c>Configure&lt;TraceActivityOptions&gt;</c> call in
 13    /// <c>ConfigureServices</c> runs after these values are applied, so it wins.</summary>
 5414    public TraceActivityOptions TraceActivity { get; } = new();
 15
 16    /// <summary>Whether invalid model state is answered with a failed <c>DataOutput</c> envelope (see
 17    /// <see cref="ServiceCollectionExtensions.AddInvalidModelStateEnvelope"/>). Defaults to <see langword="true"/>.</su
 4118    public bool UseInvalidModelStateEnvelope { get; set; } = true;
 19
 20    /// <summary>The name of the CORS policy to apply, registered in <c>ConfigureServices</c> with <c>AddCors</c>.
 21    /// Applied before authentication so preflight requests pass. <see langword="null"/> (the default) for no CORS.</sum
 2122    public string? CorsPolicy { get; set; }
 23
 24    /// <summary>Additional <see cref="WebApiMiddleware"/> types, added in order after the standard middlewares and
 25    /// before the endpoints.</summary>
 4226    public List<Type> Middlewares { get; } = [];
 27}