MinimalApis.Extensions
MinimalApis.Extensions copied to clipboard
Ensure Validated<T> honors nullability of parameter like the default binding does
Currently, Validated<TValue>
can return a null
value even if the parameter was declared as non-nullable. RequestDelegateFactory
(i.e. the default binding logic in the framework) honors the nullability declared on the parameter type and in the case it determines nullability is not allowed and a null value is found, auto-replies with a 400 Bad Request. Validator<TValue>
can't auto-reply but it can set add an error to the errors collection and set a status code.
This might already be working as intended and best case is it just needs a test to verify.