Skip to content

Update dependency Refit.HttpClientFactory to v12#143

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/refit.httpclientfactory-12.x
Open

Update dependency Refit.HttpClientFactory to v12#143
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/refit.httpclientfactory-12.x

Conversation

@renovate

@renovate renovate Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
Refit.HttpClientFactory 10.0.112.0.0 age adoption passing confidence

Release Notes

reactiveui/refit (Refit.HttpClientFactory)

v12.0.0: 12.0.0

Overview

Refit 12.0 is a large release centred on a near-complete rewrite of how requests are built. The source generator now constructs HTTP requests inline at compile time instead of going through the reflection pipeline, making generated clients faster and friendly to trimming and Native AOT. On top of that foundation it adds response streaming, JSON Lines, naming-convention presets, and a batch of long-standing fixes. Two small, well-scoped breaking changes are called out below.

Highlights
  • Reflection-free, AOT-ready source generation. Eligible interface methods now have their request (URI, headers, body, request properties) built directly in generated code, with the reflection request-builder kept only as a fallback for shapes that cannot be generated inline. Form bodies flatten through compiled, source-generated field descriptors. The generator itself was modernised and optimised, and ships analyzer diagnostics and code fixes. There is also a generated-only client-creation mode and a build-time switch for generated request building.
  • IAsyncEnumerable<T> response streaming. Stream large responses, auto-detecting a JSON array vs JSON Lines from the content type, generated inline on the hot path.
  • JSON Lines request bodies. [Body(BodySerializationMethod.JsonLines)] plus a streaming JsonLinesContent (application/x-ndjson), wired through both the reflection and source-gen paths.
  • Naming-convention presets. RefitSettings.CamelCase() / SnakeCase() / KebabCase() configure query keys, form-url-encoded keys, and JSON body property names consistently, plus snake/kebab URL key formatters. Opt-in, so existing behaviour is unchanged.
  • Response ergonomics. EnsureSuccessStatusCodeAsync() / EnsureSuccessfulAsync() are now available directly on IApiResponse<T>; a new IsSuccessfulWithContent (and HasContent) gives a single, mock-safe success-with-content check; nullable annotations on IApiResponse<T> were corrected to be sound.
  • URL and route control. Opt-in RFC 3986 / HttpClient-style URL resolution via RefitSettings.UrlResolution, and RefitSettings.AllowUnmatchedRouteParameters to leave an unmatched {token} for a DelegatingHandler to rewrite.
  • Faster JSON. A fast-path serialization option (SystemTextJsonContentSerializer.GetFastPathJsonSerializerOptions()) and buffered/streamed request-body modes that run through it.
  • Smaller additions. [Query(SerializeNull = true)] to send a null property as key= instead of omitting it, and a public UniqueName.ForType<T>() to resolve the generated IHttpClientFactory client name.
  • Fixes. Multipart Guid/DateTime/DateTimeOffset/TimeSpan (and DateOnly/TimeOnly) are sent as plain text (#​2016); property-level [Query(delimiter, prefix)] is honoured when flattening complex objects (#​1334); [Query(Format = "")] serializes a complex value via ToString() (#​1281); and IApiResponse<T> no longer shadows base members (#​1933).
Breaking changes and migration
  • IApiResponse<T> no longer shadows base members. The new-shadowed Error, ContentHeaders, IsSuccessStatusCode, and IsSuccessful members are removed from the generic interface. Source that reads these still compiles (they bind to the inherited base members), but code compiled against v8-v11 that bound to the generic-interface slots needs a recompile. If you relied on IsSuccessful to narrow Content to non-null on an IApiResponse<T>-typed value, switch to HasContent / IsSuccessfulWithContent.
  • The default System.Text.Json serializer now reads numbers from JSON strings (NumberHandling = AllowReadingFromString). Opt back out with NumberHandling = JsonNumberHandling.Strict on your JsonSerializerOptions.

🗞️ What's Changed

💥 Breaking Changes
✨ Features
♻️ Refactoring
⚡ Performance
🧹 General Changes

🔗 Full Changelog: reactiveui/refit@v11.2.0...v12.0.0

🙌 Contributions

💖 Thanks to all the contributors: @​glennawatson

v11.2.0: 11.2.0

🗞️ What's Changed
🐛 Fixes

🔗 Full Changelog: reactiveui/refit@v11.1.0...v11.2.0

🙌 Contributions

💖 Thanks to all the contributors: @​glennawatson

v11.1.0: 11.1.0

🗞️ What's Changed
🐛 Fixes
🧹 General Changes
📝 Documentation
📦 Dependencies

🔗 Full Changelog: reactiveui/refit@v11.0.1...v11.1.0

🙌 Contributions

🌱 New contributors since the last release: @​HulinCedric
💖 Thanks to all the contributors: @​ChrisPulman, @​glennawatson, @​HulinCedric, @​PressXtoChris

🤖 Automated services that contributed: @​renovate[bot]

v11.0.1: 11.0.1

🗞️ What's Changed

🧹 General Changes
📌 Other

🔗 Full Changelog: reactiveui/refit@v11.0.0...11.0.1

🙌 Contributions

🌱 New contributors since the last release: @​xIceFox
💖 Thanks to all the contributors: @​glennawatson, @​xIceFox

v11.0.0: 11.0.0

⚠️ This is a breaking release (major: 10.x → 11.0.0)

11.0.0 reworks Refit's error/exception model and tightens interface validation. Most apps will compile, but code that inspects ApiResponse.Error, reads StatusCode, or catches transport exceptions around Refit calls will need changes. These are the same breaking changes that briefly shipped in the now‑delisted 10.1.7 and were reported by the community in #​2114.

💡 Need a drop‑in, non‑breaking replacement for 10.1.6? Use 10.2.0 — it is 10.1.6 re‑signed with a valid certificate (the 10.1.6 cert was revoked, see #​2114). Move to 11.0.0 when you're ready to adopt the changes below.

💥 What changed & how to migrate

1. ApiResponse<T>.Error is now ApiExceptionBase? (was ApiException?) (#​2052)
A new abstract base ApiExceptionBase now sits under both ApiException and the new ApiRequestException. ApiExceptionBase does not expose Content / HasContent — those still live on ApiException.

// before
string? body = response.Error?.Content;

// after — narrow to ApiException first
if (response.Error is ApiException apiEx)
{
    string? body = apiEx.Content;   // Content/HasContent are on ApiException
}

2. New ApiRequestException wraps transport/connection failures (#​2052)
Exceptions thrown by HttpClient.SendAsync before a response arrives — HttpRequestException (DNS/host unreachable), TaskCanceledException (timeouts), etc. — are now wrapped in ApiRequestException : ApiExceptionBase, carrying the full request context. For ApiResponse<T> return types these are now surfaced via .Error instead of only being thrown, so you no longer need a separate try/catch and IsSuccessful check.

// catching transport errors: catch the base (or ApiRequestException) now
catch (ApiExceptionBase ex) { /* covers ApiException + ApiRequestException */ }

3. ApiResponse<T>.StatusCode is now nullable (HttpStatusCode?) (#​2052)
When the request never reached the server there is no status code. Code that assumed a non‑null value must handle null:

int code = (int)response.StatusCode;          // ❌ won't compile / may throw
int? code = (int?)response.StatusCode;         // ✅ handle the no-response case

4. Stricter interface validation + enum name handling (#​2068)
Synchronous return types are now only permitted for generated/non‑public interface members (RestMethodInfo enforces the rule), and the System.Text.Json enum converter now maps serialized names both ways (including JsonStringEnumMemberName on .NET 9+). Interfaces that previously relied on unsupported sync members may now fail generation.


🗞️ What's Changed

✨ Features & Enhancements
⚡ Performance
🐛 Fixes
🧹 General & Housekeeping
📦 Dependencies

🙌 New Contributors

💖 Contributions

Thanks to everyone who contributed: @​ChrisPulman, @​PressXtoChris, @​james-s-tayler, @​yzhoholiev, @​dyatlov-a

🤖 Automated services that contributed: @​renovate[bot]

🔗 Full Changelog: reactiveui/refit@v10.2.0...v11.0.0

v10.2.0: 10.2.0

NOTE

This is a re-release of v10.1.6 which had a certificate revoked.

🗞️ What's Changed

🐛 Fixes
🧹 General Changes
📦 Dependencies
📌 Other

🔗 Full Changelog: reactiveui/refit@10.0.1...10.1.6

🙌 Contributions

💖 Thanks to all the contributors: @​ChrisPulman

🤖 Automated services that contributed: @​renovate[bot]

v10.1.6

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

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.

0 participants