Skip to content

Fixes examples, issues 2058, 1761, 1889, and 2056#2061

Merged
ChrisPulman merged 2 commits intomainfrom
FixesExamples
Mar 20, 2026
Merged

Fixes examples, issues 2058, 1761, 1889, and 2056#2061
ChrisPulman merged 2 commits intomainfrom
FixesExamples

Conversation

@ChrisPulman
Copy link
Member

What kind of change does this PR introduce?

update

What is the current behavior?

#2058
#1761
#1889
#2056

What is the new behavior?

closes #2058 (Newtonsoft async deserialization path)
Updated NewtonsoftJsonContentSerializer to use async-friendly content read behavior.
Added test coverage proving no sync-only stream requirement:
Refit.Tests/SerializedContentTests.cs
Test: StreamDeserialization_UsingNewtonsoftJsonContentSerializer_DoesNotUseSynchronousReads

closes #1761 (AuthorizationHeaderValueGetter with supplied HttpClient)
Implemented token application from AuthorizationHeaderValueGetter during request construction when using supplied HttpClient overloads.
Propagated method CancellationToken to the getter delegate.
Added tests:
Refit.Tests/AuthenticatedClientHandlerTests.cs
AuthorizationHeaderValueGetterIsUsedWhenSupplyingHttpClient
AuthorizationHeaderValueGetterDoesNotOverrideExplicitTokenWhenSupplyingHttpClient
Refit.Tests/RequestBuilder.cs
AuthorizationHeaderValueGetterReceivesMethodCancellationToken

closes #1889 (ignore query properties)
Added support to skip query properties marked with:
[IgnoreDataMember]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
Added test:
Refit.Tests/RequestBuilder.cs
PostWithObjectQueryParameterSkipsIgnoredProperties

closes #2056 (customer header issue)
Added documentation warning and guidance about handler lifetimes + per-request state:
README.md (important guidance for IHttpClientFactory / delegating handler pooling)
Also added/updated example material demonstrating safer patterns.

Resolves issues with samples, refactored and extended, updated for current code base.

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.17%. Comparing base (0155eeb) to head (82ada74).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2061      +/-   ##
==========================================
+ Coverage   82.00%   82.17%   +0.16%     
==========================================
  Files          36       36              
  Lines        2657     2681      +24     
  Branches      419      424       +5     
==========================================
+ Hits         2179     2203      +24     
  Misses        375      375              
  Partials      103      103              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisPulman ChrisPulman changed the title Fixes examples Fixes examples, issues 2058, 1761, 1889, and 2056 Mar 20, 2026
@ChrisPulman ChrisPulman merged commit cfe6862 into main Mar 20, 2026
6 checks passed
@ChrisPulman ChrisPulman deleted the FixesExamples branch March 20, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants