Skip to content

Bump Refit from 11.0.1 to 12.0.0#34

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/Refit-12.0.0
Open

Bump Refit from 11.0.1 to 12.0.0#34
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/Refit-12.0.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jun 25, 2026

Copy link
Copy Markdown

Updated Refit from 11.0.1 to 12.0.0.

Release notes

Sourced from Refit's releases.

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

  • reactiveui/refit@​8b70ca1c072ac17741615e38918dfe50b970dc8b break: request-building fixes, JSON Lines, and response ergonomics (#​2155) @​glennawatson
  • reactiveui/refit@​3881cc67286012268521a58740752556ed500bcf break: add IAsyncEnumerable streaming and opt-in URL, route and JSON serialization modes (#​2157) @​glennawatson

✨ Features

  • reactiveui/refit@​6f2e43dadafdf965e6764b07220b30239990b860 feat: respect naming conventions across query, form and JSON body (#​2154) @​glennawatson
  • reactiveui/refit@​196cd4966dee21f89cc982970171e174f3249427 feat: add IsSuccessfulWithContent and correct IApiResponse nullable annotations (#​2159) @​glennawatson
  • reactiveui/refit@​e28a38438ebd16e94b41de860cc609820377170c feat: generate request construction to avoid reflection pipeline (#​2150) @​glennawatson
  • reactiveui/refit@​98982b48d27a94e0d3caac0d692ccc927db00d2c feat: reflection-free generated form serialization, opt-in null values, and public UniqueName (#​2164) @​glennawatson
  • reactiveui/refit@​bf488d6a0849184eb1d1b72368fb0d7b5c5b019f feat: improve generated clients for AOT (#​2151) @​glennawatson

♻️ Refactoring

  • reactiveui/refit@​3fd4ce6f0d76405c69c5681cc4a660ab3a708d9f refactor: replace System.Reactive with ReactiveUI.Primitives and integrate observable test helpers (#​2152) @​glennawatson
  • reactiveui/refit@​c7c14b43f9ff954cf5249a6c25e526b5bdf75eb6 refactor: align Refit with rxui coding standards and modernize (#​2149) @​glennawatson

⚡ Performance

  • reactiveui/refit@​3717256d32f6dac0503e66aad68795fe1929a2f7 perf: modernize and optimize the Refit source generator (#​2148) @​glennawatson

🧹 General Changes

  • reactiveui/refit@​0aae034524fef8a3b56074e56edc21d15f771bb7 build: update StyleSharp.Analyzers to 3.13.4 and align editorconfig (#​2163) @​glennawatson

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

🙌 Contributions

💖 Thanks to all the contributors: @​glennawatson
... (truncated)

11.2.0

🗞️ What's Changed

🐛 Fixes

  • reactiveui/refit@​13882dacbfe0466a6fb432b22f0aac224e8ce36a fix: honor parameter-level CollectionFormat for inner collections (#​2144) @​glennawatson
  • reactiveui/refit@​54a8e62f263e3867a2f6ad5de4a915d7eb266717 fix: ValidationApiException propagates ContentHeaders and uses configured serializer (#​2146) @​glennawatson
  • reactiveui/refit@​d694baf1c6297e37c483068270f8758bb54140dc fix: populate ApiException.Content when deserialization fails (#​2145) @​glennawatson

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

🙌 Contributions

💖 Thanks to all the contributors: @​glennawatson

11.1.0

🗞️ What's Changed

🐛 Fixes

  • reactiveui/refit@​be087067732c838d320c98654bf8dc6368cb7884 Fix: serialize body by runtime type for interface/abstract parameters (#​2118) (#​2119) @​HulinCedric
  • reactiveui/refit@​d58ce5a3a5d815ec93fac22cd38e2b1ba15dc246 fix: keep only baseline analyzer on legacy toolchains (#​2136) @​glennawatson
  • reactiveui/refit@​10ab2ce39ddd40f52eb0b5cb427f4caa969e96e9 fix: handle empty responses and edge cases in JSON serialization (#​2138) @​ChrisPulman @​glennawatson
  • reactiveui/refit@​f9a24abf09056d12d238d8cf15a3b123f1bc1aec fix: clearer error when a response has no request message (#​2141) @​glennawatson
  • reactiveui/refit@​98868fa8d893090b81cb4c2ba7c67c114505b4ce fix: detect nullable CancellationToken parameters (#​2139) @​glennawatson
  • reactiveui/refit@​7a3489ef3772047858104e88ab13c6ba9c2d4c93 fix: correct URL and query string building edge cases (#​2137) @​glennawatson
  • reactiveui/refit@​8f9b4606f932f5ef65911aa0c4b5aaf64c4e4411 fix: request building edge cases for headers, query and enum params (#​2140) @​glennawatson

🧹 General Changes

  • reactiveui/refit@​988d17ab40281b22d017d0226eede0ccc4b54613 build: adopt central package management and modernize MSBuild (#​2142) @​glennawatson

📝 Documentation

  • reactiveui/refit@​2989a5e7044804231cb7072342a67aaa0cf71760 docs: Fix Refit 10 typo that should be Refit 11 (#​2143) @​PressXtoChris

📦 Dependencies

  • reactiveui/refit@​b71c90c70e19d1ad366455a56d4782938cc8d258 Update dotnet monorepo (#​2123) @​renovate[bot]
  • reactiveui/refit@​b2e3c17c9a614260da21c910da991cc18705a141 Update ASP.NET Core (#​2122) @​renovate[bot]
  • reactiveui/refit@​5f67752c26dc07851a77f2f42084fceca05ef106 chore(deps): update dotnet monorepo to v8 (#​2130) @​renovate[bot]
  • reactiveui/refit@​780979c8bda4bc96f13e84e07060db83317b2de8 Update Microsoft.Testing to 18.8.0 (#​2126) @​renovate[bot]

🔗 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]

Commits viewable in compare view.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---
updated-dependencies:
- dependency-name: Refit
  dependency-version: 12.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Jun 25, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the dependency to a new major version. While the version string is correctly updated in the configuration file, the PR does not address several documented breaking changes that affect how API responses are handled and how JSON is deserialized. Specifically, the removal of shadowed members and changes to default number handling in JSON could lead to compilation failures or runtime regressions.

There is a notable discrepancy between the PR description—which acknowledges the need to transition type-narrowing logic (e.g., from IsSuccessful to new properties)—and the actual diff, which lacks these updates. Furthermore, no unit or integration tests have been included to verify that existing API clients remain compatible with the updated source-generation and response-handling logic.

About this PR

  • The transition from 'IsSuccessful' to 'HasContent' or 'IsSuccessfulWithContent' for type narrowing is missing from the diff, despite being a documented requirement for this library update and mentioned in the PR description.
  • The library upgrade introduces documented breaking changes, such as the removal of shadowed members and updated JSON number handling, which require verification and potentially manual code adjustments to prevent runtime failures.
  • No unit or integration tests were added or updated to confirm that the existing API integrations are compatible with the new major version's source-generation and deserialization logic.

Test suggestions

  • Verify that existing code using IApiResponse compiles and functions correctly given the removal of shadowed members (Error, ContentHeaders, etc.).
  • Validate that the change in default System.Text.Json NumberHandling (now allowing reading from strings) does not break existing numeric deserialization logic.
  • Confirm that existing API clients still function correctly with the new source-generated request building logic.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that existing code using IApiResponse<T> compiles and functions correctly given the removal of shadowed members (Error, ContentHeaders, etc.).
2. Validate that the change in default System.Text.Json NumberHandling (now allowing reading from strings) does not break existing numeric deserialization logic.
3. Confirm that existing API clients still function correctly with the new source-generated request building logic.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants