MinimalOpenAPI 1.0.0-beta.10
dotnet add package MinimalOpenAPI --version 1.0.0-beta.10
NuGet\Install-Package MinimalOpenAPI -Version 1.0.0-beta.10
<PackageReference Include="MinimalOpenAPI" Version="1.0.0-beta.10" />
<PackageVersion Include="MinimalOpenAPI" Version="1.0.0-beta.10" />
<PackageReference Include="MinimalOpenAPI" />
paket add MinimalOpenAPI --version 1.0.0-beta.10
#r "nuget: MinimalOpenAPI, 1.0.0-beta.10"
#:package MinimalOpenAPI@1.0.0-beta.10
#addin nuget:?package=MinimalOpenAPI&version=1.0.0-beta.10&prerelease
#tool nuget:?package=MinimalOpenAPI&version=1.0.0-beta.10&prerelease
MinimalOpenAPI
MinimalOpenAPI is a contract-first OpenAPI framework for ASP.NET Core Minimal APIs.
You author the OpenAPI document first. MinimalOpenAPI reads it at build time and generates the C# scaffolding needed to implement the API.
What the package includes
| What you get | Notes |
|---|---|
| Roslyn source generator | Generates DTOs, handler base classes, endpoint mapping, and DI registration at build time. |
| Runtime services | Provides AddMinimalOpenApi(), MapMinimalOpenApiEndpoints(), and MapOpenApiSchemas(). |
| YAML and JSON parser support | Use <OpenApi Include="openapi.yaml" /> or <OpenApi Include="openapi.json" />. |
| Spec publishing support | Copies authored OpenAPI files to build/publish output and can serve selected specs over HTTP. |
Minimal setup
<ItemGroup>
<PackageReference Include="MinimalOpenAPI" Version="1.0.0-beta.1" />
<OpenApi Include="openapi.yaml" />
</ItemGroup>
using MinimalOpenAPI;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMinimalOpenApi();
var app = builder.Build();
app.MapMinimalOpenApiEndpoints();
app.Run();
Implement the generated abstract handler base class for each operation in your OpenAPI spec. The generator takes care of route mapping, handler registration, DTO generation, and endpoint metadata.
Generated contracts
MinimalOpenAPI generates DTO records from components/schemas.
By default, OpenAPI readOnly and writeOnly properties are respected through ReadWriteSchemaHandling="Auto":
<OpenApi Include="openapi.yaml"
ReadWriteSchemaHandling="Auto" />
Supported values:
Ignore: parsereadOnly/writeOnly, but keep neutral DTO shapes.Auto: default. Generate request/response DTO variants only when direct or reachablereadOnly/writeOnlyproperties require different shapes.Split: generate request/response DTO graphs from operation body roots even when the current shapes are identical, preserving contract type names if directional properties are added later.
For example, with Account.id: readOnly and Account.password: writeOnly, generated operation signatures use AccountRequest and AccountResponse.
Publishing and serving specs
Every <OpenApi /> item is copied to build and publish output under an internal collision-safe path:
openapi/schemas/<SchemaId>/<filename>
To expose a spec over HTTP, configure PublishAs:
<OpenApi Include="openapi.yaml"
PublishAs="/openapi/schema.yaml"
DisplayName="Todo API"
DisplayVersion="1.0.0" />
Then map schema endpoints:
app.MapMinimalOpenApiEndpoints();
var schemas = app.MapOpenApiSchemas();
Rules:
PublishAsmust start with/.PublishAsvalues must be unique across all<OpenApi />items.- OpenAPI files without
PublishAsare copied to output/publish, but are not served over HTTP. DisplayNameandDisplayVersionare optional descriptor metadata.
MapOpenApiSchemas() returns descriptors with PublicPath, Name, Version, FullName, and Endpoint, which can be used to configure Swagger UI, Scalar, or another OpenAPI UI package.
More documentation
For full documentation, samples, architecture notes, and release guidance, visit the repository:
| 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. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
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-beta.10 | 47 | 5/11/2026 |
| 1.0.0-beta.9 | 57 | 5/9/2026 |
| 1.0.0-beta.8 | 57 | 4/18/2026 |
| 1.0.0-beta.7 | 48 | 4/7/2026 |
| 1.0.0-beta.6 | 54 | 4/6/2026 |
| 1.0.0-beta.5 | 54 | 4/5/2026 |
| 1.0.0-beta.4 | 49 | 4/5/2026 |
| 1.0.0-beta.3 | 53 | 4/5/2026 |
| 1.0.0-beta.2 | 57 | 4/4/2026 |
| 1.0.0-alpha | 47 | 3/30/2026 |