aspnet-minimal-api-openapi
Create ASP.NET Minimal API endpoints with proper OpenAPI documentation
适合你,如果正在用 ASP.NET 构建 RESTful API 并需要自动生成文档
/ 通过 npx 安装 校验哈希
npx oh-my-skill add boshi-xixixi/traeskill/aspnet-minimal-api-openapi/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- boshi-xixixi/traeskill/aspnet-minimal-api-openapi/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify boshi-xixixi/traeskill/aspnet-minimal-api-openapi安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
254GitHub stars
~328上下文体积 · 单文件
索引托管
怎么用
商店整理自技能原文 · 版本 9cf38e6 · 表述以原文为准它做什么
安装该技能后,当您要求创建网络 API 接口时,Claude 会生成带有说明文档的 ASP.NET Minimal API 代码,包括请求响应模型和路由组织。
什么时候触发
当您请求创建 ASP.NET Minimal API 端点,或要求为 API 添加 OpenAPI 文档时触发。
装好后可以这样说
Claude 会生成端点代码和 OpenAPI 文档。
Claude 会使用 MapGroup 分组。
技能原文 SKILL.md
ASP.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
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…