Hlibz.OpenApi.UseCases 1.1.0-preview.2

This is a prerelease version of Hlibz.OpenApi.UseCases.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Hlibz.OpenApi.UseCases --version 1.1.0-preview.2
                    
NuGet\Install-Package Hlibz.OpenApi.UseCases -Version 1.1.0-preview.2
                    
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="Hlibz.OpenApi.UseCases" Version="1.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hlibz.OpenApi.UseCases" Version="1.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Hlibz.OpenApi.UseCases" />
                    
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 Hlibz.OpenApi.UseCases --version 1.1.0-preview.2
                    
#r "nuget: Hlibz.OpenApi.UseCases, 1.1.0-preview.2"
                    
#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 Hlibz.OpenApi.UseCases@1.1.0-preview.2
                    
#: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=Hlibz.OpenApi.UseCases&version=1.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Hlibz.OpenApi.UseCases&version=1.1.0-preview.2&prerelease
                    
Install as a Cake Tool

Hlibz.OpenApi.UseCases icon

Hlibz.OpenApi.UseCases

NuGet CI

Publishes Hlibz.UseCases in OpenAPI documents built with Microsoft.AspNetCore.OpenApi, for .NET 10 and 11: what each use case checks, and the 400 an invalid one is answered with.

dotnet add package Hlibz.OpenApi.UseCases --prerelease
using Hlibz.OpenApi;

builder.Services.AddUseCases([typeof(CreateCityCommand).Assembly]);
builder.Services.AddOpenApi("v1", options => options
    .AddXmlDocumentation()   // Hlibz.OpenApi.AspNetCore, which this package brings
    .AddUseCases(useCases => useCases.ValidationResponseType = typeof(ErrorResponse)));
  • Every IDescribedRule (a custom validation attribute) and [RuleSummary] becomes schema keywords plus a sentence in description and x-rules, on the property, record parameter, parameter or type it sits on, through Hlibz.OpenApi.AspNetCore's AddOpenApiRules().
  • DataAnnotations on positional record parameters (record CreateCityCommand([MaxLength(60)] string Name)) are published too: Microsoft.AspNetCore.OpenApi reads properties only.
  • An operation whose handler takes the handler of a use case that can fail validation gets a 400 (HttpValidationProblemDetails, or the type you set), unless it documents one already.

Rules reach the document only on types the endpoint binds: bind the use case itself, or give it a record that is also the body.

Full documentation: github.com/hlib-zinchenko/Hlibz.OpenApi.

Product 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.  net11.0 is compatible. 
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
2.0.0-preview.3 0 11/27/2026
2.0.0-preview.2 0 11/27/2026
2.0.0-preview.1 0 11/27/2026
1.1.0 75 11/25/2026
1.1.0-preview.2 63 11/23/2026
1.1.0-preview.1 68 11/22/2026