Skip to content

Share JSON Schema compilation across validation paths - #16281

Merged
lpcox merged 2 commits into
mainfrom
copilot/go-fan-review-jsonschema-v6
Nov 10, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/go-fan-review-jsonschema-v6

Conversation

Copilot AI commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The repository already uses jsonschema/v6 v6.0.3, the reviewed latest release, with an upgrade canary in place. This change consolidates the embedded and custom-schema compilation paths.

  • Shared compilation: Both paths now use one helper to register schema resources and compile the document.
  • Behavior preserved: Custom schemas still register both the fetch URL and $id when they differ; callers retain their specific error context.
schema, compileErr := compileSchemaDocument(compiler, schemaID, schemaDoc, resourceIDs...)

Copilot AI changed the title [WIP] Review Go module santhosh-tekuri/jsonschema/v6 Share JSON Schema compilation across validation paths Nov 10, 2026
Copilot AI requested a review from lpcox November 10, 2026 16:52
@lpcox
lpcox marked this pull request as ready for review November 10, 2026 16:56
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 16:56

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.

🟢 Approval recommended

No active review issues are recorded for the shared JSON Schema compilation refactor.

No open issues 🎉

What changed in this PR

Consolidates JSON Schema compilation for embedded and custom configuration validation, addressing the duplication noted in #16264 without changing the dependency version.

Changes:

  • Adds a shared helper for resource registration and schema compilation.
  • Preserves custom-schema registration under both the fetch URL and $id when they differ.
  • Retains caller-specific error messages by distinguishing registration failures from compilation failures.
File Description
internal/​config/​validation_server.go Uses the shared helper for custom schemas while preserving resource aliases and error context.
internal/​config/​validation_schema.go Defines the shared helper and error wrapper, and uses them for cached embedded-schema compilation.

Review effort: Balanced (auto)

@lpcox
lpcox merged commit d43dc15 into main Nov 10, 2026
53 checks passed
@lpcox
lpcox deleted the copilot/go-fan-review-jsonschema-v6 branch November 10, 2026 17:02
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