![]() |
VOOZH | about |
dotnet add package Microsoft.OpenApi.Readers --version 1.6.29
NuGet\Install-Package Microsoft.OpenApi.Readers -Version 1.6.29
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.29" />
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.29" />Directory.Packages.props
<PackageReference Include="Microsoft.OpenApi.Readers" />Project file
paket add Microsoft.OpenApi.Readers --version 1.6.29
#r "nuget: Microsoft.OpenApi.Readers, 1.6.29"
#:package Microsoft.OpenApi.Readers@1.6.29
#addin nuget:?package=Microsoft.OpenApi.Readers&version=1.6.29Install as a Cake Addin
#tool nuget:?package=Microsoft.OpenApi.Readers&version=1.6.29Install as a Cake Tool
| Package | Nuget |
|---|---|
| Models and Writers | 👁 nuget |
| Readers | 👁 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
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 Dictionary<OperationType, OpenApiOperation>
{
[OperationType.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 httpClient = new HttpClient
{
BaseAddress = new Uri("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/")
};
var stream = await httpClient.GetStreamAsync("master/examples/v3.0/petstore.yaml");
// Read V3 as YAML
var openApiDocument = new OpenApiStreamReader().Read(stream, out var diagnostic);
// Write V2 as JSON
var outputString = openApiDocument.Serialize(OpenApiSpecVersion.OpenApi2_0, OpenApiFormat.Json);
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(.sln) in the root of the project with Visual Studiosrc/Microsoft.OpenApi.Workbench directory and set it as the startup project<img src="https://user-images.githubusercontent.com/36787645/235884441-f45d2ef7-c27b-4e1a-a890-d6f7fbef87c3.png" width="700" height="500">
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 was computed. 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.Readers:
| Package | Downloads |
|---|---|
|
ConvertApi
ConvertAPI for .NET — one call to turn Office files into PDF or back again (DOCX ⇄ PDF, XLSX ⇄ PDF, PPTX ⇄ PDF). Convert HTML, images, ebooks, email, zip; merge, split, watermark, compress, OCR, redact, protect or repair PDF. Async, cross-platform, .NET Standard 2.0+ / .NET Core 5-9 |
|
|
Microsoft.Plugins.Manifest
This library can read, write and validate plugin manifest files |
|
|
Microsoft.SemanticKernel.Plugins.OpenApi
Semantic Kernel OpenAPI Plugins |
|
|
Treyt.Yarp.ReverseProxy.Swagger
Package Description |
|
|
Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration
Library that translates Visual Studio C# Annotations into .NET objects representing OpenAPI specification. |
Showing the top 20 popular GitHub repositories that depend on Microsoft.OpenApi.Readers:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
kurrent-io/KurrentDB
KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.
|
|
|
microsoft/Power-Fx
Power Fx low-code programming language
|
|
|
Azure/data-api-builder
Data API builder provides modern REST, GraphQL endpoints and MCP tools to your Azure Databases and on-prem stores.
|
|
|
aspnet/AspLabs
Repo for ASP.NET experiments that are not ready for a production release
|
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
|
|
|
microsoftgraph/msgraph-sdk-powershell
Powershell SDK for Microsoft Graph
|
|
|
jenius-apps/nightingale-rest-api-client
A modern, resource-efficient REST API client for Windows
|
|
|
dotnet/arcade
Tools that provide common build infrastructure for multiple .NET Foundation projects.
|
|
|
dotnet/HttpRepl
The HTTP Read-Eval-Print Loop (REPL) is a lightweight, cross-platform command-line tool that's supported everywhere .NET Core is supported and is used for making HTTP requests to test ASP.NET Core web APIs and view their results.
|
|
|
dotnet/dotnet-monitor
This repository contains the source code for .NET Monitor - a tool that allows you to gather diagnostic data from running applications using HTTP endpoints
|
|
|
alexandrehtrb/Pororoca
An API testing tool with support for HTTP/2 and HTTP/3. Alternative to Postman.
|
|
|
natenho/Mockaco
🐵 HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting
|
|
|
serverlessworkflow/synapse
Serverless Workflow Management System (WFMS)
|
|
|
liuhll/silky
The Silky framework is designed to help developers quickly build a microservice development framework through simple code and configuration under the .net platform.
|
|
|
microsoft/OpenAPI.NET.CSharpAnnotations
Generates OpenAPI Document from C# Annotations
|
|
|
OPCFoundation/UA-ModelCompiler
ModelCompiler converts XML files into C# and ANSI C
|
|
|
Altinn/altinn-studio
Next generation open source Altinn platform and applications.
|
|
|
BlossomiShymae/Needlework.Net
🪡 A .NET helper development tool for the LCU and Game Client!
|
|
|
Avanade/Beef
The Business Entity Execution Framework (Beef) framework, and the underlying code generation, has been primarily created to support the industrialization of API development.
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2.0.0-preview.13 | 8,466 | 3/14/2025 | 2.0.0-preview.13 is deprecated because it is no longer maintained. |
| 2.0.0-preview.12 | 5,132 | 3/7/2025 | 2.0.0-preview.12 is deprecated because it is no longer maintained. |
| 2.0.0-preview.11 | 1,095 | 3/3/2025 | 2.0.0-preview.11 is deprecated because it is no longer maintained. |
| 1.6.29 | 214,922 | 4/14/2026 | |
| 1.6.28 | 1,519,909 | 10/6/2025 | |
| 1.6.27 | 37,243 | 10/2/2025 | |
| 1.6.26 | 69,586 | 9/22/2025 | |
| 1.6.25 | 260,324 | 8/22/2025 | |
| 1.6.24 | 1,853,639 | 4/1/2025 | |
| 1.6.23 | 2,017,070 | 12/20/2024 |