Koalesce.OpenAPI
0.1.0-alpha
See the version list below for details.
dotnet add package Koalesce.OpenAPI --version 0.1.0-alpha
NuGet\Install-Package Koalesce.OpenAPI -Version 0.1.0-alpha
<PackageReference Include="Koalesce.OpenAPI" Version="0.1.0-alpha" />
<PackageVersion Include="Koalesce.OpenAPI" Version="0.1.0-alpha" />
<PackageReference Include="Koalesce.OpenAPI" />
paket add Koalesce.OpenAPI --version 0.1.0-alpha
#r "nuget: Koalesce.OpenAPI, 0.1.0-alpha"
#:package Koalesce.OpenAPI@0.1.0-alpha
#addin nuget:?package=Koalesce.OpenAPI&version=0.1.0-alpha&prerelease
#tool nuget:?package=Koalesce.OpenAPI&version=0.1.0-alpha&prerelease
🐨 Koalesce
Koalesce is a .NET library designed to merge multiple OpenAPI definitions into a unified document to enable seamless API Gateway integration and simplify frontend client generation for microservices-based architectures.
How It Works?
- Koalesce fetches OpenAPI definitions from the specified SourceOpenApiUrls.
- It then merges them using supported providers, generating a single schema at MergedOpenApiPath.
- The final Koalesced API definition is serialized and available in
JSONorYAMLformat.
⚡ Features
- ✅ Coalesce multiple OpenAPI definitions into one unified schema.
- ✅ Fully configurable via
appsettings.json. - ✅ Aligns perfectly with API Gateways.
- ✅ Aligns perfectly with UI tools for interacting with API endpoints.
- ✅ Allows output a
jsonoryamlmerged document regardless the document type of the source APIs. - ✅ Streamlines API client generation since it results in one unified schema.
- ✅ Extensible architecture to support new API aggregation strategies.
⚙️ Basic Configuration
| Setting | Type | Default Value | Description |
|---|---|---|---|
SourceOpenApiUrls |
array |
🔺 | Source list of OpenAPI URLs to merge. |
MergedOpenApiPath |
string |
🔺 | Path where the merged API definition is exposed. |
Title |
string |
"My 🐨Koalesced OpenAPI" |
Title for the Koalesced API definition. |
SkipIdenticalPaths |
boolean |
true |
If false, Koalesce will throw an exception when detecting identical API paths across merged definitions. If true, it will log a warning and skip them. |
ApiGateWayBaseUrl |
string |
null / empty |
If provided, Koalesce will ensure a single server for the entire merged document. |
- 💡Parameters listed with 🔺 are required.
- 💡The file extension
[.json, .yaml]defined in MergedOpenApiPath will define the merged output format. - 💡Koalesce respects the order of SourceOpenApiUrls. This affects how identical paths are handled based on the
SkipIdenticalPathssetting.
{
"Koalesce": {
"SourceOpenApiUrls": [
"https://api1.com/swagger/v1/swagger.json",
"https://api2.com/swagger/v1/swagger.json"
],
"MergedOpenApiPath": "/swagger/v1/apigateway.json",
"Title": "My Koalesced API",
"SkipIdenticalPaths": true,
"ApiGatewayBaseUrl": "https://api-gateway.com:5000",
"Cache": {
"DisableCache": false,
"AbsoluteExpirationSeconds": 86400,
"SlidingExpirationSeconds": 300,
"MinExpirationSeconds": 30
}
}
}
🛠️ Caching Configuration (Koalesce.Cache)
| Setting | Type | Default Value | Description |
|---|---|---|---|
DisableCache |
boolean |
false |
If true, Koalesce will always recompute the merged OpenAPI document on each request instead of caching it. |
AbsoluteExpirationSeconds |
integer |
86400 (24h) |
The maximum duration (in seconds) before the cached OpenAPI document is forcibly refreshed, regardless of access. |
SlidingExpirationSeconds |
integer |
300 (5 min) |
Resets cache expiration every time the document is accessed. If not accessed within this period, the cache expires earlier than its absolute expiration. |
MinExpirationSeconds |
integer |
30 |
Minimum allowed expiration time (in seconds). Prevents setting an excessively low cache duration that could cause unnecessary recomputation. |
{
"Koalesce": {
"Title": "My Koalesced API",
"SourceOpenApiUrls": [
"https://api1.com/swagger/v1/swagger.json",
"https://api2.com/swagger/v1/swagger.json"
],
"MergedOpenApiPath": "/swagger/v1/apigateway.json",
"SkipIdenticalPaths": true,
"ApiGatewayBaseUrl": "https://api-gateway.com",
"Cache": {
"DisableCache": false,
"AbsoluteExpirationSeconds": 86400,
"SlidingExpirationSeconds": 300,
"MinExpirationSeconds": 30
}
}
}
📦 Installation
🟢 For OpenAPI
dotnet add package Koalesce.OpenAPI
⚙️ Package-specific Configuration
🔺 This configuration extends the basic settings. Ensure that your Koalesce section includes all required base options.
| Setting | Type | Default Value | Description |
|---|---|---|---|
Koalesce.OpenApiVersion |
string |
"3.0.1" | OpenAPI version. |
{
"Koalesce":
{
"OpenApiVersion": "3.0.1",
"Title": "My Koalesced OpenAPI",
"SourceOpenApiUrls": [
"https://localhost:5001/swagger/v1/swagger.json",
"https://localhost:5002/swagger/v1/swagger.json",
"https://fakerestapi.azurewebsites.net/swagger/v1/swagger.json"
],
"MergedOpenApiPath": "/swagger/v1/swagger.yaml"
}
}
🛠️ Usage with .NET pipeline
1️⃣ Register Koalesce.[ForProvider()]
In Program.cs:
builder.Services.AddKoalesce()
// Register Koalesce.OpenAPI provider
.ForOpenAPI();
2️⃣ Enable Middleware
app.UseKoalesce();
🔥 Running an Application (using Swagger.UI)
Start the application:
dotnet runAccess the Koalesced API via Swagger UI:
https://localhost:[port]/swagger/index.htmlThe merged OpenAPI definition should be available at:
https://localhost:[port]/[MergedOpenApiPath]
📝 License & Contribution
Koalesce is licensed under the MIT License.
Contributions are welcome! Feel free to submit issues and PRs on GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net6.0
- Koalesce.Core (>= 0.1.0-alpha)
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.OpenApi.Readers (>= 1.6.23)
-
net7.0
- Koalesce.Core (>= 0.1.0-alpha)
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.OpenApi.Readers (>= 1.6.23)
-
net8.0
- Koalesce.Core (>= 0.1.0-alpha)
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.OpenApi.Readers (>= 1.6.23)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Koalesce.OpenAPI:
| Repository | Stars |
|---|---|
|
falberthen/EcommerceDDD
Experimental full-stack application showcasing Domain-Driven Design, Microservices, Event Sourcing, CQRS and Angular.
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.0.0-alpha.12 | 90 | 1/28/2026 | |
| 1.0.0-alpha.11 | 59 | 1/26/2026 | |
| 1.0.0-alpha.10 | 67 | 1/23/2026 | |
| 1.0.0-alpha.9 | 62 | 1/22/2026 | |
| 1.0.0-alpha.8 | 58 | 1/20/2026 | |
| 1.0.0-alpha.7 | 58 | 1/20/2026 | |
| 1.0.0-alpha.6 | 52 | 1/18/2026 | |
| 1.0.0-alpha.5 | 60 | 1/16/2026 | |
| 1.0.0-alpha.4 | 63 | 1/14/2026 | |
| 1.0.0-alpha.3 | 72 | 1/11/2026 | |
| 1.0.0-alpha.2 | 67 | 1/5/2026 | |
| 1.0.0-alpha.1 | 68 | 1/2/2026 | |
| 0.1.1-alpha.2 | 290 | 4/11/2025 | |
| 0.1.1-alpha.1 | 159 | 4/10/2025 | |
| 0.1.0-alpha | 226 | 3/16/2025 |