-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing Content-Type [Headers] #619
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #619 +/- ##
===========================================
- Coverage 98.97% 85.60% -13.38%
===========================================
Files 55 56 +1
Lines 2639 3195 +556
===========================================
+ Hits 2612 2735 +123
- Misses 4 419 +415
- Partials 23 41 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@all-contributors please add @Metziell for bugs |
I've put up a pull request to add @Metziell! 🎉 |
|
This resolves #617
This pull request includes several changes to enhance the header generation functionality in the
Refitter.Core
project. The key changes involve renaming methods to reflect their purpose better, adding support for generatingContent-Type
headers, and updating tests to verify the new functionality.With the changes in the pull request, the following OpenAPI document:
Generate the following Refit interface:
Header Generation Enhancements:
Renamed the
GenerateAcceptHeaders
method toGenerateHeaders
and added logic to generateContent-Type
headers if specified in the settings. [1] [2] [3] [4] [5] [6] [7] [8]Added a new property
AddContentTypeHeaders
to theRefitGeneratorSettings
class to control the generation ofContent-Type
headers.Test Updates:
Updated existing tests in
src/Refitter.SourceGenerator.Tests/CustomGenerated/CustomGenerated.cs
to includeContent-Type
headers in theHeaders
attribute. [1] [2] [3] [4] [5] [6]Added new test classes
RequestResponseHeadersTests
andResponseHeadersTests
to verify the generation ofAccept
andContent-Type
headers. [1] [2]Modified tests in
src/Refitter.Tests/SwaggerPetstoreApizrTests.cs
andsrc/Refitter.Tests/SwaggerPetstoreTests.cs
to validate the presence or absence ofAccept
headers based on the OpenAPI specification version. [1] [2]