RequestValidator class

Checks request input with a DTO or a fluent schema.

A failed check throws the dox-core ValidationException (HTTP 422) with {"path": "message"}.

Constructors

RequestValidator({FormInput forms = const FormInput()})
const

Properties

forms → FormInput
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validateDto(DoxRequest req, DtoSchema<Object> schema, {Source? source}) → Future<Object>
Check the input of req with schema and give the object. source wins over the source of the DTO.
validateSchema<O>(Schema<O> schema, Object? data) → Future<O>
Check data with any schema and give its typed output.

Operators

operator ==(Object other) → bool
The equality operator.
inherited