Repository navigation
refactor(contract): 统一 JSON Schema 校验并保持兼容边界 - #248
Merged
Merged
Conversation
…onschema-go - Deduplicate schema validation: align with modelcontextprotocol/go-sdk and nexusdock, both of which natively use google/jsonschema-go. - Drop santhosh-tekuri/jsonschema/v6 and 12 transitive golang.org/x/text packages from the dependency tree (-640 KiB binary size). - Simplify internal/tool/contract by removing obsolete error-tree helpers in favor of direct error reporting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
基于 #247 的依赖去重方案继续收口,保留
google/jsonschema-go替换santhosh-tekuri/jsonschema/v6的方向,并补齐原 PR 暴露出的兼容性问题。主要变更:
required/type继续返回类似$.text is required、$.text must be string的稳定 reason。google/jsonschema-go只支持 Draft-07 / 2020-12 的事实做显式边界检查;不把 Draft-04 / Draft-06 / 2019-09 静默按新 Draft 解释。$ref路径以及 Draft 支持边界测试。验证:
go test ./internal/tool/contract ./internal/mcp/client ./internal/appgo test -p 1 ./...go test ./scripts/test -run TestScriptGovernance -count=1go vet ./...go build -trimpath ... ./cmd/agentdockgofmt/git diff --check说明:TianYi 上直接用 Git Bash 执行
scripts/test/check-scripts.sh会遇到 MSYSfile://与/dev/stderr的宿主兼容问题;Go 侧治理测试已通过,POSIX shell 自检交由 Linux CI 验证。原始实现与贡献来自 #247 / @myhomeiot。