Skip to content

Format config schema error locations as JSON Pointers - #9698

Merged
lpcox merged 5 commits into
mainfrom
copilot/go-fan-review-jsonschema-v6
Jul 20, 2026
Merged

Format config schema error locations as JSON Pointers#9698
lpcox merged 5 commits into
mainfrom
copilot/go-fan-review-jsonschema-v6

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The config validator was emitting jsonschema.ValidationError.InstanceLocation values without the leading /, so user-facing paths were not RFC 6901 JSON Pointers. It also fell back to generic guidance for some schema composition/conditional failures instead of surfacing actionable context.

  • JSON Pointer formatting

    • Format non-root InstanceLocation values as RFC 6901-style pointers.
    • Preserve <root> for top-level failures.
  • Richer schema error guidance

    • Add specific guidance for allOf failures.
    • Add keyword-path fallback dispatch so unhandled concrete error kinds can still map to known guidance for conditional keywords like if, then, and else.
  • Focused regression coverage

    • Update existing config error-formatting tests to assert pointer-style locations.
    • Add coverage for allOf messaging and keyword-path fallback behavior.
location := "<root>"
if len(ve.InstanceLocation) > 0 {
	location = "/" + strings.Join(ve.InstanceLocation, "/")
}

Copilot AI linked an issue Jul 20, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Review Go module santhosh-tekuri/jsonschema/v6 Format config schema error locations as JSON Pointers Jul 20, 2026
Copilot finished work on behalf of lpcox July 20, 2026 13:56
Copilot AI requested a review from lpcox July 20, 2026 13:56
@lpcox
lpcox marked this pull request as ready for review July 20, 2026 15:06
Copilot AI review requested due to automatic review settings July 20, 2026 15:06
@lpcox
lpcox merged commit 2b90615 into main Jul 20, 2026
31 checks passed
@lpcox
lpcox deleted the copilot/go-fan-review-jsonschema-v6 branch July 20, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Formats config validation locations as JSON Pointers and adds schema-specific guidance.

Changes:

  • Adds leading slashes to validation locations.
  • Adds allOf and conditional guidance.
  • Expands regression tests.
Show a summary per file
File Description
internal/config/validation_schema.go Updates location formatting and error guidance.
internal/config/validation_schema_error_format_test.go Tests pointer formatting and keyword guidance.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment on lines +278 to 280
if len(ve.InstanceLocation) > 0 {
location = "/" + strings.Join(ve.InstanceLocation, "/")
}
Comment on lines +509 to +510
if keywordPath := ve.ErrorKind.KeywordPath(); len(keywordPath) > 0 {
addFromKeyword(keywordPath[0])
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.

[go-fan] Go Module Review: santhosh-tekuri/jsonschema/v6

3 participants