RestEase.SourceGenerator 1.5.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package RestEase.SourceGenerator --version 1.5.2
NuGet\Install-Package RestEase.SourceGenerator -Version 1.5.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RestEase.SourceGenerator" Version="1.5.2">
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RestEase.SourceGenerator --version 1.5.2
#r "nuget: RestEase.SourceGenerator, 1.5.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RestEase.SourceGenerator as a Cake Addin
#addin nuget:?package=RestEase.SourceGenerator&version=1.5.2

// Install RestEase.SourceGenerator as a Cake Tool
#tool nuget:?package=RestEase.SourceGenerator&version=1.5.2

Source generator for RestEase: the easy-to-use typesafe REST API client library, which is simple and customisable

Generates implementations for RestEase interfaces at compile-time, to provide error-checking, faster execution, and support for platforms which don't support runtime code generation (such as iOS and .NET Native).

You must be using the .NET 5 SDK (or higher) to use this. You will also need to install the RestEase package.

For more details, see

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RestEase.SourceGenerator:

Package Downloads

Client-side components of Stl.Fusion - a new implementation of "computed observables" designed to power distributed apps. Thread-safe, asynchronous, immutable, and ready to serve replicas of computed instances to remote clients.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on RestEase.SourceGenerator:

Repository Stars
Build real-time apps (Blazor included) with less than 1% of extra code responsible for real-time updates. Host 10-1000x faster APIs relying on transparent and nearly 100% consistent caching. We call it DREAM, or Distributed REActive Memoization, and it's here to turn real-time on!
🕸 Yet Another .NET Clean Architecture, but for Microservices project. It uses Minimal Clean Architecture with DDD-lite, CQRS-lite, and just enough Cloud-native patterns apply on the simple eCommerce sample and run on Tye with Dapr extension 🍻
A project which uses Source Generation to create a FluentBuilder for a specified model or DTO
Version Downloads Last updated
1.6.1 26,565 11/30/2022
1.6.0 1,201 11/6/2022
1.5.7 29,935 6/4/2022
1.5.6 14,412 4/23/2022
1.5.5 25,862 5/31/2021
1.5.4 4,541 3/11/2021
1.5.3 258 3/10/2021
1.5.2 2,671 12/17/2020
1.5.1 12,924 12/3/2020
1.5.0-preview 294 6/30/2020



- SourceGenerator: Add `<auto-generated>` comment to generated files, to keep StyleCop et al happy (#174)
- HttpClientFactory: fix types not being correctly registered (#175)


- RestEase.SourceGenerator is out of preview!
- Add support for `[BaseAddress]`
- Improve how content headers behave: if a method has a `[Body]` parameter, contents headers are always sent
- HttpClientFactory: allow passing a RequestModifier to AddRestEaseClient (#164)
- HttpClientFactory: add overloads which take a Uri
- .NET 5: Add `RestClient.HttpRequestMessageRequestInfoOptionsKey` for use with `HttpClient.Options`
- Minor bug fixes


- Support content-related headers on a method, even if the method doesn't specify a body (#156)
- Add the RestEase.SourceGenerator NuGet package (currently in preview)
- Add the RestEase.HttpClientFactory NuGet package


- Add support for multiple raw query strings (#151)
- Add netstandard1.2 target
- README improvements


- Add extended formats for property headers and header params (#123)
- Make RequestInfo available to the RequestModifier (#133)
- Add Nullable Reference Type annotations
- README improvements (#127, #129, #132, #135, #138)


- Add `[BasePath]` (#113)


- Support custom path parameter/property serialization (thanks to @sharparam). This is useful for enums (#95)
- Support setting `HttpRequestMessage.Proprties` through properties and parameters (thanks to @Husqvik) (#116)
- Allow request body headers to be sent, if the body is null (#109)


- Avoid deadlock in ModifyingHttpClientHandler (#115)
- Avoid crash if a user's HttpClientHandler returns a HttpResponseMessage with a null body (#108)
- Add assembly name to generated type name, to avoid conflicts when two assemblies both use the same interface (#108)
- Improve README (#107, #111)


- Fix crash introduced by (#98) when a method has a non-primitive struct type with a default value


- Fixed ignored QueryAttribute.Name when set using property setter (`[Query(Name = "customName")`)(#94)
- If type creation fails, make sure all subsequent attempts throw the same exception (#93)
- Support `byte[]` bodies (#91)
- Support generic methods (as well as generic interfaces) (#92)
- Support netstandard2.0 as a separate target (reduces dependencies for netstandard2.0+ projects) (#88)
- Reflect optional parameters in implementation for IronPython (#98)


- Fix memory leak (#74)
- Allow a custom class to be used to control query param serialization (#61)
- Make sure HttpResponseMessage is properly disposed (this wasn't causing a memory leak) (#82)
- Add query properties (#70)


- Ensure that methods which return `Task` properly dispose of the underlying `HttpResponseMessage` (#65)


- Add support for `Task<Stream>` responses (#56)
- Various README improvements (#53, #55, #58, #59)


- Move to abstract base classes for custom serializers and deserializers
- Add MethodInfo to the IRequestInfo, and pass to custom serializers and deserializers. This allows custom serializers and deserializers to look at e.g. custom attributes on the method which was called (#51)
- Allow an `IFormatProvider` to be specified, which overrides the culture on the thread which calls RestEase's methods (#49)
- Reduce dependency version to 6.0.1 for net45 (#52)
- Add `RestClient.For(Type type, IRequester requester)` overload (#43)


- Fix bug where unicode characters were incorrectly double-encoded (#46)
- Add support for `IRequester` properties (#38)
- Add non-generic `RestClient.For(Type type)` overload (#43)


- **BREAKING CHANGE**: Remove support for .NET 4.0. Microsoft.Bcl.Async does not work well with csproj-based .NET Core projects
- Add information about the request to ApiException (#30)
- Work around an issue when running on Mono which caused a double '??' in URLs (#35)


- Don't crash if a `[Header]` attribute on a method is used to remove one specified on the interface / on a property (#29)
- Add `RestClient` overloads which take a `Uri` (#27)


- Add support for netstandard1.1


- If you make your interface `IDisposable`, disposing it will dispose the underlying `HttpClient`
- If your method return type is `Task<HttpResponseMessage>`, use `HttpCompletionOption.ResponseHeadersRead` instead of `HttpCompletionOption.ResponseContentRead`, allowing you to control if and when the content is read.
- Add support for the HTTP Patch method
- Add `[Path(UrlEncode = false)]`, allowing URL encoding to be turned off for individual path parameters
- Remove the dependency on all of NetStandard.Library (for .NET Core targets)


- **BREAKING CHANGE**: Add a `RequestQueryParamSerializerInfo` parameter to methods on `IRequestQueryParamSerializer`
- Add support for specifying `IFormattable` format strings for query parameters, path parameters, and path properties (#21)


- Allow null BaseAddress on HttpClient
- Make ApiException constructor public, to allow easier unit testing of RestEase consumers

v1.2.1, v1.2.2

- Fix metadata fields in NuGet package (no functional changes)


- Add support for path properties - path compoments which are the same for every request (#16)
- Add support for raw, unencoded query parameters (#17)
- Support query parameters without a key
- Improve some error messages


- Avoid dependency on System.Net.Http NuGet package on .NET 4.5


- Avoid dependency on Microsoft.Net.Http on .NET 4.5


- Add support for .NET Core (.NET Standard 1.3) - thanks to [Fazouane Marouane](


- Fix a test


- Do encode '/' in path parameters


- Encode space as '%20' rather than '+' in path parameters
- Don't encode '/' in path parameters


- Fix issue where query parameters not decorated with `[Query]` would always be serialized as ToString, regardless of any `[SerializationMethod]` attributes


- Handle null paths (e.g. `[Post]` or `[Get(null)]`)


- Support .NET 4.0 (using Microsoft.Net.Http and Microsoft.Bcl.Async as dependencies)
- URL Encode path parameters


- Allow custom serialization of query parameters and query maps
- Add `[SerializationMethods]` attribute, to specify the default serialization method for bodies and query parameters
- Move to using a builder pattern for `RestClient`, to make specifying custom serializers/deserializations/configuration easier.
  The old methods are still present, but are marked as deprecated. Please upgrade to the new methods (suggested by the deprecation messages).


- Fix race condition when creating implementations (#4)


- Allow interface headers in interface inheritance (#3)
- Add missing `RestClient.For` overloads


- Allow interface inheritance (#3)


- `JsonRequestBodySerializer` sets a default Content-Type header of `application/json`


- Initial Release