Class RequestValidation
Runs a generated request-body validator (from the spec's @maxLength etc.) before the
handler; a failure is a 400 written by the API's IApiErrorWriter, like a binding failure.
public static class RequestValidation
- Inheritance
-
RequestValidation
- Inherited Members
Methods
WithRequestValidation<TRequest, TValidator>(RouteHandlerBuilder, ApiOperation)
Validates the endpoint's TRequest argument with a new TValidator.
public static RouteHandlerBuilder WithRequestValidation<TRequest, TValidator>(this RouteHandlerBuilder builder, ApiOperation operation) where TValidator : IValidator<TRequest>, new()
Parameters
builderRouteHandlerBuilderoperationApiOperation
Returns
Type Parameters
TRequestTValidator