FastEndpoints: structuring request validation and errors
barretblake.dev
FastEndpoints structures validation around the bind -> validate -> handle flow and separates well-formedness checks from data-dependent business rules. The article shows how to collect multiple errors before returning a 400 response, rather than stopping the handler at the first failed check.
One design detail to watch: validators are singletons. To access a scoped dependency, the example uses Resolve<T> inside a rule; the article also explains the testing trade-off and how to customize errors globally with Problem Details.
