Bump Refit from 11.0.1 to 12.0.0#45
Conversation
--- 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>
|
Superseded by #46. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
The PR updates the Refit library to version 12.0.0 but introduces two major risks that should prevent merging. First, the companion package Refit.HttpClientFactory remains on version 11.0.1, which is likely to cause runtime assembly binding errors or API incompatibilities within the Refit ecosystem. Second, the upgrade to 12.0.0 involves significant breaking changes—specifically the removal of member shadowing in IApiResponse and changes to default JSON number handling—that are not addressed in the provided code changes. These omissions pose a high risk of logic regressions in network-facing components.
About this PR
- The upgrade to Refit 12.0.0 introduces breaking changes, including the removal of shadowed members in
IApiResponseand modifications to default JSON number handling. As the current diff only modifies the package version file, there is a significant risk that existing API client implementations relying on these behaviors will break at runtime.
Test suggestions
- Verify project compilation and execution of Refit-based API clients after the major version upgrade.
- Verify that any usages of IApiResponse.IsSuccessful or .IsSuccessStatusCode are updated if they relied on the previous shadowing behavior.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify project compilation and execution of Refit-based API clients after the major version upgrade.
2. Verify that any usages of IApiResponse<T>.IsSuccessful or .IsSuccessStatusCode are updated if they relied on the previous shadowing behavior.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| <PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.8" /> | ||
| <PackageVersion Include="Refit" Version="11.0.1" /> | ||
| <PackageVersion Include="Refit" Version="12.0.0" /> | ||
| <PackageVersion Include="Refit.HttpClientFactory" Version="11.0.1" /> |
There was a problem hiding this comment.
🔴 HIGH RISK
Updating 'Refit' to 12.0.0 while leaving its companion package 'Refit.HttpClientFactory' at 11.0.1 creates a version mismatch. These packages are part of the same library ecosystem and should be kept in sync to avoid runtime assembly binding issues or incompatible API surfaces.
| <PackageVersion Include="Refit.HttpClientFactory" Version="11.0.1" /> | |
| <PackageVersion Include="Refit.HttpClientFactory" Version="12.0.0" /> |
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
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.[Body(BodySerializationMethod.JsonLines)]plus a streamingJsonLinesContent(application/x-ndjson), wired through both the reflection and source-gen paths.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.EnsureSuccessStatusCodeAsync()/EnsureSuccessfulAsync()are now available directly onIApiResponse<T>; a newIsSuccessfulWithContent(andHasContent) gives a single, mock-safe success-with-content check; nullable annotations onIApiResponse<T>were corrected to be sound.RefitSettings.UrlResolution, andRefitSettings.AllowUnmatchedRouteParametersto leave an unmatched{token}for aDelegatingHandlerto rewrite.SystemTextJsonContentSerializer.GetFastPathJsonSerializerOptions()) and buffered/streamed request-body modes that run through it.[Query(SerializeNull = true)]to send a null property askey=instead of omitting it, and a publicUniqueName.ForType<T>()to resolve the generatedIHttpClientFactoryclient name.Guid/DateTime/DateTimeOffset/TimeSpan(andDateOnly/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 viaToString()(#1281); andIApiResponse<T>no longer shadows base members (#1933).Breaking changes and migration
IApiResponse<T>no longer shadows base members. Thenew-shadowedError,ContentHeaders,IsSuccessStatusCode, andIsSuccessfulmembers 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 onIsSuccessfulto narrowContentto non-null on anIApiResponse<T>-typed value, switch toHasContent/IsSuccessfulWithContent.System.Text.Jsonserializer now reads numbers from JSON strings (NumberHandling = AllowReadingFromString). Opt back out withNumberHandling = JsonNumberHandling.Stricton yourJsonSerializerOptions.🗞️ 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
... (truncated)
11.2.0
🗞️ What's Changed
🐛 Fixes
🔗 Full Changelog: reactiveui/refit@v11.1.0...v11.2.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
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]
Commits viewable in compare view.
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 rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill 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 versionwill 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 dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)