![]() |
VOOZH | about |
dotnet add package Refitter.Core --version 2.0.0
NuGet\Install-Package Refitter.Core -Version 2.0.0
<PackageReference Include="Refitter.Core" Version="2.0.0" />
<PackageVersion Include="Refitter.Core" Version="2.0.0" />Directory.Packages.props
<PackageReference Include="Refitter.Core" />Project file
paket add Refitter.Core --version 2.0.0
#r "nuget: Refitter.Core, 2.0.0"
#:package Refitter.Core@2.0.0
#addin nuget:?package=Refitter.Core&version=2.0.0Install as a Cake Addin
#tool nuget:?package=Refitter.Core&version=2.0.0Install as a Cake Tool
To use the RefitGenerator class, you need to follow these steps:
Refitter.Core NuGet package in your project.RefitGeneratorSettings class, which contains the settings used to configure the generator. Set the OpenApiPath property to the path of your OpenAPI specification file or a URL. Alternatively, set the OpenApiPaths property to an array of paths when you want to merge multiple OpenAPI specifications into a single client.RefitGenerator class by calling the CreateAsync method and passing in the RefitGeneratorSettings instance.Generate() method on the RefitGenerator instance to generate the Refit clients and interfaces based on the OpenAPI specification. This method returns the generated code as a string.Here's an example of how to use the RefitGenerator class with a single OpenAPI specification:
using Refit;
using Refitter.Core;
// Create an instance of the RefitGeneratorSettings class
var settings = new RefitGeneratorSettings
{
OpenApiPath = "Relative or absolute path to .json or .yaml local file or a URL to a .json or .yaml file"
};
// Create an instance of the RefitGenerator class
var generator = await RefitGenerator.CreateAsync(settings);
// Generate the Refit clients and interfaces and get the generated code as a string
var generatedCode = await generator.Generate();
// Use the generated code in your project
Here's an example of how to merge multiple OpenAPI specifications into a single client:
using Refit;
using Refitter.Core;
// Create an instance of the RefitGeneratorSettings class with multiple OpenAPI specs
var settings = new RefitGeneratorSettings
{
OpenApiPaths = new[]
{
"path/to/openapi-v1.json",
"path/to/openapi-v2.json"
}
};
// Create an instance of the RefitGenerator class
var generator = await RefitGenerator.CreateAsync(settings);
// Generate the merged Refit clients and interfaces
var generatedCode = await generator.Generate();
// Use the generated code in your project
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Refitter.Core:
| Package | Downloads |
|---|---|
|
Minicon.GetMyInvoices.Client
Core functionality for the GetMyInvoices Client. |
Showing the top 1 popular GitHub repositories that depend on Refitter.Core:
| Repository | Stars |
|---|---|
|
christianhelle/apiclientcodegen
A collection of Visual Studio code generators for Swagger / OpenAPI specification files
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0-preview.110 | 0 | 6/18/2026 |
| 2.0.1-preview.109 | 48 | 6/2/2026 |
| 2.0.1-preview.108 | 53 | 5/30/2026 |
| 2.0.0 | 1,268 | 5/2/2026 |
| 2.0.0-preview.107 | 62 | 4/28/2026 |
| 2.0.0-preview.106 | 61 | 4/26/2026 |
| 2.0.0-preview.105 | 60 | 4/21/2026 |
| 1.8.0-preview.104 | 55 | 4/21/2026 |
| 1.8.0-preview.103 | 64 | 4/17/2026 |
| 1.8.0-preview.102 | 65 | 4/7/2026 |
| 1.8.0-preview.101 | 80 | 3/27/2026 |
| 1.8.0-preview.100 | 67 | 3/26/2026 |
| 1.8.0-preview.99 | 69 | 3/8/2026 |
| 1.7.3 | 3,886 | 1/25/2026 |
| 1.7.3-preview.98 | 86 | 1/23/2026 |
| 1.7.3-preview.97 | 75 | 1/23/2026 |
| 1.7.3-preview.96 | 72 | 1/23/2026 |
| 1.7.3-preview.95 | 67 | 1/23/2026 |
| 1.7.3-preview.94 | 72 | 1/23/2026 |
| 1.7.3-preview.93 | 70 | 1/23/2026 |