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 IHttpConnectionFactory for non-HttpClient support #6688
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6688 +/- ##
==========================================
- Coverage 78.98% 78.16% -0.82%
==========================================
Files 2903 2541 -362
Lines 139771 127135 -12636
==========================================
- Hits 110397 99379 -11018
+ Misses 29374 27756 -1618
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Last thought: if preferred, we could omit the new classes and simply change the code generator to add the 2 lines at the top of the client generation function:
|
IHttpConnectionFactory
that returnsIHttpConnection
DefaultHttpConnectionFactory
Closes #6647
I started by trying to modify
IHttpClientFactory
, but quickly realized it is deeply entangled with the Microsoft implementation thereof. Instead, I opted to implement a new factory for the higher-orderIHttpConnection
. However, this necessitated changing some dependencies, especially notably I had to addMicrosoft.Extensions.Http
to the StrawberryShake Tools package (assuming we want to colocateDefaultHttpConnectionFactory
withDefaultHttpClientFactory
, that is).Finally, I'm not sure if I've correctly injected the DefaultHttpConnectionFactory into the DI. I would expect that StrawberryShake should automatically provide this feature for clients so that it does not break any existing clients when new code is generated. However, I'm not sure where that's currently being done for
DefaultHttpClientFactory
(I only see it referenced in CommandTools.cs, so I'm not sure how it's being injected by default for clients) @michaelstaib