github reactiveui/refit v14.0.0
14.0.0

4 hours ago

Refit 14.0.0

Refit 14 is a major bug-fix and request-generation release. It fixes a broad set of correctness issues while completing the move to source-generated request building. Most clients can now build requests without runtime reflection, improving trimming, Native AOT support, startup time, and allocations.

What end users need to know

  • Check RF006 warnings before upgrading. The reflection request builder has moved out of the main package. If any API method reports RF006, add the Refit.Reflection package. Fully generated clients should not add it.
  • Some async APIs now return ValueTask. This affects the success-guard methods, DefaultApiExceptionFactory.CreateAsync, and several RefitSettings delegates. Most callers can continue to await them; code that stores a Task may need .AsTask().
  • A few request-building behaviours are intentionally different. Query objects are flattened from their declared type, serializer property names are honoured in query keys, and nested URL-encoded objects are flattened instead of using ToString().
  • Caller-owned streams remain open. Refit no longer disposes streams supplied as request bodies or multipart parts; callers are responsible for disposing them.
  • Validation timing can change. Fully generated interfaces validate route templates when the first request is built rather than when the client is created. Generated method frames also no longer appear in ApiException stack traces.
  • Empty authorization tokens now omit the header. Returning null, empty, or whitespace from AuthorizationHeaderValueGetter no longer sends a blank Authorization header.

Major fixes

  • Request generation now handles multiple generic overloads, escaped C# keyword identifiers, nullable value-type query objects, nested URL-encoded bodies, and indexed query collections correctly.
  • Caller-supplied request streams can be reused, generated helper types no longer collide across InternalsVisibleTo assemblies, and null parameter values round-trip correctly.

Highlights

  • New request controls include [PathPrefix], per-method [Timeout], absolute URLs with [Url], optional route segments, indexed query collections, header validation, and returning a built HttpRequestMessage without sending it.
  • Query objects, dictionaries, generic methods, multipart form objects, and custom return-type adapters gain broader reflection-free generation.
  • Server-Sent Events can be consumed as IAsyncEnumerable<T>, and transport exceptions can be customized with TransportExceptionFactory.
  • Runtime, reflection, and source-generator allocation reductions improve throughput; source generation is roughly twice as fast in the measured workload.

See the V14 migration details and complete feature documentation.

๐Ÿ—ž๏ธ What's Changed

๐Ÿ’ฅ Breaking Changes

โœจ Features

โ™ป๏ธ Refactoring

๐Ÿ› Fixes

โšก Performance

๐Ÿงน General Changes

โœ… Tests

๐Ÿ“ Documentation

๐Ÿ“ฆ Dependencies

๐Ÿ”— Full Changelog: v13.1.0...v14.0.0

๐Ÿ™Œ Contributions

๐ŸŒฑ New contributors since the last release: @arpitjain099, @jgarciadelanoceda, @rmja
๐Ÿ’– Thanks to all the contributors: @arpitjain099, @ChrisPulman, @Copilot, @glennawatson, @jgarciadelanoceda, @rmja, @TimothyMakkison

๐Ÿค– Automated services that contributed: @renovate[bot]

Don't miss a new refit release

NewReleases is sending notifications on new releases.