minimal-api

Standardize .NET 10 Minimal API endpoints with MapGroup and TypedResults.

224|87|Updated Dec 15, 2018
One-click install
npx skills add https://github.com/Resgrid/Core --skill minimal-api-resgrid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: minimal-api
Source: https://github.com/Resgrid/Core/tree/main/.opencode/skills/minimal-api
Command: npx skills add https://github.com/Resgrid/Core --skill minimal-api-resgrid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you build consistent, well-documented .NET 10 Minimal APIs without turning Program.cs into a growing tangle of scattered endpoint mappings.

Core Features & Use Cases

  • Endpoint group auto-discovery: Register all IEndpointGroup endpoint groups via a single app.MapEndpoints() call so adding features doesn’t require editing Program.cs.
  • Type-safe responses for correct OpenAPI: Use TypedResults with explicit union return types to generate accurate Swagger/OpenAPI schemas.
  • Better endpoint organization and cross-cutting concerns: Use MapGroup, endpoint filters, parameter binding patterns, and built-in OpenAPI configuration to keep APIs maintainable and consistent.

Quick Start

Use the minimal-api skill to structure your HTTP endpoints by creating IEndpointGroup files and registering them through app.MapEndpoints() so OpenAPI and routing metadata stay correct as the API grows.

Frequently Asked Questions about minimal-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize .NET minimal API endpoints without cluttering Program.cs?

To organize .NET minimal APIs cleanly, implement IEndpointGroup classes and register them through a single app.MapEndpoints() call. This auto-discovery approach keeps Program.cs tidy by ensuring new endpoint features never require manual route registration edits.

How do I generate accurate OpenAPI schemas for minimal API union return types?

Generate accurate OpenAPI schemas for minimal APIs by using TypedResults with explicit union return types in your endpoint handlers. This type-safe response mechanism ensures deterministic Swagger documentation without requiring manual schema configuration.

What's the best way to structure cross-cutting concerns like rate limiting and output caching in minimal APIs?

Structure cross-cutting concerns in minimal APIs by applying endpoint filters, rate limiting, and output caching directly to MapGroup instances. Grouping endpoints this way allows shared policies to cascade across nested routes for consistent API behavior.

Can I use minimal APIs with .NET 10 parameter binding for route, query, header, and body inputs?

Yes, minimal APIs in .NET 10 support parameter binding for route, query, header, body, and dependency injection parameters. This built-in binding capability automatically maps HTTP request data to your endpoint method signatures for streamlined request handling.

Does minimal API require attaching metadata like WithName and WithTags for OpenAPI discoverability?

Yes, attaching endpoint metadata like WithName, WithTags, and WithSummary is required for minimal APIs to ensure deterministic behavior and OpenAPI discoverability. These annotations provide the necessary routing and documentation context for Swagger generation.