Skip to content

mapErrors

@tsed/ajv

Usage

typescript
import { mapErrors } from "@tsed/ajv";

See /packages/specs/ajv/src/utils/mapErrors.ts.

Overview

ts
function mapErrors(errors: ErrorObject[], options: MapErrorsOptions): AjvValidationError;
  • errors (ErrorObject[]): Raw AJV error objects.

  • options (MapErrorsOptions): Validation context used to enrich error payloads.

Description

Map raw AJV errors to framework-level validation error output.

Enriches errors with collection/model information and contextual data values, then formats each message via the configured errorFormatter.

Released under the MIT License.