< Summary

Information
Class: Anichron.API.ApiServices
Assembly: Anichron.API
File(s): /home/runner/work/anichron/anichron/src/Anichron.API/ApiServices.cs
Tag: 19_45211875487
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 30
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
AddApiSurface(...)100%11100%

File(s)

/home/runner/work/anichron/anichron/src/Anichron.API/ApiServices.cs

#LineLine coverage
 1using Anichron.API.Endpoints;
 2using Anichron.API.Infrastructure;
 3using System.Text.Json.Serialization;
 4
 5namespace Anichron.API;
 6
 7/// <summary>The services of the API's HTTP surface: the host plumbing in <c>Infrastructure</c> plus what the endpoints 
 8public static class ApiServices
 9{
 10    extension(IServiceCollection services)
 11    {
 12        public IServiceCollection AddApiSurface(IConfiguration configuration)
 213            => services
 214                .ConfigureHttpJsonOptions(options => options.SerializerOptions.NumberHandling = JsonNumberHandling.Stric
 215                .AddOpenApi(options => options
 216                    .AddDocumentTransformer<ProblemCodeDocumentTransformer>()
 217                    .AddDocumentTransformer<EnumDocumentTransformer>())
 218                .AddApiProblems()
 219                .AddDatabase(configuration)
 220                .AddForwardedHeadersSupport(configuration)
 221                .AddAuthServices(configuration)
 222                .AddProxyEndpoints()
 223                .AddWorkItemServices()
 224                .AddAuthorizationPolicies()
 225                .AddRateLimiting(configuration)
 226                .AddCorsPolicy(configuration)
 227                .AddApiHealthChecks()
 228                .AddEndpointServices();
 29    }
 30}