OpenApiWeaver 1.0.0
dotnet add package OpenApiWeaver --version 1.0.0
NuGet\Install-Package OpenApiWeaver -Version 1.0.0
<PackageReference Include="OpenApiWeaver" Version="1.0.0" />
<PackageVersion Include="OpenApiWeaver" Version="1.0.0" />
<PackageReference Include="OpenApiWeaver" />
paket add OpenApiWeaver --version 1.0.0
#r "nuget: OpenApiWeaver, 1.0.0"
#:package OpenApiWeaver@1.0.0
#addin nuget:?package=OpenApiWeaver&version=1.0.0
#tool nuget:?package=OpenApiWeaver&version=1.0.0
OpenApiWeaver
OpenApiWeaver is an incremental Roslyn source generator that turns OpenAPI 3.x documents, including OpenAPI 3.2, into strongly typed C# HTTP clients at build time. No runtime code generation, no reflection - just plain C# emitted during compilation.
Quick Start
1. Install the package
<ItemGroup>
<PackageReference Include="OpenApiWeaver" Version="x.y.z" PrivateAssets="all" />
</ItemGroup>
2. Add your OpenAPI document
<ItemGroup>
<OpenApiWeaverDocument Include="openapi\petstore.yaml"
ClientName="PetstoreClient"
Namespace="Contoso.Generated" />
</ItemGroup>
Use OpenApiWeaverDocument rather than AdditionalFiles; the package's MSBuild targets project these items into compiler inputs automatically.
3. Use the generated client
var client = new PetstoreClient(accessToken: "your-token");
// Operations are grouped by OpenAPI tag
var pet = await client.Pets.GetAsync(petId: 1);
No extra dependencies are required — the package bundles the source generator and all analyzer assemblies.
Features
- Incremental source generation — fast, cached rebuilds via the Roslyn incremental generator pipeline
- OpenAPI 3.0-3.2 support — reads
.json,.yaml, and.ymldocuments, including OpenAPI 3.2 features such as response summaries and nullable type arrays - Tag-based sub-clients — operations grouped by OpenAPI tags, exposed as properties on the root client
- Typed request / response models — sealed classes, enums, nested inline types, dictionaries, and composition-aware schema mappings from
components/schemas - Multiple request body formats —
application/json,application/x-www-form-urlencoded, andmultipart/form-data - Security scheme support — OAuth2 / Bearer tokens, API keys (header, query, cookie)
- Runtime error handling — non-success responses throw
OpenApiException, with typedOpenApiException<TError>when error schemas are available - OpenAPI-driven XML docs — IntelliSense comments generated from document, tag, operation, response, and schema metadata with HTML stripped automatically
- Build-time diagnostics — errors and warnings reported as standard compiler diagnostics
Requirements
- .NET SDK 8.0 or later
Documentation
For detailed guides, configuration options, and schema type mapping, visit the documentation site.
License
This project is licensed under the MIT License.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 70 | 4/1/2026 |
| 1.0.0-preview9 | 72 | 3/31/2026 |
| 1.0.0-preview8 | 67 | 3/31/2026 |
| 1.0.0-preview7 | 71 | 3/30/2026 |
| 1.0.0-preview6 | 71 | 3/30/2026 |
| 1.0.0-preview5 | 75 | 3/30/2026 |
| 1.0.0-preview4 | 73 | 3/29/2026 |
| 1.0.0-preview3 | 77 | 3/29/2026 |