Repository navigation
✨ Summary
No reflection in core Refit
Refit.Reflection now handles values that are only known at run time, such as object, interface, recursive and derived types. If nothing else loads that package, register it once at startup:
using Refit;
ReflectionSupport.EnsureRegistered();
public interface IEventsApi
{
[Post("/events")]
Task Send([Body(BodySerializationMethod.UrlEncoded)] object payload);
}More generated at compile time
[EnumMember] names and nested, collection and dictionary form bodies are now generated, and form bodies of these shapes are 1.5 to 2.5 times faster:
public enum Status
{
[EnumMember(Value = "in-progress")]
InProgress,
}
public sealed class OrderForm
{
public Status Status { get; set; }
public Address Shipping { get; set; } = new();
public Dictionary<string, int> Lines { get; set; } = [];
}
public interface IOrdersApi
{
[Post("/orders")]
Task Create([Body(BodySerializationMethod.UrlEncoded)] OrderForm form);
}Typed JSON replies in Refit.Testing
Stub replies can use source-generated JSON metadata, so tests work with trimming and Native AOT:
stub.Add(Route.Get("/people/1"), Reply.With(person, TestingJsonContext.Default.TestingPerson));
stub.Add(Route.Post("/people"), Reply.With(person, TestingJsonContext.Default.TestingPerson, HttpStatusCode.Created));Trimming and build fixes
- Generated clients use modern trimming annotations instead of
Preserveattributes. - Projects that see several copies of
DynamicDependencyAttributeno longer get CS0436.
Upgrade notes
- A form value whose run-time type differs from its declared type needs
Refit.Reflection. - Enums typed only at run time keep their
[EnumMember]names only whenRefit.Reflectionis registered. - Production assemblies no longer grant each other
InternalsVisibleTo.
🗞️ What's Changed
♻️ Refactoring
- 5eaba9d refactor: remove production InternalsVisibleTo grants and reflection from core (#2397) @glennawatson
🐛 Fixes
- 13f2faa fix: use modern generated trimming dependencies @glennawatson
- 4c9a37e fix(docs): use the navy Snyk wordmark @glennawatson
- 6e533f0 fix(testing): support typed JSON replies (#2388) @glennawatson
🧹 General Changes
- a1e9896 chore: ignore operating system files in the standard .gitignore @glennawatson
- 7ad45d7 chore: use the standard .gitignore and .gitattributes @glennawatson
- f800de2 build(deps): update primitives to 10.4.0 (#2399) @glennawatson
- 890c90b ci(renovate): inherit shared update rules @glennawatson
- 9acbd2a ci: skip packages already on NuGet when pushing @glennawatson
- 391dbcb chore: turn off the PSH1114 frozen collection rule (#2394) @glennawatson
- 76f8c70 chore: turn CA1005 and CA1045 off and limit CA1822 to private and internal members (#2393) @glennawatson
- 5dd8919 ci: allow releasing an exact version @glennawatson
- 61cee5b build: use the shared Renovate preset (#2395) @glennawatson
- 72d3b70 build(deps): update TUnit to 1.88.3 (#2392) @glennawatson
- 7f3311c chore(deps): update 1 ReactiveUI package version(s) (#2391) reactiveui-deploy-app[bot]
- ba1fb23 chore: use one copyright holder and drop the years (#2400) @glennawatson
- d874b56 build(deps): update NuGet dependencies (#2386) @glennawatson
- 9c9b1b6 chore: move third-party notices to LICENSE_THIRDPARTY @glennawatson
- cec7b3f build(deps): update TUnit to 1.88.1 and Serilog to 4.4.1 (#2390) @glennawatson
- 08a8987 ci: add the ci-result check (#2396) @glennawatson
📝 Documentation
- 2e40eac docs: standardise the README header and Contribute section (#2387) @glennawatson
- 2139901 docs: exercise Refit client and testing APIs (#2389) @glennawatson
- 286ab79 docs: add Snyk to the sponsors section @glennawatson
- 997d790 docs: move the agent guidance from CLAUDE.md into AGENTS.md @glennawatson
- bc736d2 docs: link to the high-contrast Snyk logo @glennawatson
- 11b8f90 docs: send questions to GitHub Discussions @glennawatson
📦 Dependencies
- 21e868a chore(deps): update dependency reactiveui.primitives to 10.1.0 (#2383) renovate[bot]
- ed52483 chore(deps): update dependency tunit to 1.87.12 (#2366) renovate[bot]
🔗 Full Changelog: v17.0.0...v17.1.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
🤖 Automated services that contributed: reactiveui-deploy-app[bot], renovate[bot]