Microsoft.OpenApi.YamlReader
3.11.0
Prefix Reserved
dotnet add package Microsoft.OpenApi.YamlReader --version 3.11.0
NuGet\Install-Package Microsoft.OpenApi.YamlReader -Version 3.11.0
<PackageReference Include="Microsoft.OpenApi.YamlReader" Version="3.11.0" />
<PackageVersion Include="Microsoft.OpenApi.YamlReader" Version="3.11.0" />
<PackageReference Include="Microsoft.OpenApi.YamlReader" />
paket add Microsoft.OpenApi.YamlReader --version 3.11.0
#r "nuget: Microsoft.OpenApi.YamlReader, 3.11.0"
#:package Microsoft.OpenApi.YamlReader@3.11.0
#addin nuget:?package=Microsoft.OpenApi.YamlReader&version=3.11.0
#tool nuget:?package=Microsoft.OpenApi.YamlReader&version=3.11.0

OpenAPI.NET
| Package | Nuget |
|---|---|
| Models and Writers | |
| YamlReader |
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:
- Provide a single shared object model in .NET for OpenAPI descriptions.
- Include the most primitive Reader for ingesting OpenAPI JSON and YAML documents in both V2 and V3 formats.
- Provide OpenAPI description writers for both V2 and V3 specification formats.
- Enable developers to create Readers that translate different data formats into OpenAPI descriptions.
Installation
- Install core Nuget package Microsoft.OpenApi
- Install Yaml Reader Nuget package Microsoft.OpenApi.YamlReader
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 in the upgrade guide.
Processors
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.
Example Usage
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);
Validating/Testing OpenAPI descriptions
Microsoft.OpenApi.Hidi is a command line tool for validating and transforming OpenAPI descriptions. The OpenAPI.NET v3-compatible tool is maintained in OpenAPI.NET.OData's main branch. See its installation guidelines and documentation.
Contributing
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 opencode@microsoft.com 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 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 is compatible. 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. |
-
.NETStandard 2.0
- Microsoft.OpenApi (>= 3.11.0)
- SharpYaml (>= 2.1.5)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.OpenApi (>= 3.11.0)
- SharpYaml (>= 2.1.5)
NuGet packages (39)
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 |
GitHub repositories (8)
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.11.0 | 0 | 10/19/2026 | |
| 3.10.2 | 138,565 | 8/20/2026 | |
| 3.10.0 | 14,466 | 8/12/2026 | |
| 3.9.0 | 28,670 | 7/15/2026 | |
| 3.8.0 | 93,357 | 7/6/2026 | |
| 3.7.0 | 64,520 | 6/10/2026 | |
| 3.6.0 | 27,642 | 6/1/2026 | |
| 3.5.5 | 2,651 | 5/29/2026 | |
| 3.5.4 | 33,008 | 5/26/2026 | |
| 3.5.3 | 38,350 | 4/27/2026 | |
| 2.13.0 | 0 | 10/19/2026 | |
| 2.12.2 | 99,193 | 8/20/2026 | |
| 2.12.1 | 1,577 | 8/20/2026 | |
| 2.12.0 | 48,986 | 8/12/2026 | |
| 2.11.0 | 50,355 | 7/15/2026 | |
| 2.10.0 | 11,289 | 7/6/2026 | |
| 2.9.0 | 38,387 | 6/10/2026 | |
| 2.8.0 | 2,948 | 6/1/2026 | |
| 2.7.6 | 44,699 | 5/29/2026 | |
| 2.7.5 | 66,169 | 5/26/2026 |