MinimalApi vs Mvc - ValidationOfHeaders
I have been playing around with MinimalApi, and was surprised to see that MinimalApi could not handle validating Required HttpHeaders in the same way that MvcControllers can:
MinimalApi Code
Mvc Code
The Mvc Examples returns a ValidationProblemDetails-based error if TraceId while MinimalApi just retuns 400.
Does anyone know, how I can get MinimalApi to validate headers and send a meaningful error back (hopefully a ValidationProblemDetails).
6 Replies
The Error from Mvc Looks like this for both Environment set to Development and Production
The Error from MinimalApi Looks like this for Environment set to Development
The Error from MinimalApi Looks like this for Environment set to Production