Optional
descriptionOptional human-readable description of the validation error
This field is rarely populated in standard typia validation and is primarily intended for specialized AI agent libraries or custom validation scenarios that require additional context beyond the technical type information. Most validation errors rely solely on the path, expected, and value fields for comprehensive error reporting.
The expected type name or type expression
Technical type specification that describes what type was expected at
this path. This follows TypeScript-like syntax with embedded constraint
information, such as "string", "number & Type<'uint32'>",
"Array
The path to the property that failed validation
Dot-notation path using $input prefix indicating the exact location of the validation failure within the input object structure. Examples include "$input.member.age", "$input.categories[0]", "$input.user.profile.email"
The actual value that caused the validation failure
This field contains the actual value that was provided but failed
validation. Note that this value can be undefined
in cases where a
required property is missing or when validating against undefined
values.
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 name, actual value, and optional human-readable description provides the AI with comprehensive context to make accurate corrections, which is why ILlmFunction.validate() can achieve such high success rates in validation feedback loops.
The value field can contain any type of data, including
undefined
when dealing with missing required properties or null/undefined validation scenarios. This allows for precise error reporting in cases where the AI agent omits required fields or provides null/undefined values inappropriately.Real-world examples from AI function calling: