Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)40k · #7067

aspnet-minimal-api-openapi

Skill này làm gì

Công cụ này giúp tạo đoạn mã cho website hoặc ứng dụng web dùng ASP.NET. Nó đảm bảo thông tin gửi và nhận được tổ chức gọn gàng, và tài liệu (như hướng dẫn sử dụng) rõ ràng và đầy đủ.

Khi nào nên dùng

  • ✓Khi bạn cần tạo tính năng mới cho website.
  • ✓Khi tổ chức nhiều phần của một ứng dụng web.
  • ✓Để đảm bảo tài liệu mã của bạn luôn được cập nhật.

Liên kết skill

https://github.com/github/awesome-copilot/blob/main/skills/aspnet-minimal-api-openapi/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/aspnet-minimal-api-openapi/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một endpoint để đăng ký người dùng mới với tên và email, và trả về ID của người dùng vừa tạo.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn mô tả thông tin mã cần nhận và kết quả cần trả về. Công cụ sắp xếp điều này và tự động tạo tài liệu, như một bản đồ cho các lập trình viên khác.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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 TypedResults instead of Results for 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 WithName extension 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
Câu hỏi thường gặp

“Endpoint” là gì?

Đó là các điểm vào để ứng dụng gửi và nhận thông tin cụ thể.

“OpenAPI/Swagger” là gì?

Đó là cách chuẩn để mô tả và ghi tài liệu cho API (các “điểm vào”), giúp người khác hiểu cách dùng chúng.

“DTOs/models” là gì?

Đó là các cấu trúc xác định cách dữ liệu được tổ chức khi được gửi đi hoặc nhận bởi ứng dụng của bạn.

Chi tiết

Mô tả gốc của tác giả

Create ASP.NET Minimal API endpoints with proper OpenAPI documentation

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7067
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự