jsonschema: resolve refs

Implement the $ref keyword, except for remote references (those
pointing outside the root schema).

Change-Id: Ia5ca88464e62e9c613970d8d9fcd1512ab288934
Reviewed-on: https://go-review.googlesource.com/c/tools/+/670775
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Jonathan Amsterdam 2025-04-26 11:26:58 -04:00 • committed by Gopher Robot
commit 12fa054310

View file

@ -115,8 +115,11 @@ type Schema struct {
// The parent base URI at top level is where the schema was loaded from, or
// if not loaded, then it should be provided to Schema.Resolve.
baseURI *url.URL
// The schema to which Ref refers.
resolvedRef *Schema
// map from anchors to subschemas
anchors map[string]*Schema
anchors map[string]*Schema
// compiled regexps
pattern *regexp.Regexp
patternProperties map[*regexp.Regexp]*Schema
}