aspnet-minimal-api-openapi
Create ASP.NET Minimal API endpoints with proper OpenAPI documentation
Security Assessment
About aspnet-minimal-api-openapi
This skill guides an AI assistant in building well-structured ASP.NET Minimal API endpoints paired with comprehensive OpenAPI/Swagger documentation. It addresses a common gap in Minimal API development: producing endpoints that are strongly typed, correctly organized, and self-documenting rather than ad-hoc route handlers with weak types and missing schema metadata. The guidance is framed as a set of conventions the assistant should apply when a developer asks it to create or refine Minimal API code.
The skill covers several concrete areas. For API organization it recommends grouping related endpoints with MapGroup(), using endpoint filters for cross-cutting concerns, and adopting feature-based folder structures for larger APIs. For request and response handling it advises explicit DTOs, record types for immutable payloads, validation attributes like [Required], and standardized error responses via ProblemDetailsService and StatusCodePages. For type handling it promotes strongly-typed route parameters, Results<T1, T2> for multiple response types, TypedResults, and modern C# 10+ features. The OpenAPI section leans on .NET 9's built-in OpenAPI support, operation summaries, WithName for operationIds, [Description] attributes, and document/schema transformers for servers, tags, and security schemes.
The target users are .NET backend developers and teams building HTTP APIs who want idiomatic, documented Minimal API code. It is best suited to greenfield endpoint creation, refactoring loosely typed handlers, and standardizing API documentation across a codebase. It is a single-document convention reference rather than executable tooling, so it shapes generated code rather than running or deploying anything.
FAQ
What .NET version does this assume?
It references .NET 9's built-in OpenAPI document support and C# 10+ features like nullable annotations and init-only properties, so a recent .NET SDK is expected for full applicability.
Does this skill run or scaffold code automatically?
No. It is a single SKILL.md of conventions and best practices that guides how an assistant writes Minimal API endpoints; it does not execute commands or generate projects on its own.
How does it handle API documentation?
It recommends the built-in OpenAPI support, adding operation summaries and descriptions, WithName for operationIds, [Description] attributes on properties and parameters, and document/schema transformers for servers, tags, and security schemes.
What patterns does it suggest for typing responses?
It advises using TypedResults instead of Results, Results<T1, T2> to express multiple response types, explicit request/response DTOs, and record types for immutable objects.
Is it limited to a particular API style?
Yes, it targets ASP.NET Minimal APIs specifically, not the older MVC controller model.
Install aspnet-minimal-api-openapi
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
github/awesome-copilot