56 results available
Sign in
Skills directory

aspnet-minimal-api-openapi

github

·

Last changed
Hardened

This skill has been hardened by Chainguard

Last changed

This version passed the hardening gate. Hardening applied 7 targeted changes and preserved all other text. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 9. Review findings remaining: 1.


Open before hardening

None

Open after hardening

None


Expand
File
Group
Subtype
Severity
Status

No findings available

0 findings


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
  • Require authorization with policies on endpoint groups and endpoints by default, and allow anonymous access only where explicitly intended
  • 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 declare constraints, and enforce them explicitly with the built-in validation where the target version supports it, or with a validation endpoint filter that returns a validation problem response
  • Treat all request input as untrusted
  • Use the ProblemDetailsService and StatusCodePages to get standard error responses, paired with an exception handler
  • Show developer exception details only in the development environment, and keep exception messages and stack traces out of error responses in other environments

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 modern C# features like nullable annotations, records, and init-only properties

OpenAPI Documentation

  • Use the built-in OpenAPI document support added in .NET 9
  • Expose the OpenAPI document and any documentation UI only in the development environment, or protect it with authorization when it must be published in production
  • 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
  • Treat security schemes in the OpenAPI document as descriptions of authentication only, and make sure every documented scheme matches the authentication and authorization actually configured on the endpoints
  • Read server addresses from configuration, and use placeholders for keys and tokens in transformers, examples, and security scheme descriptions
  • Use schema transformers to apply customizations to OpenAPI schemas

Install

Install with chainctl
chainctl skill install public/github/aspnet-minimal-api-openapi:latest
Get started with chainctl
View source

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream sourcehttps://github.com/github/awesome-copilot
Upstream commitcf4347e88c2e40a9aabe5801748ec6bf924c09be
OCI reference

skills.cgr.dev/public/github.com/github/skills/aspnet-minimal-api-openapi:latest

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.