this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pkg/encoding/json: fix validator

cuelang.org/cl/1208701 introduced a bug
where the call to Validate would refer to the
original schema value, instead of the unified
result. This could lead to spurious errors.

Fixes #3932

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I03420535698b803c4f39a1a250c87243fdbb62be
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1215528
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+3 -7
+2 -2
pkg/encoding/json/manual.go
··· 148 148 } 149 149 150 150 vx := adt.Unify(c, value.Vertex(v2), value.Vertex(v)) 151 - x := value.Make(c, vx) 152 - if err := x.Err(); err != nil { 151 + v = value.Make(c, vx) 152 + if err := v.Err(); err != nil { 153 153 return false, err 154 154 } 155 155
+1 -5
pkg/encoding/json/testdata/gen.txtar
··· 152 152 } 153 153 } 154 154 issue3932: { 155 - f: json.Validate({ 156 - name!: string 157 - }) & json.Marshal({ 158 - name: "foo" 159 - }) 155 + f: "{\"name\":\"foo\"}" 160 156 } 161 157 valid: { 162 158 t1: {