Detailed information about a specific validation error

Each error provides granular, actionable information about validation failures, designed to be immediately useful for both human developers and AI systems. The error structure follows a consistent format that enables precise identification and correction of type mismatches.

This error format is particularly valuable for AI function calling scenarios, where LLMs need to understand exactly what went wrong to generate correct parameters. The combination of path, expected type, and actual value provides the AI with sufficient context to make accurate corrections, which is why ILlmFunction.validate() can achieve such high success rates in validation feedback loops.

Real-world examples from AI function calling:

{
  path: "input.member.age",
  expected: "number & Format<'uint32'>",
  value: 20.75  // AI provided float instead of uint32
}

{
  path: "input.categories",
  expected: "Array<string>",
  value: "technology"  // AI provided string instead of array
}

{
  path: "input.id",
  expected: "string & Format<'uuid'>",
  value: "invalid-uuid-format"  // AI provided malformed UUID
}
interface IError {
    expected: string;
    path: string;
    value: any;
}

Properties

Properties

expected: string

Description of the expected type or format

path: string

The path to the property that failed validation (e.g., "input.member.age")

value: any

The actual value that caused the validation failure