FastEndpoints in Depth
Controllers grow sideways and Minimal APIs grow into soup. FastEndpoints bets on a third shape - one class per endpoint - and this series reads its source to see how the bet is implemented. Part 1 of FastEndpoints in Depth.
29 articles filed under this topic.
Controllers grow sideways and Minimal APIs grow into soup. FastEndpoints bets on a third shape - one class per endpoint - and this series reads its source to see how the bet is implemented. Part 1 of FastEndpoints in Depth.
Seventeen parts of reading FastEndpoints and the series never once mentioned mappers - the entity-translation layer half the endpoint base classes exist to serve. The Missing Chapters opens with the biggest gap: where mappers live, how they are found, and why they are secretly singletons. Part 1 of FastEndpoints — The Missing Chapters.
FastEndpoints.A2A publishes an agent card at a well-known URL and answers agent-to-agent calls through a JSON-RPC 2.0 dispatcher written entirely by hand - implementing exactly the slice of the A2A protocol it can do honestly. The final missing chapter, and the close of both series. Part 12 of FastEndpoints — The Missing Chapters.
FastEndpoints.Mcp exposes opt-in endpoints as Model Context Protocol tools - schemas generated from your DTOs and enriched from your validators, a synthetic HttpContext that runs the real pipeline, and a visibility model that deliberately ignores your REST auth. Part 11 of FastEndpoints — The Missing Chapters.
FastEndpoints.CommandRules sounds like a Roslyn analyzer and is nothing of the sort - it is a small rules engine that turns an input into planned commands and dispatches each one now or onto a job queue. A close read of the newest package in the repo, capability matrix and all. Part 10 of FastEndpoints — The Missing Chapters.
FastEndpoints will hand you a typed client four different ways - NSwag-generated C# or TypeScript, or Kiota clients built over either OpenAPI stack - served as a download endpoint or produced by a run-then-exit build mode. The lineages, the seams, and one version pin that tells a story. Part 9 of FastEndpoints — The Missing Chapters.
Buried in the FastEndpoints package props is a comment marking NSwag for deprecation - and a whole second OpenAPI stack built on Microsoft.AspNetCore.OpenApi already ships beside it. Transformers instead of processors, AOT export via MSBuild tricks, and a golden-master test suite. Part 8 of FastEndpoints — The Missing Chapters.
FastEndpoints.OData is ninety lines that bolt Microsoft's OData query engine onto a REPR endpoint - a sealed Configure(), a fake ParameterInfo, and an endpoint filter that fishes the response out of HttpContext.Items. Reading it is a masterclass in integrating with a framework through its narrowest seam. Part 7 of FastEndpoints — The Missing Chapters.
FastEndpoints.HealthChecks is the strangest package in the repository - it never references FastEndpoints. One extension method, an IStartupFilter, an always-healthy self check, and two probes Kubernetes understands. Part 6 of FastEndpoints — The Missing Chapters.
Mappers, validators, processors, even the Resolve<T>() you call in a handler - almost none of it goes through your DI container the way you assume. A static ServiceResolver with two caches sits behind everything, and reading it explains both the speed and the sharp edges. Part 5 of FastEndpoints — The Missing Chapters.
The Config object you lambda into UseFastEndpoints is a thin view over nine process-wide static option singletons - and its properties hide the most useful hooks in the library: endpoint filters, a global configurator, warm-up, serializer swaps and custom value parsers. Part 4 of FastEndpoints — The Missing Chapters.
FastEndpoints ships a CSRF middleware that is opt-in per endpoint, only inspects form posts, and refuses to start your app if you wired it up wrong. It earned a single clause in seventeen parts - here is the whole story. Part 3 of FastEndpoints — The Missing Chapters.
The Send facade is a struct, its methods return a fake Void, and every sender secretly marks the response started before writing a byte. A tour of the response surface the deep dive skipped - files, ranges, redirects, interceptors and all. Part 2 of FastEndpoints — The Missing Chapters.
Seventeen parts of reading FastEndpoints and the series never once mentioned mappers - the entity-translation layer half the endpoint base classes exist to serve. The Missing Chapters opens with the biggest gap: where mappers live, how they are found, and why they are secretly singletons. Part 1 of FastEndpoints — The Missing Chapters.
After sixteen parts inside the source, the honest retrospective - what the library gets right, the sharp edges that will cut you (singletons, statics, magic), and the projects where I would leave it on the shelf. Part 17, the conclusion of FastEndpoints in Depth.
The cross-cutting drawer of FastEndpoints holds a rate limiter that documents its own limitations, idempotency built on output caching, server-sent events - and a full implementation of the x402 micro-payments protocol. Part 16 of FastEndpoints in Depth.
Everything FastEndpoints does with reflection - discovery, setters, factories - has a compile-time twin in its source generators, and following that migration is a case study in making a reflection-heavy library AOT-ready. Part 15 of FastEndpoints in Depth.
FastEndpoints ships a testing package where tests call endpoints by class name, apps boot once per fixture, and even command handlers can be faked - the route string never appears in a test. Part 14 of FastEndpoints in Depth.
FastEndpoints' job queues persist commands through a storage provider you supply and execute them with a semaphore design that idles without polling. The state machine in JobQueue.cs is worth the read on its own. Part 13 of FastEndpoints in Depth.
FastEndpoints.Messaging.Remote executes the same ICommand on another machine over gRPC, serialized with MessagePack instead of protobuf contracts - plus an event hub mode that turns a server into a lightweight broker. Reading it explains both the magic and the trade. Part 12 of FastEndpoints in Depth.
FastEndpoints ships in-process messaging that covers most MediatR use cases - events with three wait modes, commands with middleware pipelines, generic and streaming handlers. The dispatch code makes some sharp lifetime choices worth knowing. Part 11 of FastEndpoints in Depth.
FastEndpoints' Swagger support is a thousand-line translation layer that knows which DTO properties are route params, which FluentValidation rules are schema constraints, and which endpoint versions belong in which document. Part 10 of FastEndpoints in Depth.
FastEndpoints suffixes versions by default - /api/orders/v2 - and its release-group model versions endpoints, not APIs. Reading the route-building code explains the philosophy, and the AspVersioning bridge covers everyone it doesn't fit. Part 9 of FastEndpoints in Depth.
The FastEndpoints.Security package covers the token lifecycle end to end - creation with symmetric or RSA keys, an abstract refresh-token service that is secretly an endpoint, and a revocation middleware that makes you pay the lookup tax honestly. Part 8 of FastEndpoints in Depth.
Permissions(), Claims() and Scopes() in Configure() feel like magic until you read the mapping code - every endpoint gets its own named authorization policy built from closures at startup, and roles ride a plain AuthorizeAttribute. Part 7 of FastEndpoints in Depth.
FastEndpoints' processors are its cross-cutting hook - but their exact pipeline position, the shared state trick, and a captured exception that waits in a finally block are what make them genuinely useful. Part 6 of FastEndpoints in Depth.
FastEndpoints wires FluentValidation into the pipeline by request-DTO type, runs validators as singletons, and shares one failure list between binder, validator and handler. The lifetime rule is the part that bites. Part 5 of FastEndpoints in Depth.