docs: make v12 Error.Content migration discoverable and add interface composition example#2217
Open
glennawatson wants to merge 2 commits into
Open
docs: make v12 Error.Content migration discoverable and add interface composition example#2217glennawatson wants to merge 2 commits into
glennawatson wants to merge 2 commits into
Conversation
…-composition example - Explain in the V12 breaking-changes section why `response.Error.Content` no longer compiles and show the `HasResponseError(out var apiException)` and `(response.Error as ApiException)?.Content` migration paths. - Add a searchable `Error.Content` NOTE to the README exception-handling example linking to the V12 breaking-changes section. - Document composing multiple resource-area interfaces into a single aggregate Refit client, with RestService and DI usage, plus a TOC entry.
- Show registering multiple Refit interfaces under the same httpClientName so they share one IHttpClientFactory-pooled handler and connection pool - Note the default per-interface named client is already handler-pooled, and point to passing a shared HttpClient into RestService.For<T> outside DI
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2217 +/- ##
=======================================
Coverage 99.70% 99.70%
=======================================
Files 176 176
Lines 9136 9136
Branches 1701 1701
=======================================
Hits 9109 9109
Misses 8 8
Partials 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What kind of change does this PR introduce?
What is the new behavior?
response.Error.Contentno longer compiles and shows the exact migration:HasResponseError(out var apiException)thenapiException.Content, or the shorthand(response.Error as ApiException)?.Content.Error.ContentNOTE that states it does not compile since v12, points to the working alternatives, and links to the V12 breaking-changes section.IUsersApi,IReposApi), aggregate intopublic interface IGitHubApi : IUsersApi, IReposApi;, and call methods from either base via bothRestService.For<T>andAddRefitClient<T>DI. A matching TOC entry was added.What is the current behavior?
Error(nowApiExceptionBase?) to the derivedApiExceptionwas undocumented, so users hitting theresponse.Error.Contentcompile break assumed the feature was removed.What might this PR break?
Checklist
mainbranchAdditional information
No code changes; markdown fences verified balanced.
Also documents how to share one
HttpClient/connection pool across multiple Refit interfaces (samehttpClientName, or a sharedHttpClientpassed toRestService.For<T>). Refs feature: Reuse HttpClient in Refit extension method #918.