Migrate jsonschema v5→v6, eliminate fixSchemaBytes() workaround#8048
Draft
Copilot wants to merge 5 commits into
Draft
Migrate jsonschema v5→v6, eliminate fixSchemaBytes() workaround#8048Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
…e test assertions
Copilot
AI
changed the title
[WIP] Review and update santhosh-tekuri/jsonschema to v6.0.2
Migrate jsonschema v5→v6, eliminate fixSchemaBytes() workaround
Jun 24, 2026
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.
jsonschema/v5with Draft 7 doesn't support negative-lookahead regexes (Go'sregexppackage limitation), requiring a ~200-linefixSchemaBytes()runtime patcher.jsonschema/v6with Draft 2020-12 usesdlclark/regexp2for ECMAScript regex, eliminating the need entirely.Schema (
mcp-gateway-config.schema.json)$schemato Draft 2020-12not: {enum: [...]}equivalents directly in the schemaregistry,guard-policies,headers) directly — they were only in the schema at runtime viafixSchemaBytes()validation_schema.gofixSchemaBytes()andnewDraft7Compiler()fetchAndFixSchema→fetchSchema(returns raw bytes, no transformation)jsonschema.UnmarshalJSON+compiler.AddResource(url, any)(v6 takes a parsed doc, notio.Reader)strings.Contains(ve.Message, ...)fallbacks informatErrorContextwith a type-switch onve.ErrorKind:InstanceLocationis now[]string(joined with/for display);ErrorKind.LocalizedString(schemaErrPrinter)replacesve.Messagevalidation.gojsonschema/v6;AddResourceupdated to usebytes.NewReader+jsonschema.UnmarshalJSONTests
fetch_and_fix_schema_test.go(~500 lines testing the removed function)fixSchemaBytestransformationsvalidation_schema_error_format_test.go:ValidationErrorconstruction now usesErrorKind: &kind.X{}andInstanceLocation: []string{...};TestKeywordFromLocationremoved (helper deleted)validate_server_against_schema_test.go:compileSchemaForTestuses v6UnmarshalJSON+AddResource