Atc.OpenApi 3.0.174

dotnet add package Atc.OpenApi --version 3.0.174
                    
NuGet\Install-Package Atc.OpenApi -Version 3.0.174
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Atc.OpenApi" Version="3.0.174" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Atc.OpenApi" Version="3.0.174" />
                    
Directory.Packages.props
<PackageReference Include="Atc.OpenApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Atc.OpenApi --version 3.0.174
                    
#r "nuget: Atc.OpenApi, 3.0.174"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Atc.OpenApi@3.0.174
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Atc.OpenApi&version=3.0.174
                    
Install as a Cake Addin
#tool nuget:?package=Atc.OpenApi&version=3.0.174
                    
Install as a Cake Tool

Atc.OpenApi

Target Framework: net9.0, net10.0

Extensions and utilities for working with OpenAPI specifications using Microsoft.OpenApi. Provides helper methods for parsing, analyzing, and extracting information from OpenAPI documents and schemas.

Why Use This Library?

Working with OpenAPI specifications programmatically requires extensive knowledge of the object model and common patterns. Atc.OpenApi simplifies this by providing:

  • OpenAPI Extension Methods: Convenient extensions for common operations
  • Schema Helpers: Extract and analyze schema information
  • Data Type Utilities: Determine data types from OpenAPI schemas
  • Operation Analysis: Get operation names and response schemas
  • Model Extraction: Retrieve model schemas from responses
  • Type-Safe Parsing: Strongly-typed access to OpenAPI components

Perfect for:

  • API code generators
  • OpenAPI documentation tools
  • API client generators
  • Schema validation tools
  • API specification analyzers
  • OpenAPI-first development workflows

Installation

dotnet add package Atc.OpenApi

Target Framework

  • .NET 9.0

Key Features

  • Extension methods for OpenApiOperation
  • Extension methods for OpenApiSchema
  • Schema data type detection and extraction
  • Operation name retrieval
  • Model schema extraction from responses
  • Support for complex schema analysis
  • Integration with Microsoft.OpenApi.Readers

Requirements

Key Dependencies

  • Microsoft.OpenApi.Readers
  • Atc (foundation library)

Main Components

OpenApiOperation Extensions

Work with OpenAPI operations:

  • GetOperationName(): Extracts operation identifier
  • GetModelSchemaFromResponse(): Gets the response model schema

OpenApiSchema Extensions

Analyze OpenAPI schemas:

  • GetDataType(): Determines the data type of a schema
  • Schema property analysis
  • Type detection and mapping

Code documentation

References

References extended

Usage Examples

Working with OpenAPI Operations

using Atc.OpenApi;
using Microsoft.OpenApi.Models;

// Get operation name
var operationName = openApiOperation.GetOperationName();
Console.WriteLine($"Operation: {operationName}");

// Get model schema from response
var modelSchema = openApiOperation.GetModelSchemaFromResponse();
if (modelSchema != null)
{
    Console.WriteLine($"Response Type: {modelSchema.Type}");
}

Analyzing OpenAPI Schemas

using Atc.OpenApi;
using Microsoft.OpenApi.Models;

OpenApiSchema schema = /* your schema */;

// Get data type information
var dataType = schema.GetDataType();
Console.WriteLine($"Data Type: {dataType}");

// Check schema properties
if (schema.Properties != null)
{
    foreach (var property in schema.Properties)
    {
        Console.WriteLine($"Property: {property.Key}, Type: {property.Value.Type}");
    }
}

Reading and Analyzing OpenAPI Documents

using Microsoft.OpenApi.Readers;
using Atc.OpenApi;

// Read OpenAPI document
var openApiDocument = new OpenApiStringReader().Read(yamlContent, out var diagnostic);

// Analyze operations
foreach (var path in openApiDocument.Paths)
{
    foreach (var operation in path.Value.Operations)
    {
        var operationName = operation.Value.GetOperationName();
        var responseSchema = operation.Value.GetModelSchemaFromResponse();

        Console.WriteLine($"Path: {path.Key}");
        Console.WriteLine($"Method: {operation.Key}");
        Console.WriteLine($"Operation: {operationName}");
    }
}

Contributing

Contributions are welcome! Please see the main repository README for contribution guidelines.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Atc.OpenApi:

Package Downloads
Atc.Rest.ApiGenerator

Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.174 43 6/24/2026
3.0.173 40 6/24/2026
3.0.172 47 6/24/2026
3.0.67 137 4/25/2026
3.0.46 112 4/15/2026
3.0.45 110 4/10/2026
3.0.44 108 4/9/2026
3.0.43 108 4/9/2026
3.0.41 107 4/9/2026
3.0.40 108 4/9/2026
3.0.18 156 2/9/2026
3.0.16 282 12/15/2025
3.0.12 191 11/28/2025
3.0.9 372 11/21/2025
3.0.8 292 11/14/2025
3.0.4 242 11/6/2025
2.0.562 621 9/4/2025
2.0.561 253 9/4/2025
2.0.560 249 9/3/2025
2.0.558 203 8/22/2025
Loading failed