Koalesce.OpenAPI
1.0.0-alpha.10
See the version list below for details.
dotnet add package Koalesce.OpenAPI --version 1.0.0-alpha.10
NuGet\Install-Package Koalesce.OpenAPI -Version 1.0.0-alpha.10
<PackageReference Include="Koalesce.OpenAPI" Version="1.0.0-alpha.10" />
<PackageVersion Include="Koalesce.OpenAPI" Version="1.0.0-alpha.10" />
<PackageReference Include="Koalesce.OpenAPI" />
paket add Koalesce.OpenAPI --version 1.0.0-alpha.10
#r "nuget: Koalesce.OpenAPI, 1.0.0-alpha.10"
#:package Koalesce.OpenAPI@1.0.0-alpha.10
#addin nuget:?package=Koalesce.OpenAPI&version=1.0.0-alpha.10&prerelease
#tool nuget:?package=Koalesce.OpenAPI&version=1.0.0-alpha.10&prerelease
🐨 Koalesce
Koalesce is a .NET library designed to merge multiple API definitions into a unified document. It enables seamless API Gateway integration and simplifies frontend client generation for microservices-based architectures.
⚡ Key Features
- ✅ Merge Multiple APIs: Coalesce multiple API definitions into one unified schema.
- ✅ Flexible Security: Apply global Gateway security OR preserve downstream API security configurations.
- ✅ Conflict Resolution: Deterministic schema renaming and path collision detection.
- ✅ Resilience vs. Strictness: Choose between fault-tolerant production modes or strict validation for CI/CD.
- ✅ Configurable Caching: Fine-grained cache control with absolute/sliding expiration settings.
- ✅ Gateway Integration: Works seamlessly with Ocelot, YARP, and other API Gateways.
- ✅ Client Generation: Streamlines API client generation (e.g., NSwag, Kiota) with a single unified schema.
- ✅ Flexible Configuration: Configure via
appsettings.jsonor Fluent API. - ✅ Format Agnostic Output: Output
JSONorYAMLregardless of source document format. - ✅ Multi-targeting: Native support for .NET 8.0 (LTS) and .NET 10.0.
- ✅ Extensible Core: Designed to support future providers for other API specification formats.
Quick Start
1. Configure appsettings.json
{
"Koalesce": {
"Sources": [
{ "Url": "https://service-a/swagger/v1/swagger.json", "VirtualPrefix": "/sales" },
{ "Url": "https://service-b/swagger/v1/swagger.json", "VirtualPrefix": "/inventory" }
],
"MergedDocumentPath": "/swagger/v1/gateway.json",
"ApiGatewayBaseUrl": "https://localhost:5000",
"FailOnServiceLoadError": false
}
}
2. Register and Enable
builder.Services.AddKoalesce(builder.Configuration)
.ForOpenAPI();
var app = builder.Build();
app.UseKoalesce();
3. Optional: Configure Global Security
builder.Services.AddKoalesce(builder.Configuration)
.ForOpenAPI(options =>
{
// Override all downstream security with Gateway auth
options.ApplyGlobalJwtBearerSecurityScheme(
schemeName: "Bearer",
description: "Enter your JWT token"
);
});
Note: If you don't configure global security, Koalesce preserves each downstream API's security as-is.
CLI Tool
Install globally to merge OpenAPI specs without hosting an app:
dotnet tool install --global Koalesce.OpenAPI.CLI --prerelease
koalesce --config ./appsettings.json --output ./gateway.yaml
Conflict Resolution & Governance
Schema conflicts: Deterministic renaming strategy to ensure stable client generation.
- With Prefix: Sources with
VirtualPrefixget scoped schemas (e.g.,/inventory→Inventory_Product). - No Prefix: Sources without prefix keep original names (or fallback to API Title if conflicting).
- Result: Consistent SDK generation regardless of load order.
Path conflicts:
- Use
VirtualPrefixto preserve all endpoints:/api/health→/inventory/api/health+/sales/api/health - Set
SkipIdenticalPaths: true(default) to keep first API's path and skip duplicates. - Use
ExcludePathsto exclude specific paths from merge (supports wildcards:"/api/admin/*").
Resilience:
- By default, Koalesce skips unreachable services to keep the Gateway alive.
- Set
FailOnServiceLoadError: truefor CI/CD pipelines to ensure all services are reachable before building.
Documentation
Visit GitHub Repository for:
- Complete configuration reference
- Security options and extension methods
- Caching configuration
- Sample projects with Ocelot integration
- Troubleshooting guide
Quick Links:
License
MIT License - see LICENSE
| Product | Versions 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 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
- Koalesce.Core (>= 1.0.0-alpha.10)
- Microsoft.OpenApi (>= 1.6.28)
- Microsoft.OpenApi.Readers (>= 1.6.28)
-
net8.0
- Koalesce.Core (>= 1.0.0-alpha.10)
- Microsoft.OpenApi (>= 1.6.28)
- Microsoft.OpenApi.Readers (>= 1.6.28)
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-alpha.12 | 139 | 1/28/2026 | |
| 1.0.0-alpha.11 | 87 | 1/26/2026 | |
| 1.0.0-alpha.10 | 98 | 1/23/2026 | |
| 1.0.0-alpha.9 | 89 | 1/22/2026 | |
| 1.0.0-alpha.8 | 86 | 1/20/2026 | |
| 1.0.0-alpha.7 | 85 | 1/20/2026 | |
| 1.0.0-alpha.6 | 80 | 1/18/2026 | |
| 1.0.0-alpha.5 | 92 | 1/16/2026 | |
| 1.0.0-alpha.4 | 93 | 1/14/2026 | |
| 1.0.0-alpha.3 | 102 | 1/11/2026 | |
| 1.0.0-alpha.2 | 93 | 1/5/2026 | |
| 1.0.0-alpha.1 | 95 | 1/2/2026 | |
| 0.1.1-alpha.2 | 330 | 4/11/2025 | |
| 0.1.1-alpha.1 | 179 | 4/10/2025 | |
| 0.1.0-alpha | 247 | 3/16/2025 |