return[]error{fmt.Errorf("Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v",t2.Name(),t.ReprKind(),pth,node.ReprKind())}
return[]error{fmt.Errorf("Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v",t2.Name(),t.ReprKind(),pth,node.ReprKind())}
}
}
keys,_:=node.KeysImmediate()
errs:=[]error(nil)
errs:=[]error(nil)
for_,k:=rangekeys{
foritr:=node.MapIterator();!itr.Done();{
k,v,err:=itr.Next()
iferr!=nil{
return[]error{err}
}
// FUTURE: if KeyType is an enum rather than string, do membership check.
// FUTURE: if KeyType is an enum rather than string, do membership check.
child,_:=node.TraverseField(k)
ks,_:=k.AsString()
ifchild.IsNull(){
ifv.IsNull(){
if!t2.ValueIsNullable(){
if!t2.ValueIsNullable(){
errs=append(errs,fmt.Errorf("Schema match failed: map at path %q contains unpermitted null in key %q",pth,k))
errs=append(errs,fmt.Errorf("Schema match failed: map at path %q contains unpermitted null in key %q",pth,ks))