Skip to content

Review and document path generation in collect_all_errors feature#40

Draft
Copilot wants to merge 2 commits intofeat/allerrorsfrom
copilot/sub-pr-39
Draft

Review and document path generation in collect_all_errors feature#40
Copilot wants to merge 2 commits intofeat/allerrorsfrom
copilot/sub-pr-39

Conversation

Copy link

Copilot AI commented Feb 13, 2026

Reviewed path generation for schema_path and instance_path in the collect_all_errors feature per maintainer request. Implementation is correct with intentional design choices.

Changes

  • Resolved FIXME for UTF-8 validation: UTF-8 length check errors now report the relevant schema keyword (/minLength, /maxLength, or /pattern) instead of empty schema_path
  • Clarified indexing pattern: Added comments explaining why internal schema resolution uses i-1 (0-based JSON Pointer format) while error paths use i (1-based Lua indexing)
  • Documented design decision: Added API documentation note that paths use 1-based indexing to match Lua conventions, not RFC 6901's 0-based format
  • Removed misleading TODO: Clarified that empty instance_path for additionalProperties errors is intentional (refers to the object, not a specific property)

Path Format

-- Paths use 1-based indexing for Lua developers
{
  schema_path = "/allOf/1/required",    -- 1-based, not 0-based
  instance_path = "/user/emails/2",     -- 1-based array index
  error = "property name is required"
}

This deviates from JSON Pointer (RFC 6901) but aligns with Lua's native arrays, improving error message clarity for the target audience.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Tieske <1077043+Tieske@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix all error handling in code Review and document path generation in collect_all_errors feature Feb 13, 2026
Copilot AI requested a review from Tieske February 13, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants