dotnet-webapi

Guides creation of ASP.NET Core Web API endpoints with OpenAPI metadata and error handling.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/ecoDriverltd/FoundryAgentsExperiment --skill dotnet-webapi-ecodriverltd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-webapi
Source: https://github.com/ecoDriverltd/FoundryAgentsExperiment/tree/main/.agents/skills/dotnet-webapi
Command: npx skills add https://github.com/ecoDriverltd/FoundryAgentsExperiment --skill dotnet-webapi-ecodriverltd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building ASP.NET Core Web APIs involves many conventions—correct HTTP status codes, DTO design, OpenAPI documentation, and centralized error handling—that are easy to get wrong or inconsistent. This Skill provides a structured workflow so endpoints follow proper HTTP semantics and project conventions from the start. ## Core Features & Use Cases - Endpoint Implementation: Add or modify controller-based or minimal API endpoints with correct status codes, TypedResults, CancellationToken support, and service-layer separation. - OpenAPI & DTO Standards: Wire up built-in .NET 9+ OpenAPI support, sealed record DTOs with XML doc comments, string enum serialization, and DateTimeOffset date handling. - Error Handling & Testing: Configure RFC 7807 Problem Details via IExceptionHandler middleware and generate .http test files for every endpoint. - Use Case: Ask the agent to add a new products endpoint to your ASP.NET Core project, and it will inspect existing conventions, create DTOs, implement the endpoint with proper status codes, add OpenAPI metadata, and produce a .http test file. ## Quick Start Add a new REST endpoint to my ASP.NET Core project for managing products, following the existing API style with OpenAPI documentation and error handling.

Frequently Asked Questions about dotnet-webapi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new endpoint to an ASP.NET Core Web API?▼

First inspect the project for existing patterns: controllers inheriting ControllerBase or minimal API calls like app.MapGet. Match the existing style, create sealed record DTOs, implement the endpoint with TypedResults and CancellationToken, then add OpenAPI metadata and a .http test file.

Should I use controllers or minimal APIs in ASP.NET Core?▼

Follow whatever the project already uses—never mix styles in one project. For new projects with no existing endpoints, default to minimal APIs unless controllers are explicitly requested.

Should I use Swashbuckle with .NET 9 or .NET 10 OpenAPI?▼

No. For .NET 9+ projects, use the built-in AddOpenApi() and MapOpenApi() support without any Swashbuckle packages, which have known compatibility issues. Swashbuckle is acceptable only for .NET 8 or earlier projects.

Why does TypedResults cause CS1593 delegate errors in minimal APIs?▼

Using TypedResults.Ok and TypedResults.NotFound in a bare ternary fails because Ok<T> and NotFound share no common base type. Annotate the handler with an explicit Task<Results<Ok<T>, NotFound>> return type so the compiler can infer correctly.

When should I not use this Web API guidance?▼

Do not apply it to EF Core query optimization, Blazor or frontend work, gRPC services, or SignalR hubs. It covers only HTTP API endpoints, DTOs, OpenAPI, and error handling middleware.