Skip to content

Conversation

samchon
Copy link
Owner

@samchon samchon commented Jul 6, 2025

This pull request enhances the validation error reporting in IValidation and updates related functionality in OpenApiValidator. The changes aim to provide more comprehensive context for AI-driven validation processes by introducing a new optional description field and refining existing error attributes.

Enhancements to validation error reporting:

  • src/structures/IValidation.ts: Added an optional description field to the IError interface for human-readable explanations of validation errors. Updated the path and expected attributes to use more precise and standardized formats, improving clarity and compatibility for AI function calling scenarios.

Updates to error handling in OpenAPI validation:

  • src/utils/OpenApiValidator.ts: Modified the error handling logic to include the new description field when processing validation errors, ensuring that additional context is passed through the validation pipeline.

@samchon samchon requested a review from Copilot July 6, 2025 10:33
@samchon samchon self-assigned this Jul 6, 2025
@samchon samchon added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 6, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enhance validation error reporting by adding an optional human-readable description to IValidation.IError and ensuring it’s passed through in the OpenAPI validator.

  • Introduce description?: string field in IValidation.IError with updated interface documentation.
  • Update OpenApiValidator to include the new description field when constructing error objects.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/structures/IValidation.ts Added description?: string to IError and expanded doc comments
src/utils/OpenApiValidator.ts Propagated error.description into the returned validation error object
Comments suppressed due to low confidence (2)

src/utils/OpenApiValidator.ts:58

  • Add a unit or integration test to confirm that the description field from the validation error is correctly propagated by OpenApiValidator when provided.
          description: error.description,

src/structures/IValidation.ts:162

  • [nitpick] Consider adding a concrete example in the interface doc to illustrate when and how to provide the description field, which can guide consumers in AI-driven scenarios.
     * Optional human-readable description of the validation error

@samchon samchon merged commit 7ae642d into master Jul 6, 2025
4 checks passed
@samchon samchon deleted the feat/validation-error-description branch July 6, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant