jsonschema: dynamic references
A dynamic reference is like a dynamic variable in a programming language, with two twists: - There must be a dynamic anchor in lexical scope for the ref to resolve. (Think of it as declaring the dynamic variable.) - The ref resolves to the schema highest on the stack, not lowest. That feels odd, but it turns out to work for the intended purpose, which is to provide extension points for additional features. There is some distracting code motion and refactoring in this CL: resolveRefs was moved down in the file, and resolution of a single ref was split off. Change-Id: I17da6052e0782fc540d14b8a41b06a2645923872 Reviewed-on: https://go-review.googlesource.com/c/tools/+/674155 Auto-Submit: Jonathan Amsterdam <jba@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
172901f3ac
commit
2a09582fa4
1 changed files with 1163 additions and 101 deletions
|
|
@ -54,11 +54,6 @@ func TestValidate(t *testing.T) {
|
|||
}
|
||||
for _, g := range groups {
|
||||
t.Run(g.Description, func(t *testing.T) {
|
||||
for s := range g.Schema.all() {
|
||||
if s.DynamicAnchor != "" || s.DynamicRef != "" {
|
||||
t.Skip("schema or subschema has unimplemented keywords")
|
||||
}
|
||||
}
|
||||
rs, err := g.Schema.Resolve("", loadRemote)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue