Skip to content

@kaiord/core


@kaiord/core / ValidationError

Type Alias: ValidationError

ValidationError = object

Defined in: packages/core/src/domain/types/error-types.ts:16

Validation error details for a specific field.

Used by KrdValidationError to provide detailed information about validation failures.

Example

typescript
const error: ValidationError = {
  field: 'version',
  message: 'Required field missing',
  expected: 'string',
  actual: undefined
};

Properties

actual?

optional actual?: unknown

Defined in: packages/core/src/domain/types/error-types.ts:31

Optional actual value that failed validation


code?

optional code?: string

Defined in: packages/core/src/domain/types/error-types.ts:27

Stable, language-free machine code for the failure (e.g. min_gt_max, invalid_type). Presentation layers localize by this code, never by matching message text (see the failure-semantics spec). Absent when the source issue carries no derivable code.


expected?

optional expected?: unknown

Defined in: packages/core/src/domain/types/error-types.ts:29

Optional expected value or type


field

field: string

Defined in: packages/core/src/domain/types/error-types.ts:18

The field path that failed validation


message

message: string

Defined in: packages/core/src/domain/types/error-types.ts:20

Human-readable (English) error message