encoding/openapi: marshal JSON via cue.Value.MarshalJSON master
Rather than via internal/encoding/json.Encode, which was an entirely separate implementation of a CUE to JSON marshaler working on cue/ast rather than cue.Value. We can use the cue.Value API by building the AST, which should not be an expensive operation given how the syntax trees describe concrete CUE values which can be encoded as JSON. There are several reasons to want to remove the cue/ast json encoder: * We do not want to maintain two JSON encoding implementations * cue.Value.MarshalJSON is more widely used, e.g. when exporting to JSON * We are converging towards Encode/Marshal APIs taking cue.Value rather than AST nodes, given that the former is much more flexible Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: Id2f5f02579f4cbc1e94a263035624bc5781b5587 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201935 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Roger Peppe <rogpeppe@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>