Skip to content

docs: make v12 Error.Content migration discoverable and add interface composition example#2217

Merged
ChrisPulman merged 2 commits into
mainfrom
docs/v12-error-content-and-interface-composition
Jul 14, 2026
Merged

docs: make v12 Error.Content migration discoverable and add interface composition example#2217
ChrisPulman merged 2 commits into
mainfrom
docs/v12-error-content-and-interface-composition

Conversation

@glennawatson

@glennawatson glennawatson commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

  • Documentation.

What is the new behavior?

  • The V12 breaking-changes section now explains why response.Error.Content no longer compiles and shows the exact migration: HasResponseError(out var apiException) then apiException.Content, or the shorthand (response.Error as ApiException)?.Content.
  • The README "Handling exceptions" example now carries a searchable Error.Content NOTE that states it does not compile since v12, points to the working alternatives, and links to the V12 breaking-changes section.
  • The README "Interface inheritance" section has a new "Composing multiple APIs into one client" subsection: split an API by resource area (IUsersApi, IReposApi), aggregate into public interface IGitHubApi : IUsersApi, IReposApi;, and call methods from either base via both RestService.For<T> and AddRefitClient<T> DI. A matching TOC entry was added.

What is the current behavior?

What might this PR break?

  • None. Documentation only.

Checklist

  • I have read the Contribute guide
  • Tests have been added or updated (for bug fixes / features) - N/A, docs only
  • Docs have been added or updated
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

  • No code changes; markdown fences verified balanced.

  • Also documents how to share one HttpClient/connection pool across multiple Refit interfaces (same httpClientName, or a shared HttpClient passed to RestService.For<T>). Refs feature: Reuse HttpClient in Refit extension method #918.

…-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.
@glennawatson glennawatson marked this pull request as ready for review July 14, 2026 13:44
- 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

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.70%. Comparing base (841ff03) to head (bc7337e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@glennawatson glennawatson marked this pull request as draft July 14, 2026 14:27
@glennawatson glennawatson marked this pull request as ready for review July 14, 2026 14:43
@ChrisPulman ChrisPulman merged commit 544db0b into main Jul 14, 2026
14 checks passed
@ChrisPulman ChrisPulman deleted the docs/v12-error-content-and-interface-composition branch July 14, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs]: Make v12 migration for response.Error.Content (Error -> ApiExceptionBase) discoverable Document Interface Composition Working Example

2 participants