Refitter.Core
2.0.0
dotnet add package Refitter.Core --version 2.0.0
NuGet\Install-Package Refitter.Core -Version 2.0.0
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="Refitter.Core" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Refitter.Core" Version="2.0.0" />
<PackageReference Include="Refitter.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Refitter.Core --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Refitter.Core, 2.0.0"
#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.
#:package Refitter.Core@2.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Refitter.Core&version=2.0.0
#tool nuget:?package=Refitter.Core&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
To use the RefitGenerator class, you need to follow these steps:
- Install the
Refitter.CoreNuGet package in your project. - Create an instance of the
RefitGeneratorSettingsclass, which contains the settings used to configure the generator. Set theOpenApiPathproperty to the path of your OpenAPI specification file or a URL. Alternatively, set theOpenApiPathsproperty to an array of paths when you want to merge multiple OpenAPI specifications into a single client. - Create an instance of the
RefitGeneratorclass by calling theCreateAsyncmethod and passing in theRefitGeneratorSettingsinstance. - Call the
Generate()method on theRefitGeneratorinstance 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 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.12.0)
- NSwag.CodeGeneration.CSharp (>= 14.7.1)
- NSwag.Core.Yaml (>= 14.7.1)
- OasReader (>= 3.5.0.19)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Refitter.Core:
| Package | Downloads |
|---|---|
|
Minicon.GetMyInvoices.Client
Core functionality for the GetMyInvoices Client. |
GitHub repositories (1)
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.0.0 | 108 | 5/2/2026 |
| 2.0.0-preview.107 | 48 | 4/28/2026 |
| 2.0.0-preview.106 | 47 | 4/26/2026 |
| 2.0.0-preview.105 | 42 | 4/21/2026 |
| 1.8.0-preview.104 | 41 | 4/21/2026 |
| 1.8.0-preview.103 | 45 | 4/17/2026 |
| 1.8.0-preview.102 | 48 | 4/7/2026 |
| 1.8.0-preview.101 | 60 | 3/27/2026 |
| 1.8.0-preview.100 | 49 | 3/26/2026 |
| 1.8.0-preview.99 | 51 | 3/8/2026 |
| 1.7.3 | 2,336 | 1/25/2026 |
| 1.7.3-preview.98 | 70 | 1/23/2026 |
| 1.7.3-preview.97 | 63 | 1/23/2026 |
| 1.7.3-preview.96 | 54 | 1/23/2026 |
| 1.7.3-preview.95 | 54 | 1/23/2026 |
| 1.7.3-preview.94 | 56 | 1/23/2026 |
| 1.7.3-preview.93 | 55 | 1/23/2026 |
| 1.7.3-preview.92 | 62 | 1/23/2026 |
| 1.7.3-preview.91 | 56 | 1/23/2026 |
| 1.7.3-preview.90 | 57 | 1/23/2026 |
Loading failed