< Summary

Information
Class: Gateway.Swagger.DeprecationOperationFilter
Assembly: Gateway
File(s): /home/runner/work/dotnet-microservice/dotnet-microservice/Gateway/GlobalConfigurations/Swagger/DeprecationOperationFilter.cs
Tag: 34_11887803474
Line coverage
25%
Covered lines: 1
Uncovered lines: 3
Coverable lines: 4
Total lines: 16
Line coverage: 25%
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
Apply(...)100%210%

File(s)

/home/runner/work/dotnet-microservice/dotnet-microservice/Gateway/GlobalConfigurations/Swagger/DeprecationOperationFilter.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Mvc.ApiExplorer;
 2using Microsoft.OpenApi.Models;
 3using Swashbuckle.AspNetCore.SwaggerGen;
 4
 5namespace Gateway.Swagger;
 6
 7public class DeprecationOperationFilter : IOperationFilter
 8{
 19    public DeprecationOperationFilter() { }
 10
 11    public void Apply(OpenApiOperation operation, OperationFilterContext context)
 12    {
 013        var apiDescription = context.ApiDescription;
 014        operation.Deprecated |= apiDescription.IsDeprecated();
 015    }
 16}