-
-
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
Add return type override setting. #286
Add return type override setting. #286
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
==========================================
+ Coverage 97.65% 97.67% +0.02%
==========================================
Files 62 62
Lines 2300 2322 +22
==========================================
+ Hits 2246 2268 +22
Misses 37 37
Partials 17 17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work @DJ4ddi
I personally, don't have such a use case but if others who use this tool do then let's get this in |
Adds a new configuration setting to override the default return type generation. This is useful for applying the various special types supported by Refit, e.g.
HttpResponseMessage
,HttpContent
orIApiResponse
to a single method without changing the OpenAPI document.ResponseTypeOverride
(default is an empty dictionary).ReturnIApiResponse
setting, a utility methodRefitInterfaceGenerator.IsApiResponseType
is provided. Currently, this is only used for generating the correct documentation tags, but I figured it may be needed for other purposes in the future.I did not update any generated output. The provided example does not appear in the PetStore API, so maybe it should be changed.