Refitter.Core
2.3.1-preview.121
This is a prerelease version of Refitter.Core.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Refitter.Core --version 2.3.1-preview.121
NuGet\Install-Package Refitter.Core -Version 2.3.1-preview.121
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.3.1-preview.121" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Refitter.Core" Version="2.3.1-preview.121" />
<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.3.1-preview.121
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Refitter.Core, 2.3.1-preview.121"
#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.3.1-preview.121
#: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.3.1-preview.121&prerelease
#tool nuget:?package=Refitter.Core&version=2.3.1-preview.121&prerelease
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 (>= 5.9.0)
- NSwag.CodeGeneration.CSharp (>= 14.7.1)
- NSwag.Core.Yaml (>= 14.7.1)
- OasReader (>= 3.10.2.21)
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.3.2-preview.122 | 50 | 10/26/2026 |
| 2.3.1 | 245 | 10/17/2026 |
| 2.3.1-preview.121 | 64 | 10/16/2026 |
| 2.3.1-preview.120 | 82 | 10/11/2026 |
| 2.3.1-preview.119 | 64 | 10/6/2026 |
| 2.3.1-preview.118 | 74 | 9/29/2026 |
| 2.3.0 | 174 | 9/28/2026 |
| 2.3.0-preview.117 | 69 | 9/28/2026 |
| 2.2.1 | 5,031 | 9/19/2026 |
| 2.2.1-preview.116 | 75 | 9/19/2026 |
| 2.2.0 | 214 | 9/7/2026 |
| 2.2.0-preview.115 | 85 | 9/6/2026 |
| 2.1.3 | 1,215 | 8/2/2026 |
| 2.1.2 | 162 | 7/28/2026 |
| 2.1.2-preview.114 | 77 | 7/28/2026 |
| 2.1.2-preview.113 | 80 | 7/28/2026 |
| 2.1.1 | 145 | 7/27/2026 |
| 2.1.1-preview.112 | 80 | 7/27/2026 |
| 2.1.1-preview.111 | 87 | 7/24/2026 |
| 2.1.0 | 535 | 7/5/2026 |
Loading failed