Table of Contents

Class RequestValidation

Namespace
Olve.TypeSpec
Assembly
Olve.TypeSpec.dll

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

builder RouteHandlerBuilder
operation ApiOperation

Returns

RouteHandlerBuilder

Type Parameters

TRequest
TValidator