-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I don't know if this is a real "bug", sorry if I created the wrong report.
It seems that some generated code is not annotated with the GeneratedCodeAttribute
attribute. Because of this the code coverage of existing projects can drop by a few %.
The following screenshot shows the output from the reportgenerator
CLI tool.

Expected Behavior
I expect this code to be excluded from the code coverage.
This is already the case for other classes for the OpenAPI feature/file.
Steps To Reproduce
- run tests with
dotnet test -- --coverage --coverage-output ./coverage.xml --coverage-output-format cobertura
- install the report generator CLI tool
dotnet tool install -g dotnet-reportgenerator-globaltool
- take a look at the coverage
reportgenerator -reports:"Foo.Tests/bin/Debug/net10.0/TestResults/coverage.xml" -targetdir:"coveragereport" -reporttypes:"Html"
If wanted, I can create a repository where this is the case.
Exceptions (if any)
/
.NET Version
10.0.100-preview.5.25277.114
Anything else?
This can probably be fixed by adding the exclude attribute to
file static class DocumentationCommentIdHelper |
file static class JsonNodeExtensions |
Other types already include the attribute,
{{GeneratedCodeAttribute}} |
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi