Skip to main content
Version: 4.x

EXP3004: No validator can apply the schema

Raised as an error, in every environment.

A decorator such as @validatedBody(schema), or validateBody(schema) in a micro application, names a schema, and no registered adapter can apply it. The request is answered with 500: the handler says the value is validated, and accepting it unchecked would break that.

class-validator classes, zod schemas and yup schemas work out of the box.

Fix​

For a schema from another library, register an adapter for it:

this.Middleware.addValidation({ adapters: [MyLibraryAdapter] });

All codes are listed under Error responses.