BinkyLabs.OpenApi.Overlays 1.0.0-preview.4

This is a prerelease version of BinkyLabs.OpenApi.Overlays.
dotnet add package BinkyLabs.OpenApi.Overlays --version 1.0.0-preview.4
                    
NuGet\Install-Package BinkyLabs.OpenApi.Overlays -Version 1.0.0-preview.4
                    
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="BinkyLabs.OpenApi.Overlays" Version="1.0.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BinkyLabs.OpenApi.Overlays" Version="1.0.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="BinkyLabs.OpenApi.Overlays" />
                    
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 BinkyLabs.OpenApi.Overlays --version 1.0.0-preview.4
                    
#r "nuget: BinkyLabs.OpenApi.Overlays, 1.0.0-preview.4"
                    
#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 BinkyLabs.OpenApi.Overlays@1.0.0-preview.4
                    
#: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=BinkyLabs.OpenApi.Overlays&version=1.0.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BinkyLabs.OpenApi.Overlays&version=1.0.0-preview.4&prerelease
                    
Install as a Cake Tool

OpenAPI Overlay Libraries for dotnet

This project provides a .NET implementation of the OpenAPI Overlay Specification, allowing you to dynamically apply overlays (patches) to existing OpenAPI documents (v3.0+), following the official OpenAPI Overlay 1.0.0 specification.

The library enables developers to programmatically apply overlays, validate them, and generate updated OpenAPI documents without relying on third-party tools like Swagger.

Build Status

Libraries

Library NuGet Release

Installing

You can install this library via the package explorer or using the following command.

dotnet add <pathToCsProj> package BinkyLabs.OpenApi.Overlays

Examples

Parsing an Overlay document

The following example illustrates how you can load or parse an Overlay document from JSON or YAML.

var overlayDocument = await OverlayDocument.LoadFromUrlAsync("https://source/overlay.json");

Applying an Overlay document to an OpenAPI document

The following example illustrates how you can apply an Overlay document to an OpenAPI document.

var resultOpenApiDocument = await overlayDocument.ApplyToDocumentAsync("https://source/openapi.json");

Serializing an Overlay document

The following example illustrates how you can serialize an Overlay document, built by the application or previously parsed, to JSON.

var overlayDocument = new OverlayDocument
{
    Info = new OverlayInfo
    {
        Title = "Test Overlay",
        Version = "1.0.0"
    },
    Extends = "foo/myDescription.json",
    Actions = new List<OverlayAction>
    {
        new OverlayAction
        {
            Target = "$.paths['/bar']",
            Description = "Updates bar path item",
            Remove = true
        }
    }
};

using var textWriter = new StringWriter();
var writer = new OpenApiJsonWriter(textWriter);
using var textWriter = new StringWriter();
var writer = new OpenApiJsonWriter(textWriter);
var jsonResult = textWriter.ToString();
// or use flush async if the underlying writer is a stream writer to a file or network stream

Release notes

The OpenAPI Overlay Libraries releases notes are available from the CHANGELOG

Debugging

Contributing

This project welcomes contributions and suggestions. Make sure you open an issue before sending any pull request to avoid any misunderstanding.

Trademarks

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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.4 99 7/6/2025
1.0.0-preview.3 99 7/6/2025
1.0.0-preview.2 104 7/6/2025