All skills
github avatar

/aspnet-minimal-api-openapi

@90921cc official
by githubgithub/awesome-copilot40k stars
5,040

Create ASP.NET Minimal API endpoints with proper OpenAPI documentation

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/aspnet-minimal-api-openapi

This session only. Nothing lands on disk.

SKILL.md

≈25 tokens always: the name and description. ≈407 when used: this file.

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

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides standard development guidelines for creating ASP.NET Minimal APIs and OpenAPI documentation. No security issues were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 90921cc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated 7 months ago
  • aspnet
  • minimal-api
  • openapi
  • swagger
  • csharp
  • api-documentation
  • dto
  • validation
  • typed-results

README badge

README badge for github/awesome-copilot/aspnet-minimal-api-openapi

Generates ASP.NET Minimal API endpoints with OpenAPI documentation, using strongly-typed DTOs, validation attributes, and .NET 9 built-in OpenAPI support. Targets well-structured APIs with proper Swagger schema generation, request/response modeling, and cross-cutting concern handling via endpoint filters.

Generated from the current SKILL.md.

Does this skill work with .NET versions before 9?
The skill emphasizes .NET 9's built-in OpenAPI document support, but the core patterns (Minimal APIs, MapGroup, TypedResults) work in .NET 6+. You may need to use third-party libraries like Swashbuckle for OpenAPI generation on earlier versions.
Does this cover request validation?
Yes. The skill recommends using validation attributes like [Required] on DTOs and applying the ProblemDetailsService for standardized error responses.
How does this handle endpoints that return multiple response types?
The skill uses Results<T1, T2> and strongly-typed TypedResults to represent multiple possible response types in a single endpoint.
Does this skill address API authentication or security?
The skill mentions using document transformers to add security schemes to OpenAPI, but does not provide detailed implementation patterns for authentication middleware or authorization.

Generated from the current SKILL.md. These answers refresh after source changes.