import { CustomError } from '@celljs/core'; /** What class-validator reports for one property (the part Cell reads; the rest is kept as it is). */ export interface ValidationError { property: string; value?: unknown; constraints?: Record; children?: ValidationError[]; [key: string]: unknown; } /** Request data that failed validation; answers 400 with the errors as JSON (unless `detailedOutputDisabled`). */ export class ValidationErrors extends CustomError { constructor(readonly errors?: ValidationError[]) { super(errors === undefined ? undefined : JSON.stringify(errors)); } }