whefter / nestjs-joi

Easy to use JoiPipe as an interface between joi and NestJS with optional decorator-based schema construction.
MIT License
25 stars 12 forks source link

Throw details object when raise a Bad Request Exception in case validate schema has failed #17

Closed liorzmetis closed 2 years ago

liorzmetis commented 2 years ago

Why are you manipulate the details instead return the ValidationError like this?

    const { error } = this.schema.validate(value, {
      abortEarly: false,
      allowUnknown: false,
    });
    if (error) {
      throw new BadRequestException(error);
    }
liorzmetis commented 2 years ago

oh i saw that i can use skipErrorFormatting