Bump Refit from 11.0.1 to 12.0.0#34
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>
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
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
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)