From olve-packages
Reference for Olve.MinimalApi — ASP.NET Core Minimal API extensions for Result mapping to HTTP responses, endpoint validation filters, handler interfaces, and IPath JSON conversion. Use when writing or reading code that integrates Olve.Results with Minimal API endpoints.
How this skill is triggered — by the user, by Claude, or both
Slash command
/olve-packages:olve-minimal-apiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
ASP.NET Core Minimal API extensions for [Olve.Results](https://www.nuget.org/packages/Olve.Results). Source: `Olve.Utilities/src/Olve.MinimalApi/`.
ASP.NET Core Minimal API extensions for Olve.Results. Source: Olve.Utilities/src/Olve.MinimalApi/.
Reference docs: README | Handlers | ResultMapping | Validation | Services
Map Result / Result<T> return values to HTTP responses automatically:
// Generic — 200 OK with body or 400 Bad Request
app.MapGet("/users/{id}", (int id, UserHandler handler, CancellationToken ct)
=> handler.HandleAsync(new GetUser(id), ct))
.WithResultMapping<UserDto>();
// Non-generic — 200 OK (empty) or 400 Bad Request
app.MapDelete("/users/{id}", (int id, DeleteHandler handler, CancellationToken ct)
=> handler.RunAsync(new DeleteUser(id), ct))
.WithResultMapping();
| Return value | HTTP response |
|---|---|
Result success | 200 OK (empty body) |
Result<T> success | 200 OK with T as body |
| Any failure | 400 Bad Request with ResultProblem[] as body |
Add validation filters using IValidator<T> from Olve.Validation:
app.MapPost("/users", (CreateUserRequest request, UserHandler handler, CancellationToken ct)
=> handler.HandleAsync(request, ct))
.WithResultMapping<UserDto>()
.WithValidation<CreateUserRequest, CreateUserValidator>();
// No return value (delete, update)
public class MyHandler : IHandler<MyRequest>
{
public Task<Result> RunAsync(MyRequest request, CancellationToken ct) { ... }
}
// With return value (get, create)
public class MyHandler : IHandler<MyRequest, MyResponse>
{
public Task<Result<MyResponse>> HandleAsync(MyRequest request, CancellationToken ct) { ... }
}
builder.Services.WithPathJsonConversion();
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub olivervea/olve.utilities --plugin olve-packages