domaindrivendev / Swashbuckle.AspNetCore

Swagger tools for documenting API's built on ASP.NET Core
MIT License
5.26k stars 1.32k forks source link

fix: Pass props to multi targeting #3107

Closed xC0dex closed 1 month ago

xC0dex commented 1 month ago

Pull Request

The issue or feature being addressed

This PR fixes #2706 by passing the defined Swashbuckle.AspNetCore.props file to the buildMultiTargeting directory, which is used for outer builds (Multi targeting).

Details on the issue fix or feature implementation

The props file defines that the OpenApiGenerateDocumentsOnBuild property is false by default if it's not set. However, this was not set for multi targeting projects. So the document was generated during the build.

martincostello commented 1 month ago

I guess there's not an easy way to add a test for this, right?

codecov-commenter commented 1 month ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.50%. Comparing base (d11913e) to head (0e7b686). Report is 6 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3107 +/- ## ======================================= Coverage 90.50% 90.50% ======================================= Files 76 76 Lines 3116 3116 Branches 515 515 ======================================= Hits 2820 2820 Misses 296 296 ``` | [Flag](https://app.codecov.io/gh/domaindrivendev/Swashbuckle.AspNetCore/pull/3107/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Richard+Morris) | Coverage Δ | | |---|---|---| | [Linux](https://app.codecov.io/gh/domaindrivendev/Swashbuckle.AspNetCore/pull/3107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Richard+Morris) | `90.50% <ø> (ø)` | | | [Windows](https://app.codecov.io/gh/domaindrivendev/Swashbuckle.AspNetCore/pull/3107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Richard+Morris) | `81.80% <ø> (-8.70%)` | :arrow_down: | | [macOS](https://app.codecov.io/gh/domaindrivendev/Swashbuckle.AspNetCore/pull/3107/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Richard+Morris) | `90.50% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Richard+Morris#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

xC0dex commented 1 month ago

I guess there's not an easy way to add a test for this, right?

You're right. It’s hard to test as it happens during the dotnet pack command. However, I tested it locally by publishing Swashbuckle and using the package in a multi target project. Before the change the document was generated during the build. After the change this was no longer the case.