![]() |
VOOZH | about |
dotnet add package Microsoft.OpenApi.YamlReader --version 3.7.0
NuGet\Install-Package Microsoft.OpenApi.YamlReader -Version 3.7.0
<PackageReference Include="Microsoft.OpenApi.YamlReader" Version="3.7.0" />
<PackageVersion Include="Microsoft.OpenApi.YamlReader" Version="3.7.0" />Directory.Packages.props
<PackageReference Include="Microsoft.OpenApi.YamlReader" />Project file
paket add Microsoft.OpenApi.YamlReader --version 3.7.0
#r "nuget: Microsoft.OpenApi.YamlReader, 3.7.0"
#:package Microsoft.OpenApi.YamlReader@3.7.0
#addin nuget:?package=Microsoft.OpenApi.YamlReader&version=3.7.0Install as a Cake Addin
#tool nuget:?package=Microsoft.OpenApi.YamlReader&version=3.7.0Install as a Cake Tool
π Microsoft + OpenAPI = Love
| Package | Nuget |
|---|---|
| Models and Writers | π nuget |
| YamlReader | π nuget |
| Hidi | π nuget |
The OpenAPI.NET SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model.
See more information on the OpenAPI specification and its history here: <a href="https://www.openapis.org">OpenAPI Initiative</a>
Project Objectives:
Note: we just released a new major version of the library, which brings support for OpenAPI 3.2! You can read more about the changes of this upcoming version .
The OpenAPI.NET project holds the base object model for representing OpenAPI documents as .NET objects. Some developers have found the need to write processors that convert other data formats into this OpenAPI.NET object model. We'd like to curate that list of processors in this section of the readme.
The base JSON and YAML processors are built into this project. Below is the list of the other supported processor projects.
C# Comment / Annotation Processor : Converts standard .NET annotations ( /// comments ) emitted from your build (MSBuild.exe) into OpenAPI.NET document object.
OData CSDL Processor : Converts the XML representation of the Entity Data Model (EDM) describing an OData Service into OpenAPI.NET document object.
Creating an OpenAPI Document
var document = new OpenApiDocument
{
Info = new OpenApiInfo
{
Version = "1.0.0",
Title = "Swagger Petstore (Simple)",
},
Servers = new List<OpenApiServer>
{
new OpenApiServer { Url = "http://petstore.swagger.io/api" }
},
Paths = new OpenApiPaths
{
["/pets"] = new OpenApiPathItem
{
Operations = new()
{
[HttpMethod.Get] = new OpenApiOperation
{
Description = "Returns all pets from the system that the user has access to",
Responses = new OpenApiResponses
{
["200"] = new OpenApiResponse
{
Description = "OK"
}
}
}
}
}
}
};
Reading and writing an OpenAPI description
var (openApiDocument, _) = await OpenApiDocument.LoadAsync("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/refs/heads/main/_archive_/schemas/v3.0/pass/petstore.yaml");
// Write V2 as JSON
var outputString = await openApiDocument.SerializeAsJsonAsync(OpenApiSpecVersion.OpenApi2_0);
In order to test the validity of an OpenApi document, we avail the following tools:
A commandline tool for validating and transforming OpenAPI descriptions. Installation guidelines and documentation
Microsoft.OpenApi.Workbench
A workbench tool consisting of a GUI where you can test and convert OpenAPI descriptions in both JSON and YAML from v2-->v3 and vice versa.
git clone https://github.com/microsoft/OpenAPI.NET.git(.slnx) in the root of the project with Visual Studiosrc/Microsoft.OpenApi.Workbench directory and set it as the startup projectπ a screenshot of the workbench application
Convert to render the results.This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
To provide feedback and ask questions you can use Stack Overflow with the OpenAPI.NET tag.
| 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 is compatible. 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 5 NuGet packages that depend on Microsoft.OpenApi.YamlReader:
| Package | Downloads |
|---|---|
|
RamlToOpenApiConverter
Convert RAML file to Open API Specification |
|
|
Microsoft.OpenApi.ApiManifest
Package Description |
|
|
OasReader
An OpenAPI reader that merges external references into a single document for .NET using the [Microsoft OpenAPI](https://www.nuget.org/packages/Microsoft.OpenApi.readers) toolset |
|
|
Microsoft.OpenApi.Kiota.Builder
The core engine behind the OpenAPI based client generator. |
|
|
Microsoft.DeclarativeAgents.Manifest
This library can read, write and validate Declarative Agents and Plugin manifest files |
Showing the top 8 popular GitHub repositories that depend on Microsoft.OpenApi.YamlReader:
| Repository | Stars |
|---|---|
|
domaindrivendev/Swashbuckle.AspNetCore
Swagger tools for documenting API's built on ASP.NET Core
|
|
|
microsoft/kiota
OpenAPI based HTTP Client code generator
|
|
|
wiremock/WireMock.Net
WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on WireMock Java, but extended and different functionality. Full documentation can be found at https://wiremock.org/dotnet/.
|
|
|
dotnet/dev-proxy
Simulate API failures, throttling, and chaos β all from your command line.
|
|
|
lofcz/LLMTornado
The .NET library to build AI agents with 30+ built-in connectors.
|
|
|
Azure/apiops
APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that theyβre building.
|
|
|
MelbourneDeveloper/RestClient.Net
The safest way to make REST calls in C# with an MCP Generator
|
|
|
Kaliumhexacyanoferrat/GenHTTP
Lightweight embeddable web server written in pure C# with few dependencies to 3rd-party libraries.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.7.0 | 4,217 | 6/10/2026 |
| 3.6.0 | 8,583 | 6/1/2026 |
| 3.5.5 | 1,303 | 5/29/2026 |
| 3.5.4 | 3,853 | 5/26/2026 |
| 3.5.3 | 27,114 | 4/27/2026 |
| 3.5.2 | 7,731 | 4/14/2026 |
| 3.5.1 | 48,484 | 3/31/2026 |
| 3.5.0 | 12,821 | 3/20/2026 |
| 3.4.0 | 20,909 | 3/5/2026 |
| 3.3.1 | 109,238 | 1/22/2026 |
| 2.9.0 | 1,509 | 6/10/2026 |
| 2.8.0 | 1,429 | 6/1/2026 |
| 2.7.6 | 1,046 | 5/29/2026 |
| 2.7.5 | 930 | 5/26/2026 |
| 2.7.4 | 5,460 | 4/27/2026 |
| 2.7.3 | 9,823 | 4/14/2026 |
| 2.7.2 | 2,626 | 4/1/2026 |
| 2.7.1 | 3,612 | 3/20/2026 |
| 2.7.0 | 5,614 | 3/5/2026 |
| 2.6.1 | 18,398 | 1/22/2026 |