Skip to content

mapClassError

@tsed/ajv

Usage

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

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

Overview

ts
function mapClassError(error: AjvErrorObject, targetType: Type<any>): string | undefined;
  • error (AjvErrorObject): AJV error object to transform.

  • targetType (Type<any>): Class used to resolve property metadata.

Description

Rewrite class-related AJV messages using Ts.ED metadata.

For missing required properties, this method replaces the property key by the store-resolved property name when aliasing/naming is configured.

Released under the MIT License.