
ASP.NET Minimal API OpenAPI
OfficialFreeEasily create ASP.NET Minimal APIs with OpenAPI documentation.
Free · Opens the source repo
What ASP.NET Minimal API OpenAPI does
The ASP.NET Minimal API OpenAPI skill provides developers with a structured approach to creating ASP.NET Minimal API endpoints while ensuring that they are well-documented using OpenAPI specifications. This skill emphasizes organizing related endpoints through the MapGroup() extension, which helps in maintaining clarity and structure within your API. For larger applications, it suggests using separate endpoint classes and a feature-based folder structure to keep your codebase manageable and scalable.
When it comes to defining request and response types, this skill encourages developers to create explicit DTOs and model classes, complete with validation attributes. By utilizing C# record types for immutable objects and applying meaningful property names, you can enhance the clarity of your API. The use of [Required] attributes and the ProblemDetailsService ensures that your API adheres to best practices for error handling and response standards.
Type handling is another critical aspect covered by this skill. It advocates for strongly-typed route parameters and the use of Results<T1, T2> to handle multiple response types effectively. Leveraging C# 10+ features, such as nullable annotations and init-only properties, helps keep your code modern and robust.
Finally, the skill guides you through the built-in OpenAPI documentation support introduced in .NET 9. It covers defining operation summaries, adding descriptions, and customizing your OpenAPI schemas with document and schema transformers. This comprehensive approach ensures that your APIs are not only functional but also well-documented and easy to understand for consumers.
When to use it
Use this skill when developing ASP.NET Minimal APIs that require structured organization and thorough documentation.
When not to use it
This skill may not be suitable for legacy ASP.NET applications or developers looking for a non-Minimal API approach.
What you can build with it
Creating a New API Project
Use this skill to set up a new ASP.NET Minimal API project with proper endpoint organization and documentation from the start.
Refactoring an Existing API
When refactoring an existing API, this skill can guide you in restructuring your endpoints and enhancing documentation standards.
Implementing Error Handling
Utilize this skill to implement standardized error handling using ProblemDetailsService and validation attributes in your API.
How to install ASP.NET Minimal API OpenAPI
View source1. Install with the skills CLI
npx skills add github/awesome-copilot/aspnet-minimal-api-openapi --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by githubASP.NET Minimal API with OpenAPI
Your goal is to help me create well-structured ASP.NET Minimal API endpoints with correct types and comprehensive OpenAPI/Swagger documentation.
API Organization
- Group related endpoints using
MapGroup()extension - Use endpoint filters for cross-cutting concerns
- Structure larger APIs with separate endpoint classes
- Consider using a feature-based folder structure for complex APIs
Request and Response Types
- Define explicit request and response DTOs/models
- Create clear model classes with proper validation attributes
- Use record types for immutable request/response objects
- Use meaningful property names that align with API design standards
- Apply
[Required]and other validation attributes to enforce constraints - Use the ProblemDetailsService and StatusCodePages to get standard error responses
Type Handling
- Use strongly-typed route parameters with explicit type binding
- Use
Results<T1, T2>to represent multiple response types - Return
TypedResultsinstead ofResultsfor strongly-typed responses - Leverage C# 10+ features like nullable annotations and init-only properties
OpenAPI Documentation
- Use the built-in OpenAPI document support added in .NET 9
- Define operation summary and description
- Add operationIds using the
WithNameextension method - Add descriptions to properties and parameters with
[Description()] - Set proper content types for requests and responses
- Use document transformers to add elements like servers, tags, and security schemes
- Use schema transformers to apply customizations to OpenAPI schemas
Frequently asked questions about ASP.NET Minimal API OpenAPI
Similar skills
WinMD API Search
Easily find and explore Windows desktop APIs.
WebMCPify
Transform any web app into an agent-ready platform.
Phoenix Tracing
Instrument LLM applications with OpenInference tracing.
Foundry Hosted Agent CopilotKit
Guidance for developing agentic web apps on Azure.
Power Automate Foundation
Connect AI agents to Power Automate seamlessly.
Power Automate Flow Builder
Efficiently build and deploy Power Automate flows programmatically.
