Corvus.Text.Json.OpenApi
5.1.6
dotnet add package Corvus.Text.Json.OpenApi --version 5.1.6
NuGet\Install-Package Corvus.Text.Json.OpenApi -Version 5.1.6
<PackageReference Include="Corvus.Text.Json.OpenApi" Version="5.1.6" />
<PackageVersion Include="Corvus.Text.Json.OpenApi" Version="5.1.6" />
<PackageReference Include="Corvus.Text.Json.OpenApi" />
paket add Corvus.Text.Json.OpenApi --version 5.1.6
#r "nuget: Corvus.Text.Json.OpenApi, 5.1.6"
#:package Corvus.Text.Json.OpenApi@5.1.6
#addin nuget:?package=Corvus.Text.Json.OpenApi&version=5.1.6
#tool nuget:?package=Corvus.Text.Json.OpenApi&version=5.1.6
Corvus.Text.Json.OpenApi
Shared interfaces and types for walking OpenAPI and AsyncAPI specifications, extracting schemas for code generation.
Key Types
ISpecWalker— walks a spec document to produce an operation tree and extract schemasOperationFilter— glob-based filtering for paths/channels (include/exclude patterns)ExtractedSchema— a schema reference with its role and originating operationOperationNode/OperationInfo— the operation tree structureSchemaRole— identifies how a schema is used (request body, response, parameter, message payload, etc.)
Usage
For OpenAPI 3.1, use the self-contained OpenApi31CodeGenerator which walks the
strongly-typed model directly and emits C# source files:
using Corvus.Text.Json.OpenApi;
using Corvus.Text.Json.OpenApi31;
// Collect schema pointers for the V5 code generator
string[] pointers = OpenApi31CodeGenerator.CollectSchemaPointers(specRoot);
// Generate client code
var gen = new OpenApi31CodeGenerator("MyApp.Client", schemaTypeMap);
IReadOnlyList<GeneratedFile> files = gen.Generate(specRoot);
For OpenAPI 3.0, the ISpecWalker pipeline is used:
using Corvus.Text.Json.OpenApi;
ISpecWalker walker = new OpenApi30Walker();
var filter = new OperationFilter(includePaths: ["/pets/**"]);
foreach (OperationEntry entry in walker.EnumerateOperations(specRoot, filter))
{
Console.WriteLine($"{entry.OperationId} {entry.Method} {entry.PathTemplate}");
}
Related Packages
Corvus.Text.Json.OpenApi30— V5 types for OpenAPI 3.0 specsCorvus.Text.Json.OpenApi31— V5 types for OpenAPI 3.1 specsCorvus.Text.Json— Core library
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Corvus.Text.Json (>= 5.1.6)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Corvus.Text.Json.OpenApi:
| Package | Downloads |
|---|---|
|
Corvus.Text.Json.OpenApi.HttpTransport
HttpClient-based transport for Corvus OpenAPI generated clients. Implements IApiTransport using HttpClient with rented-buffer response bodies for zero-copy parsing. |
|
|
Corvus.Text.Json.OpenApi30
Strongly-typed V5 model types for OpenAPI 3.0 specifications, generated from the official OpenAPI 3.0 JSON Schema metaschema using the Corvus.Text.Json source generator. |
|
|
Corvus.Text.Json.OpenApi32
Strongly-typed V5 model types for OpenAPI 3.2 specifications, generated from the official OpenAPI 3.2 JSON Schema metaschema using the Corvus.Text.Json source generator. |
|
|
Corvus.Text.Json.OpenApi.CodeGeneration
Code generation for .NET API clients and servers from OpenAPI and AsyncAPI specifications. Produces strongly-typed C# using Corvus.Text.Json zero-allocation types. |
|
|
Corvus.Text.Json.OpenApi31
Strongly-typed V5 model types for OpenAPI 3.1 specifications, generated from the official OpenAPI 3.1 JSON Schema metaschema using the Corvus.Text.Json source generator. |
GitHub repositories
This package is not used by any popular GitHub repositories.