What a route may declare under validation.
validation
A single schema validates the body, which is what almost every route means:
@Post('/users', { validation: CreateUserSchema }) Copy
@Post('/users', { validation: CreateUserSchema })
A map validates several sources at once, each under its own key:
@Get('/users', { validation: { query: ListQuerySchema, params: IdSchema } }) Copy
@Get('/users', { validation: { query: ListQuerySchema, params: IdSchema } })
What a route may declare under
validation.A single schema validates the body, which is what almost every route means:
A map validates several sources at once, each under its own key: